Jenkins Xcode 12.1 "Failed to find newest available Simulator runtime"

Hi,

I've upgraded to Xcode 12.1 this week, and now all my builds fail with this error: "Failed to find newest available Simulator runtime"

I have seen this issue reported in the beta, but apparently not fixed. I have tried several things as listed in this link https://stackoverflow.com/questions/62875323/xcode-12-beta-cannot-find-simulator-runtime/64503950#64503950


I am seeing this issue on Xcode 12.2 using the default install of Jenkins. None of these solutions work, and the "manual run of the sh script" results in Jenkins not even being able to load at all.

I am using a build command against a device (not a simulator) that looks like this:

/usr/bin/xcodebuild -scheme MyApp -workspace MyApp.xcworkspace -configuration Debug clean build DEVELOPMENT_TEAM=XXXXXXXXXX -allowProvisioningUpdates test -destination platform=iOS,id=theIDofADeviceNotASimulator

This command runs fine when I run it from the command prompt of my regular admin console user, but not from jenkins.

Jenkins is installed normally under it's own /users/Shared/Jenkins account.

Also, I see that in the Xcode 12.2 release notes (I am on 12.1) there is still a "known issue" that says Simulators may not be available when running command-line tools like simctl or xcodebuild from a non-root LaunchDaemon, or when launching as a different user from the current user (for example, with sudo or launchctl). (62188195) - https://developer.apple.com/documentation/xcode-release-notes/xcode-12_2-beta-release-notes

The issue seems to exist on the devices as well as the simulators.
Answered by russ.gaia in 643223022
The solution is to reinstall Jenkins using homebrew under your regular user, have them auto-login, then use a LaunchAgent attached to that user to start jenkins when your user logs in.

Jenkins no longer supports being installed using the "jenkins user" and running as a LaunchDaemon, and neither does Xcode.
Accepted Answer
The solution is to reinstall Jenkins using homebrew under your regular user, have them auto-login, then use a LaunchAgent attached to that user to start jenkins when your user logs in.

Jenkins no longer supports being installed using the "jenkins user" and running as a LaunchDaemon, and neither does Xcode.
Its really irresponsible for asking users to reinstall whole process. Setting up tasks, plugins, authentication so forth is not feat that you do in few minutes.

Please provide valid solution.
Jenkins Xcode 12.1 "Failed to find newest available Simulator runtime"
 
 
Q