App opens and crashes on simulator using desktop Appium app

强颜欢笑 提交于 2019-12-20 06:39:33

问题


Test Environment

Desktop OS/version used to run Appium:Version 1.2.0-beta.3 (1.2.0-beta.3) Node.js version (unless using Appium.app|exe): Mobile platform/version under test:ios simulator iPhone 6s plus 10.2

1.Pulled latest code from sourcetree

2.opened xcode

3.made a archive file

4.got the app file from there.

5.opened Appium desktop app

6.added the desired capabilities

.{

"app": "/Users/Desktop/PreProd.app", "platformName": "iOS", "deviceName": "iPhone 6s Plus", "platformVersion": "10.2", "automationName": "XCUITest" }

8.The app opens and crashes

appium log file


回答1:


try to follow the below tutorial for real device setup

https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md

If it is done already, restart your device and MAC once and try executing again.




回答2:


To run in simulator, you should get the .app file from simulator folder NOT from the xcode archives.

The architecture for the archived build will be arm64/armv7, which can only be installed in real device.

To get .app file for Appium test in simulator :

Open project in Xcode --> expand your project --> expand products --> you will see .app file there.Go to file location and copy .app file.

You can use this .app file for Appium test in simulator.

Note : this only help if you have access to Source code. If you don't have access to source code to run the project and only have archived build, then only option you have is to run it in real device.




回答3:


The application crashes because the .app file you are trying to launch is either

  1. Not simulator compatible
  2. Not bundled and compiled with the current simulator architecture
  3. Has incorrect bundle id

Try building the .app file for the simulator using the xcode command

xcodebuild -arch x86_64 -sdk iphonesimulator11.3 -workspace {projectname}.xcworkspace -scheme {schemaname} -configuration {configurationname} SYMROOT=${WORKSPACE}/build/{projectname}.xcarchive

Once the .app file is generated, use that and try launching.



来源:https://stackoverflow.com/questions/46079110/app-opens-and-crashes-on-simulator-using-desktop-appium-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!