Azure Devops running iOS XCUITests gives "Failed to start launchd_sim:" - xcode

When running my XCUITests on Azure Devops and I use 2 simulators, I get the following error:
Unable to boot the Simulator. launchd failed to respond. (Underlying Error: Failed to start launchd_sim: could not bind to session, launchd_sim may have crashed or quit responding)))
When I use one simulator it works. Is there a way to reset the simulator are delete deviated data? Any other idea what could help is highly appreciated.
EDIT: Here are the 2 simulators I run:
destinations: |
platform=iOS Simulator,name=iPhone 8,OS=15.4
platform=iOS Simulator,name=iPhone 14,OS=16.1
I first ran them maxParallel: 4. Now I reduced to maxParallel: 1 with the result that it sometimes works and sometimes not. Really strange.
In the Xcode project I use a testplan where "Execute in parallel (if possible)" is not checked.

Related

How To Determine a tvOS Simulator Started and Ready?

I'm working on an Ant build automating start/boot of a tvOS simulator, installs app in the running simulator and launch.
When I execute install-to-simulator command, many a time it appears that the simulator is not fully started yet, hence thrown an error like:
[exec] Unable to lookup in current state: Shutdown
I added a delay of 10 seconds between the start-simulator and install-to-simulator commands, but that solution isn't sufficient either.
How I can determine the state of a particular simulator? Or, how to ensure that the simulator is properly started and not in 'Shutdown' state anymore?
Initially I tried to find a solution with following command:
xcrun simctl spawn booted log stream
Unfortunately, I couldn't able to find much of an answer to my needs from the available options.
Thus, I chose to resort on following command:
// since I have simulator UDID already available
xcrun simctl list devices available | grep '$UDID'
This returns me a string output in following way:
Apple TV 4K (3rd generation) (Booted | Shutdown)
Therefore a string-check for "(Booted)" or "(Shutdown)" from the output value, does the job for me.

Nativescript Sidekick Publish to App Store

I'm running Sidekick on my Windows 10 machine (64b).
I'm trying to publish my app to the Apple AppStore.
Certificate, provision is all ok.
When I publish, build is made, I can log in when asked and fill in the verication code.
But then I get error 'Spawn Failed'. Googled this error, but didn't find anything.
Erros in the log are:
[19-03-08 10:52:20.711] (CLI) Build machine host name:
administrators-Mac-16.local
[19-03-08 10:52:58.349] Spawn failed.
, Error: Spawn failed.
at CloudPublishService.getiOSError (C:\Users\bartad\AppData\Roaming.nativescript-cli\extensions\node_modules\nativescript-cloud\lib\services\cloud-publish-service.js:79:21)
at CloudPublishService.
(C:\Users\bartad\AppData\Roaming.nativescript-cli\extensions\node_modules\nativescript-cloud\lib\services\cloud-publish-service.js:96:29)
at Generator.next ()
at fulfilled
(C:\Users\bartad\AppData\Roaming.nativescript-cli\extensions\node_modules\nativescript-cloud\lib\services\cloud-publish-service.js:4:58)
at
Does anyone have an idea what's wrong here ?
Thanks
Bart
Issues I encountered:
1) Provisioning was not right. Went back through and checked that each step is for a Distribution certificate and profile, not a development profile.
2) I assumed that tns resources generate would create my icons and splashes. It did, but Sidekick ignores them. You must recreate them in Sidekick.

xcodebuild "Software caused connection abort" UserInfo={NSLocalizedDescription=Error returned in reply: Connection interrupted}

Getting this error when running unit tests on Xcode 10 / Swift 4.2 on Travis CI with xcode10 image. Tests running properly from command line on local.
xcodebuild Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo={NSLocalizedDescription=Error returned in reply: Connection interrupted}
xcodebuild Error Domain=IDETestOperationsObserverErrorDomain Code=4 "Error returned in reply: Connection interrupted" UserInfo={NSLocalizedDescription=Error returned in reply: Connection interrupted, NSLocalizedRecoverySuggestion=If you believe this error represents a bug, please attach the result bundle at /Users/travis/Library/Developer/Xcode/DerivedData/...}
Testing failed:
xctest encountered an error (Error returned in reply: Connection interrupted)
** TEST EXECUTE FAILED **
Don't recall having seen this "connection interrupted" error before.
I was experiencing this as well on some Xcode 10 and 10.1 Beta agents as well. After our team turned off parallel testing it seemed to work correctly again.
I'm not sure if turning off parallel testing is a good solution for you, but it worked for us. I can't find any documented bugs yet that say this is an issue.
So after trying different things, including turning off tests parallelization, as Brian suggested before, we figured out this seems to be related to having both multiple destinations and parallelization.
There is a new -disable-concurrent-destination-testing flag that can be passed to xcodebuild, to force multiple destinations to be run sequentially.
By using this flag, we can enable both test parallelization and randomization while testing multiple destinations, all in a single command.
xcodebuild -scheme <YourScheme> -destination <DestinationA> -destination <DestinationB> -quiet -disable-concurrent-destination-testing test-without-building
This seems to be working well both locally and on CI servers.

Xcode 6.2 UI tests don't run from Jenkins on simulator

i have got UI tests, and they don't run from Jenkins, but from current VM, when i log in via VNC i can start and them passed. My nodes connected to Jenkins via jnlp, vnc session is running. users are the same as in jenkins and local vm
xcodebuild -scheme 'QVC - QA' -sdk iphonesimulator -destination 'name=iPhone 6' test
12:38:28 Touch /Users/.../Library/Developer/Xcode/DerivedData/QVC-chdwbiakejemyxbyyafcpmiavikg/Build/Products/Acceptance-iphonesimulator/QVCTests.xctest
12:38:28 cd /Users/.../workspace/qvc-test/project/Sources
12:38:28 export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/.../.rvm/bin:/Users/.../ci-tools_new/xcpretty/bin:/usr/local/apache-ant/bin"
12:38:28 /usr/bin/touch -c /Users/.../Library/Developer/Xcode/DerivedData/QVC-chdwbiakejemyxbyyafcpmiavikg/Build/Products/Acceptance-iphonesimulator/QVCTests.xctest
12:38:28
12:40:28 2015-04-22 12:40:28.456 xcodebuild[53002:100b] [MT] IDEUnitTestsOperationsObserverDebug: Unable to get debug console for logging target process thread state.
12:40:28
12:40:28 Testing failed:
12:40:28 Test target QVCTests encountered an error (Canceling tests due to timeout in Waiting for test process to check in... If you believe this error represents a bug, please attach the log file at /var/folders/xx/l0mp3szd0bx332cv3qrw1v3h0000gq/T/com.apple.dt.XCTest-status/Session-2015-04-22_12:37:12-u1STY7.log)
12:40:28 ** TEST FAILED **
And on local machine i've run the same command but tests SUCCEEDED
R u running it on Jenkins slave with MacOS? If yes, you should connect your slave as JNLP, not ssh. XCode doesn't allow remote execution via SSH, but via JNLP all works ok.

Issue with IOS Instruments running from command line on build machine

I've successfully run IOS UI Automation Instruments from command line on my local Mac. When it starts to test, the simulator will automatically pop up and then do the stuff.
However, when I SSH to a build server (with OSX and xcode, will use Jenkins eventually) and try to do the same thing, it doesn't work well.
Building process is fine, but as long as I run instruments, the terminal will then hang there without doing anything. I figure it has something to do with iphone simulator GUI but since it's CLI, I don't know what's going on...
Do you guys have any idea? Thanks!!
.
After executing the command from Jenkins through SSH; in most cases you would see a pop up window as in the screen shot. You will have to get past this screen to execute your tests. This post addresses how to get past that issue Stop "developer tools access needs to take control of another process for debugging to continue" alert
I've had the same issue. instruments -w "$DEVICE" were ignoring parameters.
Same with
DEVICE_TARGET='iPhone 6 (8.1 Simulator)' cucumber --format json -o test-reports/cucumber-8.1-iphone.json
It were ignoring DEVICE_TARGET parameter.
Solved via running Jenkins slave NOT as a SSH slave but as the Slave agent via java web start
http://i.stack.imgur.com/lNlPA.png
As i understand this issue is caused by OS X launchagent that managing sshd and performs scope of restrictions for remote users.
IMPORTANT! Slave agent should be started from OS X desktop, not via ssh! I've connected via VNC and launched slave java web agent on the OS X UI terminal.

Resources