Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick fix to ignore new iOS 18 runtime downloadables #370

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

alvar-bolt
Copy link
Contributor

With introduction if Xcode 16 and iOS 18 simulators, a breaking change for xcodes was introduced through the simulators API. ("https://devimages-cdn.apple.com/downloads/xcode/simulators/index2.dvtdownloadableindex")

In order to keep current functionality working, I made 2 modifications:

  1. Make runtime source optional. This is needed as iOS 18 downloadable does not have that value.
  2. Add support for new cryptexDiskImage content type. As iOS 18 downloadable comes with new type of contentType, we should parse it in order to be able to process rest of the response.

In RuntimeInstaller, I've added logic to handle new optional and new content type be throwing error if those downloadable were to be used.

Test cases and fixtures were also updated to handle these new cases.

With introduction if Xcode 16 and iOS 18 simulators, a breaking change
for xcodes was introduced through the simulators API. ("https://devimages-cdn.apple.com/downloads/xcode/simulators/index2.dvtdownloadableindex")

In order to keep current functionality working, I made 2
modifications:
1. Make runtime source optional. This is needed as iOS 18 downloadable
does not have that value.
2. Add support for new `cryptexDiskImage` content type. As iOS 18
downloadable comes with new type of `contentType`, we should parse it
in order to be able to process rest of the response.

In RuntimeInstaller, I've added logic to handle new optional and new
content type be throwing error if those downloadable were to be used.

Test cases and fixtures were also updated to handle these new cases.
@Mr-Alirezaa
Copy link

+1

Currently both app and command-line are not able to list runtimes due to the mentioned breaking change.

@Ernest0-Production
Copy link

Ernest0-Production commented Jun 13, 2024

@MattKiazyk Could you please review this fix so that you can merge this PR as soon as possible??

@nicerloop
Copy link

see #368

@ashtl
Copy link

ashtl commented Jun 18, 2024

@MattKiazyk Is there anything blocking this fix being merged?

@dunester
Copy link

Thank you for working on this! Great fix, looking forward to the merge!

@testableapple
Copy link

Hey @alvar-bolt, thanks for the fix. Trying to test it, but still facing this issue:

$ git clone -b alvar/ios-18-quickfix https://github.com/alvar-bolt/xcodes
$ cd xcodes
$ make install
$ xcodes runtimes

...
100%: Build succeeded
Error: keyNotFound(CodingKeys(stringValue: "source", intValue: nil), Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "downloadables", intValue: nil), _PlistKey(stringValue: "Index 114", intValue: 114)], debugDescription: "No value associated with key CodingKeys(stringValue: \"source\", intValue: nil) (\"source\").", underlyingError: nil))

Am I doing something wrong here?

@ashtl
Copy link

ashtl commented Jun 24, 2024

@testableapple

git clone -b alvar/ios-18-quickfix https://github.com/alvar-bolt/xcodes

I followed these same steps and it worked fine for me. Did you uninstall the existing version of xcodes before you did this?

@testableapple
Copy link

testableapple commented Jun 24, 2024

@ashtl, fair enough. I was doing this on GitHub Actions and seems like it had the old version of xcodes.

Replacing xcodes with /usr/local/bin/xcodes worked for me:

$ git clone -b alvar/ios-18-quickfix https://github.com/alvar-bolt/xcodes
$ cd xcodes
$ make install
$ /usr/local/bin/xcodes runtimes

Moving forward, now I'm struggling to install the runtime itself, have you tried this?

$ sudo /usr/local/bin/xcodes runtimes install 'iOS 16.4'
Downloading Runtime iOS 16.4
Installing Runtime
Error: Failed executing: `/usr/bin/xcrun simctl runtime add /Users/runner/Downloads/iOS_16.4_Simulator_Runtime.dmg` (2).
Error: Process completed with exit code 1.

Weird that there is no stacktrace.

@ashtl
Copy link

ashtl commented Jun 24, 2024

@testableapple

If you try to add the downloaded runtime yourself outside of xcodes with xcrun simctl runtime add /Users/runner/Downloads/iOS_16.4_Simulator_Runtime.dmg it will probably give you better feedback.

I expect you already have the runtime installed - you can run xcrun simctl runtime list | grep 16.4 to verify this.

@testableapple
Copy link

@ashtl, it's not installed, and the reason for the failure is still unclear. It happens only with iOS 16.*, other runtime versions work fine.

Anyways, thanks for your help, for now I'll stick with a different tool to download the runtimes, at least until this fix is released.

@MattKiazyk MattKiazyk merged commit bb3bd6c into XcodesOrg:main Jun 28, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants