Error when running Appium on SauceLabs --> posix spawn failure, code 253 - ios

I am attempting to run my tests suit on SauceLabs cloud (using Appium) for a trial and I am repeatedly getting the following message in the log:
[33m[INST STDERR] posix spawn failure; aborting launch (binary == /var/folders/bl/1800rz_j7blcqx8pthyrq59h0000gn/T/tmpb4mJhr/myApp.app/myApp).[39m
2015-03-29 14:02:07:379 -
info: [debug] [33m[INST STDERR] Instruments Trace Error : Error Starting Recording[39m
2015-03-29 14:02:07:444 -
info: [debug] [90m[INSTSERVER] Instruments exited with code 253[39m
I think it has something to do with the way our app is compiled but the test works flawlessly on my local Mac and on my device as well (compiled for Debug).
I tried the same with their sample app and it works just fine. Is there something I am missing?
Thanks in advance, Pavel

If you're running on saucelabs you're probably in the iPhone simulator, which runs on x86_64 architecture. Its likely you're sending it an app compiled to run on ARM (what real iDevices use), which the simulator doesn't understand.
If you're using the xcodebuild command to build your app from the terminal, you can add the flag -sdk iphonesimulator8.1 or similar. It will handle the rest, and you should be able to run that on saucelabs.

Related

How to solve 'Test runner exited before starting test execution' error for iPhone Devices

Context -
We have E2E Testing running on the CI on the iPhone devices.
The script performs the following steps -
Build the Test runner app from code.
Extracts the app file from the IPA.
Re-codesign the app with the required Provision Profiles.
Creates a .xctestrun file
Uses the xcodebuild command like the following to run the test -
xcodebuild -sdk iphoneos -destination id=<device_id> -xctestrun <path_to_xctestrun_file> -resultBundlePath <path_to_test_bundle_file> test-without-building -only-testing:E2ETestsBundle.xctest/<test_filter>
The above command installs the runner and target app into the device and starts executing the test.
The apps get installed and uninstalled at each run during a single execution.
Problem -
During the execution, the xcodebuild CLI tool, suddenly loses connection to the device and is not able to install the apps into the device and then results in the following error -
Testing failed:
E2ETestsBundle.xctest:
E2ETestsBundle-Runner encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. (Underlying Error: Test runner exited before starting test execution. If you believe this error represents a bug, please attach the log file at /var/folders/1r/0xlnbmzd0yj3m_cc7p95yb4r0000gn/T/tmpl7d9p1s6/testResults.bundle/Staging/1_Test/Diagnostics/E2ETestsBundle-Configuration-Test Scheme Action-Iteration-1/E2ETestsBundle/Session-E2ETestsBundle-2022-04-13_205520-muaMCx.log))
** TEST EXECUTE FAILED **
Points to note -
The xcodebuild CLI tool will keep on failing with the error once it occurred until recovered.
Even while the xcodebuild is in a failed state, the devices are still accessible via Xcode IDE and other CLI tools like libimobiledevice and are able to install both the test runner and target applications.
This is occurring intermittently across all devices models and across subversions of iOS 14 and 15.
Recovery -
The only way to recover is to reboot the device.
Even after a reboot, the devices start facing this exception again after a few days of execution.
As we can’t keep on rebooting the device every time before execution, we need a solution to fix this problem.
Any help would be appreciated!!

WebDriverAgent] xcodebuild exited with code '75' and signal 'null' -How to resolve the issue

s already started! [WebDriverAgent] xcodebuild exited with code '75' and signal 'null' [WebDriverAgent] xcodebuild exited with code 'null' and signal 'SIGTERM'
Am getting this error on parallel execution via running Simulators . IF am running with individual Simulator it works fine and also if am running cross platform parallel like emulator and simulator is working fine
Issue with via multiple instance of simulator .could you please help me in resolving this issue because mostly am in IOS automation and I could require running scripts with multiple simulator or real devices using cucumber framework FYI

Is it possible to build .app file without the source code? If we just have the app installed on the iOS device and can extract .ipa

If we have an iOS app, it is a test build (enterprise build) deployed on Test Flight.
I can extract the .ipa after installing the app on the device and connecting it to iTunes.
And then I zip the .ipa file and unzip it, it shows .app file within the extracted folder of that app.
Can I use this .app file to run iOS appium scripts on simulator?
I tried doing it but it gave error -
error: Failed to start an Appium session, err was: Error: Instruments crashed on startup
info: [debug] Error: Instruments crashed on startup
at Instruments.onInstrumentsExit (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:387:31)
at null. (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:308:12)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess.handle.onexit (childprocess.js:820:12)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Instruments crashed on startup)","origValue":"Instruments crashed on startup"},"sessionId":null}
info: <-- POST /wd/hub/session 500 115895.509 ms - 182
Can someone please suggest some steps to launch this enterprise iOS test app on iOS simulator using appium ?
No. The device app is compiled for arm. The simulator runs intel code.

trigger.io Can't debug on iOS device

I am developing an app with trigger.io using some native plugins for iOS and i am having issues debugging my application.
The app is successfully transferred to the device, the app starts up and is suddenly terminated. The trigger io console output ends with:
[INFO] (lldb) connect
[INFO] Process 0 connected
[INFO] (lldb) waiting for connection event
[INFO] No connect event, assuming we are already connected
[INFO] (lldb) run
[INFO] error: process launch failed: failed to get the task for process 386
Here is a gist of the full output
My lldb version is lldb-320.4.124.10 .
Forge tools running at version 3.3.82, Xcode 6.0.2, the device is running iOS 8.0.2
Any hints are appreciated.
We've noticed that sometimes lldb & ios-deploy can get themselves into a hung state, especially if you have multiple forge run commands active.
To see if this is the issue here, try running:
lsof -i:12345
Try killing all processes listed and see if that helps.
This error also appears when you pick an ad-hoc or other production provisioning profile. Make sure that your code signing is for development.

How to run UIAutomation on simulator using Xcode bots - strange behaviour

I would like to run UIAutomation tests on simulator using Xcode bots. I add this command to past-actions script launched after ARCHIVE phase in xcode:
instruments -t "/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate" /Users/ktos/appliation.app -l 10000 -v
Xcode bots log followinng error:
instruments[6702:507] Recording cancelled : At least one target failed to launch; aborting run
Instruments Trace Error : Error Domain=com.apple.instruments Code=1 "Error Starting Recording" UserInfo=0x7fc053b3a310 {NSLocalizedDescription=Error Starting Recording, NSLocalizedRecoverySuggestion=At least one target failed to launch; aborting run}
Instruments Trace Error : Failed to start trace.
When I use exactly the same command in my terminal, on the same computer the instruments runs simulator without any problems. Do you have any idea what could be wrong ?
It may also be possible that Instruments is running in the background. Do a $ps -A and check and kill it.

Resources