ignite icon indicating copy to clipboard operation
ignite copied to clipboard

[Maverick] No simulator found with name "iPhone 13"

Open jamonholmgren opened this issue 2 years ago • 5 comments

Describe the bug

When trying to run a new Maverick project with Xcode 14, I get this:

CleanShot 2022-09-16 at 10 47 00@2x
npx ignite-cli new PizzaApp
cd PizzaApp
yarn ios

Ignite version

Maverick

Additional info

no

jamonholmgren avatar Sep 16 '22 17:09 jamonholmgren

Workaround is to run:

yarn ios --simulator="iPhone 14"

jamonholmgren avatar Sep 16 '22 17:09 jamonholmgren

Is it possible this has to do with Xcode using an old workspace from a previous PizzaApp?

joshuayoes avatar Sep 16 '22 18:09 joshuayoes

This is baked into RN it seems?

https://reactnative.dev/docs/running-on-simulator-ios#specifying-a-device

https://stackoverflow.com/questions/68933467/npx-react-native-run-ios-is-picking-non-existing-simulator

frankcalise avatar Sep 17 '22 15:09 frankcalise

  1. Open Xcode workspace for existing project and select the device at the top image

  2. Select Add Additional Simulators... from the menu image

  3. Create an iPhone 13 simulator image

  4. Run yarn ios or yarn expo:start and you're good to go

frankcalise avatar Sep 17 '22 15:09 frankcalise

@jamonholmgren do we want to leave this issue open? This seems like an upstream issue to me

joshuayoes avatar Sep 19 '22 20:09 joshuayoes

I did just run into this trying to do Detox tests. Perhaps there is a way we could detect in Ignite whether the default simulator is available and print a warning?

joshuayoes avatar Sep 22 '22 03:09 joshuayoes

@joshuayoes perhaps we can pipe the output from applesimutils --list and see if it matches the detox config?

frankcalise avatar Sep 22 '22 03:09 frankcalise

add this "iphone13": "npx react-native run-ios --simulator=\"iPhone 13 Pro\"", in your script in package.json file and then run "npm run iphone13"

Gurminder-Kaler avatar Sep 23 '22 17:09 Gurminder-Kaler

@frankcalise I like that solution, it appears we may be able to install simulators for Xcode.

So perhaps the following logic may be good to add somewhere in the new command:

  1. Check if iPhone 13 is in applesimutils --list or xcrun simctl list devices output
  2. Warn user that default iOS simulator is not installed
  3. Give sample output of workaround (yarn ios --simulator="iPhone 14")
  4. Offer to run command to install default iPhone 13 simulator to Xcode (xcrun simctl create "iPhone 13" "iPhone 13" iOS 15.5

joshuayoes avatar Sep 23 '22 18:09 joshuayoes

add this "iphone13": "npx react-native run-ios --simulator="iPhone 13 Pro"", in your script in package.json file and then run "npm run iphone13"

@Gurminder-Kaler I'm not sure that will solve what we want. I'm trying to use your command with iPhone 7, which is not a simulator on my machine, and my xcode just resolves to the first one that isn't that version

joshuayoes avatar Sep 23 '22 18:09 joshuayoes

Closing as "not our bug"

jamonholmgren avatar Sep 26 '22 18:09 jamonholmgren