App opens and crashes on simulator using desktop A

2020-05-03 16:43发布

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

3条回答
啃猪蹄的小仙女
2楼-- · 2020-05-03 17:20

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楼-- · 2020-05-03 17:32

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.

查看更多
疯言疯语
4楼-- · 2020-05-03 17:35

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.

查看更多
登录 后发表回答