I try running the same command on my local machine, and am able to open the .app target with Appium. However, when I run Appium against the .app target generated by my Jenkins job, the simulator will load the launch screen and crash immediately. After doing much searching, I have been unable to get to the source of the problem. I’ve set my Appium settings, enabled native instruments, and a bunch of other things found here and on Stack Overflow but to no avail.
The not so useful crash log I see in the Appium console output is:
[iOSLog] [IOS_SYSLOG_ROW] Jun 1 15:19:11 Dans-MacBook-Pro com.apple.CoreSimulator.SimDevice.9AE7C2C2-3CB4-4A44-8288-AC2924D08A74.launchd_sim[69715] (UIKitApplication:com.myapp.MyApp 0x4fd4][69803]): Service exited due to signal: Trace/BPT trap: 5
Any tips on how to begin to debug this? Thank you!
I know there are countless posts with this generic issue, but hopefully I can help someone debug their own issue. Most solutions had to do with making sure the app was compiling against the correct sdk, and configuring Appium correctly to open the .app or .ipa file. I was doing both of these and still couldn’t figure out why my .app file kept crashing when starting up in the Appium simulator.
I had to build a .ipa file to run on my device, and then check my crash log there in order to debug what was happening. In my case, my crash log showed a couple frameworks weren’t being found. I made these frameworks optional in the project settings, which fixed the crash.
Next I made sure to set the Xcode plugin to build against the iphonesimulator sdk and not generate an ipa so that I could use the .app file on Appium. Finally it worked, but the key was to create the ipa file first so that I could take a peek at the crash logs in my Xcode device window. Whew!
Yes, I am trying to do the exact same thing. I create the app file but don’t know the exact command structure to launch the simulator and run the app. Here is what I am doing: “xcodebuild -sdk iphonesimulator10.2 -workspace /Users/r631173/.jenkins/workspace/tesdir000/mobile-workspace/ios/myWorkspace.xcworkspace -scheme myApp”. This build occurs successfully.
By default, Jenkins is unable to run GUI applications because it runs as a Daemon. A daemon runs in the background as part of the overall system, and isn’t tied to a specific user.
A big part of CI is running simulators and other GUI applications, so we’ll need another option. To fix this, you can change Jenkins to run as a Launch Agent. A launch agent runs in the background on behalf of a user.
@mayu you should just install certificates on slave. best solution before test refresh certificate (if you really need certificates). i do not need certificates for test with Simulator but i need when i build for distribution via HockeyApp.
So, I guess I do not really need to have the same certificate/provisioning file that the master uses as long as it is a “debug” build built on master? Is debug build the only requirement to get the test running on slave simulator?
The app crash on the slave simulator might be due to the build script configs (probably not having the correct architecture for simulator). Not sure.
My automation job setup is exactly the same as yours.
There are two jobs - appium automation job and the main iOS app job.
Would it be possible to share your Jenkins build script that is part of your main app job for generating .app and .ipa? I think the root cause of my test app crash on simulator is the build script config not working for the slave simulator. Does yours use the xcode plugin to generate .app and .ipa?