xcodes icon indicating copy to clipboard operation
xcodes copied to clipboard

Ability to install a specified simulator version

Open MaxDesiatov opened this issue 5 years ago • 8 comments

I'm mainly using xcodes as a replacement for Ruby-based xcversion. Unfortunately, xcodes lacks a great feature when compared to xcversion, that is simulator version management. It would be great if xcodes was able to provide a list of available simulators and install a specificied version.

MaxDesiatov avatar May 11 '20 15:05 MaxDesiatov

Hi @MattKiazyk and @interstateone 👋 Since I opened this discussion: https://github.com/xcpretty/xcode-install/issues/467 do you think we could get some help to port over the simulator feature from xcversion into xcodes?

Really looking forward to hearing from you 🤗 Thank you!

rogerluan avatar Sep 18 '22 23:09 rogerluan

This newly created issue is related to this one: #213, and it seems like there are Xcode-14-specific issues around managing additional simulators

rogerluan avatar Sep 18 '22 23:09 rogerluan

Hey @rogerluan thanks for starting that conversation on xcode-install. I'll do what I can to help ease on that transition.

MattKiazyk avatar Sep 19 '22 04:09 MattKiazyk

@MattKiazyk I would like to try implementing this feature. Open for a PR?

StevenSorial avatar Sep 20 '22 00:09 StevenSorial

@StevenMagdy I'm always open for PR's!

I have started looking into it, and am trying to wrap my head around how xcinstall does it vs how we could do on Xcodes, but more eyes on understanding the better I think.

Just talking out loud here for what I'm thinking:

  • [ ] Ability to download a simulator without logging in with Apple credentials.
  • [ ] Ability to install without user intervention (if possible)
  • [ ] Code must be easily reused between CLI and Xcodes.app (there's a long TODO of making it more shareable between the apps)

MattKiazyk avatar Sep 20 '22 00:09 MattKiazyk

I think apple changed the simulator-runtime architecture in Xcode 14.0, so I think xcode-install is not super useful, which is why it doesn't work anymore. My plan was to start implementing the feature for Xcode 14 only, to make it simpler and because xcode-install works fine for Xcode <14.0.

Ability to download a simulator without logging in with Apple credentials.

Not needed. Xcode 14.0 uses https://devimages-cdn.apple.com/downloads/xcode/simulators/index2.dvtdownloadableindex which includes the URLs, and images can be downloaded directly.

Ability to install without user intervention (if possible)

Apple mentions that xcrun simctl runtime add runtime.dmg is the only needed command, but I did not try tbh.

Code must be easily reused between CLI and Xcodes.app (there's a long TODO of making it more shareable between the apps)

Oh! I thought that the app just run the CLI internally so I did not put it into consideration. Sorry I never contributed to a CLI before 😊

StevenSorial avatar Sep 20 '22 03:09 StevenSorial

So looking into xcrun simctl runtime, I believe that only works on the current active/selected Xcode version only? So that might not work with installing older versions?

Let me know how you're making out. I'll work on the Xcodes.app side of things

MattKiazyk avatar Sep 20 '22 04:09 MattKiazyk

I think I support the idea of only supporting Xcode 14+, for a few reasons:

  • It's the way moving forward, future-proof
  • Significantly reduced scope, due to the differences in authentication and maybe the runtime architectures
  • xcversion will be sunset but it will still work for past versions, so it's not like users would be left hanging completely

(there's a long TODO of making it more shareable between the apps)

I was surprised by this as well 😱 I thought the app just consumed the xcodes Swift Package and implemented a thin UI layer on top of it 😮

rogerluan avatar Sep 20 '22 10:09 rogerluan

Added in 1.2.0 🎉 xcodes runtimes install 'iOS 16.0'

StevenSorial avatar Nov 18 '22 09:11 StevenSorial

@MattKiazyk we can prob close this issue? 🤗

rogerluan avatar Nov 18 '22 11:11 rogerluan

@MattKiazyk Great 🎉 I think now "Known Limitations" section of MIGRATION.md can be updated accordingly 👍🏻

byassine52 avatar Dec 13 '22 09:12 byassine52

@MattKiazyk @StevenSorial we will need documentation around how the new runtimes API work (in the README perhaps), should we create an issue for it? 🙇

rogerluan avatar Dec 21 '22 12:12 rogerluan

Thanks for the heads up @byassine52 , just updated 💪

rogerluan avatar Dec 21 '22 12:12 rogerluan

Cross-referencing the PR that closed this issue: https://github.com/RobotsAndPencils/xcodes/pull/230

rogerluan avatar Dec 21 '22 12:12 rogerluan