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

RN: CommandError: Can't determine id of Simulator #28345

Closed
JuanRdBO opened this issue Apr 21, 2024 · 9 comments
Closed

RN: CommandError: Can't determine id of Simulator #28345

JuanRdBO opened this issue Apr 21, 2024 · 9 comments
Labels
CLI Versioned Expo CLI -- `npx expo start`

Comments

@JuanRdBO
Copy link

JuanRdBO commented Apr 21, 2024

Summary

Hey guys,

I ran a bunch of yarn add/ yarn remove commands and all of a sudden I got this error CommandError: Can't determine id of Simulator app; the Simulator is most likely not installed on this machine. Run sudo xcode-select -s /Applications/Xcode.app`` when starting the dev server with npx expo start and then pressing `i`.

After some digging and verifying that the simulators, xcode and osascript all work properly (I can execute osascript -e 'id of app "Simulator"' properly) I looked into the source code of the cli here and added an error message to the try/catch block and saw this:

TypeError: (0 , _osascript).execAsync is not a function

Upgrading to the latest @expo/cli (0.18.1) yields a similar error: TypeError: (0 , _osascript(...).execAsync) is not a function

It seems that when running the command to start the expo cli, it can't find the import and crashes.

I found that forcing @expo/osascript version to be the previous one (2.1.0) fixes it for me, so there must be something wrong with 2.1.1

What platform(s) does this occur on?

iOS

SDK Version

50.0.17

Environment

expo-env-info 1.2.0 environment info:
System:
OS: macOS 14.4.1
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
Yarn: 4.1.1 - ~/.nvm/versions/node/v18.18.2/bin/yarn
npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
Watchman: 2024.04.08.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.15.2 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.2, iOS 17.2, macOS 14.2, tvOS 17.2, visionOS 1.0, watchOS 10.2
Android SDK:
API Levels: 25, 28, 29, 30, 31, 32, 33, 34
Build Tools: 29.0.2, 30.0.2, 30.0.3, 31.0.0, 32.0.0, 32.1.0, 33.0.0, 33.0.1, 34.0.0
System Images: android-28 | Google APIs ARM 64 v8a, android-28 | Google ARM64-V8a Play ARM 64 v8a, android-32 | Google APIs ARM 64 v8a, android-32 | Google Play ARM 64 v8a, android-33 | Google Play ARM 64 v8a, android-Tiramisu | Google Play ARM 64 v8a, android-TiramisuPrivacySandbox | Google Play ARM 64 v8a, android-UpsideDownCake-ext5 | Google APIs ARM 64 v8a, android-UpsideDownCake-ext5 | Google Play ARM 64 v8a, android-UpsideDownCakePrivacySandbox | Google Play ARM 64 v8a
IDEs:
Android Studio: 2023.1 AI-231.9392.1.2311.11330709
Xcode: 15.2/15C500b - /usr/bin/xcodebuild
npmPackages:
expo: ~50.0.17 => 50.0.17
expo-router: ~3.4.8 => 3.4.8
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
react-native: 0.73.6 => 0.73.6
npmGlobalPackages:
eas-cli: 7.8.2
expo-cli: 6.3.10
Expo Workflow: bare

Minimal reproducible example

This happens in the latest version of expo-cli

@JuanRdBO JuanRdBO added CLI Versioned Expo CLI -- `npx expo start` needs validation Issue needs to be validated labels Apr 21, 2024
@expo-bot expo-bot removed the needs validation Issue needs to be validated label Apr 21, 2024
@cem2ran

This comment was marked as spam.

@goaaron

This comment was marked as spam.

@Mohamed-kassim
Copy link

having the same issue here

@Kudo
Copy link
Contributor

Kudo commented Apr 23, 2024

we've published @expo/osascript@2.1.2 with fixes. by updating latest expo@next then you should include the newer osascript version. thanks for having the issue reporting!

@Mohamed-kassim
Copy link

Mohamed-kassim commented Apr 23, 2024

@Kudo
Thanks for the quick support, I was wondering if we have to update to expo@next? what about the current stable version of Expo 50?

@Kudo
Copy link
Contributor

Kudo commented Apr 23, 2024

@Mohamed-kassim you shouldn't add @expo/cli or @expo/osascript to your dependencies/devDependencies. these packages should be pulled in through the expo package. then for sdk 50, the @expo/osascript version pulled in would be 2.1.0.

@Mohamed-kassim
Copy link

Mohamed-kassim commented Apr 23, 2024

@Kudo
they are not in my dependencies, Expo 50.0.17 is pulling 2.1.1, I tried downgrading but didn't fix the issue, removing all node modules and lock files, but it's still pulling 2.1.0
actually this issue mentioned SDK 50.0.17, not expo next @JuanRdBO can confirm
Update: after cleaning the project now and reinstalling, it pulls 2.1.2, issue resolved

@nmassey
Copy link

nmassey commented Apr 23, 2024

Resolved for me, as well. ✅ Thanks, team! 🙌

My procedure to get the newer dependency:

  1. remove expo from package.json (for my Expo project running locally)
  2. run yarn
  3. re-add expo to package.json
  4. run yarn

@Kudo
Copy link
Contributor

Kudo commented Apr 24, 2024

oh i see. it's a caret version:

"@expo/osascript": "^2.0.31",

sorry the current solution is to pull the expo version again or regenerate the npm lock file. if there are any difficulty in regenerating the lock file. let us know and i'll think some alternatives.

i'm closing the issue. and thanks everyone for having the feedback.

@Kudo Kudo closed this as completed Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Versioned Expo CLI -- `npx expo start`
Projects
None yet
Development

No branches or pull requests

7 participants