xcodes icon indicating copy to clipboard operation
xcodes copied to clipboard

Unable to download iOS runtime 18.x

Open borrrden opened this issue 1 year ago • 9 comments

The only output I can get out of the command is:

Downloading Runtime iOS 18.0: 0%
Error: ProcessExecutionError()

Of potential relevance, the mac is not new enough to actually run Xcode 16.1, but I only need it to exist so that .NET tooling can access the tooling inside of it. Otherwise, I have to update the OS on a machine that I don't have physical access to which can be a pain....

borrrden avatar Nov 01 '24 04:11 borrrden

Couple of questions:

  • what Xcodes version are you running (xcodes version)
  • what Xcode is selected xcode-select -p

Downloading of iOS 18 runtime is only supported when you have Xcode 16.1 installed and selected (it uses xcodebuild), so in your case, you might not be able to download the runtime with xcodes.

MattKiazyk avatar Nov 01 '24 16:11 MattKiazyk

Sorry for not including the information. I am on xcodes 1.6.0 and it is using Xcode 16.1 via the DEVELOPER_DIR switch (otherwise I get a different error message about needing Xcode 16.1).

My wild guess is that there is some executable inside that is not functioning correctly because of being on macOS 13. The same commands that xcodes runs (xcodebuild -downloadPlatform) claim to have downloaded the runtimes, but they appear to not actually do anything. They finish in just a few seconds, claiming the platform is downloaded, but I can't believe that an 8 GiB download would finish so quickly.

borrrden avatar Nov 01 '24 21:11 borrrden

+1 here trying to find what occurs, I have see:

  • Used xcodes version 1.6.0.
  • Needs to select current Xcode version: xcodes select 16.1. Then xcodes runtimes install 'iOS 18.0'.
  • Because needs this to install? I use current Xcode version 15.2 but elects 16.1 with configuration if I needed.
  • The runtime download and install its very slow comparating with Xcode download and install. And always mark 0% until finished.

For unattended installations I see two things:

  • Ask for a sudo password. Exists any env variable to set this?
  • Ask for a two factor code. Exists any env variable to disable this or automate without intervention?

cesarjorgemartinez avatar Nov 06 '24 14:11 cesarjorgemartinez

You can download any simulator in here then manually install it :

xcrun simctl runtime add "~/Downloads/iOS_18_Simulator_Runtime.dmg"

ThePredators avatar Nov 09 '24 01:11 ThePredators

Yes that is a workaround that I used but Apple explicitly made clear that those links are going to be removed in the future.

borrrden avatar Nov 12 '24 03:11 borrrden

@borrrden The new way to install runtimes without using the deprecated links on the website is:

xcodebuild -downloadPlatform iOS -buildVersion 18.1 -exportPath ./SimulatorRuntimes/
xcodebuild -importPlatform ./SimulatorRuntimes/iphonesimulator_18.1_22B81.dmg

See https://developer.apple.com/documentation/xcode/installing-additional-simulator-runtimes for more details

Although this remains a temporary solution, it is a more accurate approach.

It does not require you to login to your Apple account.

vanyasem avatar Nov 24 '24 20:11 vanyasem

I had tried those already but they exited immediately without actually downloading anything which was puzzling. I have a feeling it won’t actually work unless running a new enough macOS

borrrden avatar Nov 25 '24 07:11 borrrden

Hi,

And for this in a automated way?

For unattended installations I see two things:

Ask for a sudo password. Exists any env variable to set this?
Ask for a two factor code. Exists any env variable to disable this or automate without intervention? Or to write the code that appear in a Gui window to the terminal. (Button Allow and write the code)

For an user and password for Store can use XCODES_USERNAME and XCODES_PASSWORD but for a sudo password? This: xcodes requires superuser privileges in order to finish installation

cesarjorgemartinez avatar Dec 10 '24 17:12 cesarjorgemartinez

I wanted to share my view and workaround for tackling this issue.

The xcodes runtimes install command is not working for runtimes 18.x (iOS, tvOS, watchOS, visionOS) when integrating with CI, but it works well if we run the same command manually on the machine. I'm not sure why this behavior is occurring.

The workaround I have for now is:

  • Install older runtimes using the xcodes runtimes install command, such as 17.x or 16.x.
  • Install 18.x runtimes using the command xcodebuild -downloadPlatform iOS -buildVersion 18.1 -exportPath ./SimulatorRuntimes/. This command downloads and installs the simulators (all), so we do not need to explicitly run the importPlatform command.

I hope this helps.

ykhandelwal913 avatar Mar 05 '25 08:03 ykhandelwal913