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

Xcode 14 simulator list blank #466

Open
mzsanford opened this issue Sep 13, 2022 · 7 comments
Open

Xcode 14 simulator list blank #466

mzsanford opened this issue Sep 13, 2022 · 7 comments

Comments

@mzsanford
Copy link

mzsanford commented Sep 13, 2022

While working on a Fastlane / CircleCI setup for some new iOS 16 features I found I was unable to install a simulator.

$ gem install xcode-install && xcversion simulators --install="14.5" && xcrun simctl create 'iPhone 12 (14.5)' com.apple.CoreSimulator.SimDeviceType.iPhone-12 com.apple.CoreSimulator.SimRuntime.iOS-14-5
Successfully installed xcode-install-2.8.1
1 gem installed
[!] No simulator matching 14.5 was found. Please specify a version from the following available simulators:
Xcode 14.0 (/Applications/Xcode-14.0.app)

Exited with code exit status 1

I was also able to replicate this locally with Xcode 14 where my Xcode is showing the iOS 14.5 simulator in question installed. Tracing through xcode-install I found it is requesting the simulator list from https://devimages-cdn.apple.com/downloads/xcode/simulators/index-14.0.0-AF3613FA-81D9-4A8B-8204-9912665677FA.dvtdownloadableindex in InstalledXcode#available_simulators. It appears that URL is invalid and provides a standard AWS permissions error:

$ curl -Ls https://devimages-cdn.apple.com/downloads/xcode/simulators/index-14.0.0-AF3613FA-81D9-4A8B-8204-9912665677FA.dvtdownloadableindex
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>655A17VAM6GKQD6C</RequestId><HostId>I4RaiX9CMvnlJ/K1juQ1HIsIvpOn9NSR1BoJUI3PrTcGtBV7uMPpDxzQiRf2awmlNWqnd/vcio0=</HostId></Error>%

It is unclear to me if this is an Apple "error" or if something has changed with Xcode 14 creating a bug in xcode-install. Whichever is the case it appears XcodeInstall is swallowing the error.

@mzsanford
Copy link
Author

I fired up Proxyman and found that Xcode 14 requested the list from https://devimages-cdn.apple.com/downloads/xcode/simulators/index2.dvtdownloadableindex if that helps at all.

@EricAtomic
Copy link

EricAtomic commented Sep 15, 2022

Btw this issue seems to be causing CircleCI completely unable to test devices running iOS earlier than 15.5

@mzsanford
Copy link
Author

mzsanford commented Sep 15, 2022

@EricAtomic I made a fork with a hacked version to test this using the following commands:

    - run:
          name: Install iOS 14.5 Simulator
          command: >
            gem install specific_install &&
            gem specific_install -l https://github.com/mzsanford/xcode-install.git -b xcode14 &&
            xcversion simulators --install="iOS 14.5" &&
            xcrun simctl create 'iPhone 12 (14.5)' com.apple.CoreSimulator.SimDeviceType.iPhone-12 com.apple.CoreSimulator.SimRuntime.iOS-14-5

I ran into a different issue and ended up fixing my project so the test could run on iOS 15.5 as a workaround but maybe this will work for you. I did not make a PR because I'm unsure how that change will interact with different versions of Xcode.

@EricAtomic
Copy link

@mzsanford Thanks, that looks great!

@marcosgriselli
Copy link

@mzsanford what's your install_prefix?

@mzsanford
Copy link
Author

mzsanford commented Sep 16, 2022

@marcosgriselli I was unsure about that value, which is part of not making a real PR. I pulled that $(DEVELOPER) constant (note the single quotes, so not interpolated or executed or anything) from the output I found elsewhere from working versions. It might be totally wrong as I ended up just finding another workaround.

@marcosgriselli
Copy link

@rogerluan do you see any issues with updating the install prefix for this cases?

NachoSoto added a commit to RevenueCat/purchases-ios that referenced this issue Sep 23, 2022
Turns out we hadn't been running tests on `tvOS` for a while:
> [19:08:22]: Couldn't find any matching simulators for '["Apple TV
(15.2)"]' - falling back to default simulator
> [19:08:22]: Found simulator "iPhone 13 Pro (15.5)"

I found this went I went to dig into [this
failure](#1926 (comment)).
Turns out that wasn't running on `tvOS` anyway.

This turns them back on, fixes the compilation issues on `tvOS` tests,
and ensures that we don't run into this issue again.

### Changes:
- Renamed device in lane `test_tvos`
- Enabled `ensure_devices_found` on `iOS` and `tvOS` lanes. This will
also ensure that we don't stop running tests on iOS XX because it
doesn't find that simulator.
- Removed `UnitTestHostApp` storyboards and scene, since those aren't
supported in `tvOS`, and aren't needed because there's no UI.
- Made `StoreKitUnitTests` and `UnitTestHostApp` targets universal
- No longer linking `AdServices` on `tvOS` in test targets
- Disabled attribution tests on `tvOS`. Those methods weren't being
compiled, but we were testing that a message was being sent, even though
it no longer was.
- Changed iOS 14 tests to use Xcode 13 due to
xcpretty/xcode-install#466 (same as #1918).
NachoSoto added a commit to RevenueCat/purchases-ios that referenced this issue Sep 23, 2022
Turns out we hadn't been running tests on `tvOS` for a while:
> [19:08:22]: Couldn't find any matching simulators for '["Apple TV
(15.2)"]' - falling back to default simulator
> [19:08:22]: Found simulator "iPhone 13 Pro (15.5)"

I found this went I went to dig into [this
failure](#1926 (comment)).
Turns out that wasn't running on `tvOS` anyway.

This turns them back on, fixes the compilation issues on `tvOS` tests,
and ensures that we don't run into this issue again.

### Changes:
- Renamed device in lane `test_tvos`
- Enabled `ensure_devices_found` on `iOS` and `tvOS` lanes. This will
also ensure that we don't stop running tests on iOS XX because it
doesn't find that simulator.
- Removed `UnitTestHostApp` storyboards and scene, since those aren't
supported in `tvOS`, and aren't needed because there's no UI.
- Made `StoreKitUnitTests` and `UnitTestHostApp` targets universal
- No longer linking `AdServices` on `tvOS` in test targets
- Disabled attribution tests on `tvOS`. Those methods weren't being
compiled, but we were testing that a message was being sent, even though
it no longer was.
- Changed iOS 14 tests to use Xcode 13 due to
xcpretty/xcode-install#466 (same as #1918).
NachoSoto added a commit to RevenueCat/purchases-ios that referenced this issue Sep 6, 2023
…stall` with `xcodes` (#2421)

`CircleCI` is deprecating `Xcode 13` soon.

[`CircleCI` still recommends using
`xcode-install`](https://support.circleci.com/hc/en-us/articles/360011880714-How-do-I-add-different-simulators-to-my-iOS-builds-),
but [it breaks with Xcode
14](xcpretty/xcode-install#466), so [it's been
deprecated
now](https://github.com/xcpretty/xcode-install/blob/master/MIGRATION.md#known-limitations).
This replaces the runtime installation with
[`xcodes`](https://github.com/RobotsAndPencils/xcodes).
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

No branches or pull requests

3 participants