XcodesOrg / xcodes

The best command-line tool to install and switch between multiple versions of Xcode.
MIT License
3.6k stars 120 forks source link

Additional --path option for xcodes runtimes install command #256

Closed martinknabbe closed 1 year ago

martinknabbe commented 1 year ago

It would be beneficial and faster for us to download the runtime files from our own mirror. Similar to the xcodes install command the xcodes runtimes install command could get a --path option to specify the local path of the downloaded dmg file.

$ xcodes runtimes install 'iOS 15.0' --path '/Downloads/iOS15.dmg'

This would execute the same steps as the existing command with the difference of skipping the download and installing from a local file.

amosolgo-lutron commented 1 year ago

There is an existing option which might meet your needs. Excerpt from xcodes runtimes install --help: --directory <directory> The directory to download the runtime archive to. Defaults to ~/Downloads.

That option can be used with a custom directory to which the dmg file has already been downloaded. Alternatively, you can download the dmg to ~/Downloads and it should use the existing file without the --directory option.

The catch is that the dmg filename needs to match the default name for the image. In other words, your mirror needs to use the same filenames as Apple. In the case of iOS 15.0, I think that would be com.apple.pkg.iPhoneSimulatorSDK15_0-15.0.1.1633542405.dmg.

martinknabbe commented 1 year ago

Thanks for the hint. That works for us. I'm going to close the issue.