Skip to content

fix: use “simctl list” to fetch device types, not file i/o #246

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

Merged
merged 4 commits into from
Apr 3, 2025

Conversation

hansemannn
Copy link
Contributor

@hansemannn hansemannn commented Apr 2, 2025

Wow, this was HARD to find..but this is what's happening:

  • Xcode 16.3 does not embed the device types (<device>.simdevicetype) under Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/DeviceTypes anymore, in fact, the whole CoreSimulator folder was nuked
  • Luckily, xcrun simctl list --json already returns them pre-formatted, so Apple likely decided to sunset the additional files
  • We now use that API to fetch the required model identifier and Watch support state
  • The following call (to check the devices from simctl) can then be merged into one loop to do all work in one step

Note: I have ditched the legacy code, so ioslib will only be compatible with Xcode 16.3+. As earlier versions use an earlier ioslib version anyway, I don't see a practical issue with that. If it is, feel free to extend this PR to restore that legacy code. The "devicetypes" key in xcrun simctl list --json is actually available since a while now, so we can retain backwards compatibility without issues!

@hansemannn hansemannn requested review from cb1kenobi and m1ga April 2, 2025 14:13
Copy link
Contributor

@m1ga m1ga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only tested the functionality and it works fine 👍
I've deleted 16.2 and only have 16.3 installed now (restarted my machine to be sure). ti info shows all simulators and I can build an app without issues

@cb1kenobi
Copy link
Contributor

Please update this PR to target main instead of 1_7_X.

@hansemannn hansemannn changed the base branch from 1_7_X to main April 3, 2025 13:39
@hansemannn
Copy link
Contributor Author

@cb1kenobi Rebased on main completed.

@cb1kenobi cb1kenobi merged commit 3219033 into main Apr 3, 2025
3 checks passed
@hansemannn hansemannn deleted the fix/xcode-16.3-compatibility branch April 3, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants