简体   繁体   中英

Expo React-Native iOS Simulator not working

Hello I'm facing a problem with Expo React-Native. Whenever I try to launch the iOS Simulator. I get this error:

 Simulator is installed but is identified as 'com.apple.CoreSimulator.SimulatorTrampoline'; don't know what that is. Simulator not installed. Please visit https://developer.apple.com/xcode/download/ to download Xcode and the iOS simulator. If you already have the latest version of Xcode installed, you may have to run the command `sudo xcode-select -s /Applications/Xcode.app`.

Screenshot of Expo Results

My NPM Version is 6.7.0 react-native-cli: 2.0.1 react-native: 0.57.1 Expo Version 2.11.9

Also I made sure my Command Line tools on Xcode is setup perfectly Xcode CommandLineTools

Finally, I also tried to run the command sudo xcode-select -s /Applications/Xcode.app

Nothing works..

I had the same problem, fixed it by manually starting the simulator app before starting expo.

The app is located in /Applications/Xcode.app/Contents/Developper/Applications/Simulator.app

According to this thread What does com.apple.CoreSimulator.CoreSimulatorService do? , you can just execute the launch correctly the simulator.

killall -9 com.apple.CoreSimulator.CoreSimulatorService

Actually, it works to launch the simulator, but if I restart once the simulator, the problem is still here.

Update:

Apple provided a patch 10.2.1 . After an update of XCode through the App Store, it seems working better. My simulator boots with an error, but after press "i" again in the terminal, it works correctly even if I restart the process.

Don't forget to update the latest version of expo-cli with npm install -g expo-cli

If it helps anyone else, the fix of opening the Simulator first was not working for me at first because I did not have command line tools installed. You can open xCode, go to preferences > locations > command line tools and if that is empty you'll need to install them. Once they are installed, expo start will give the same error as OP, but you can then use the open -a Simulator && expo start suggestion.

Manually opening the simulator first can help:

open -a Simulator

Then if using expo:

expo start 

Finally click:

"Run on iOS simulator"
expo client:install:ios

这对我有用。

Simplest solution I have found; change your npm start script within the package.json file of your Expo project:

"start": "expo start", > "start": "open -a Simulator && expo start",

Yes you can fixed it temporarily by starting the simulator app before starting expo : open -a Simulator; expo start

But the next time you open it, you have to run both commands again as well. For now, you can aliasing start to open -a Simulator; expo start

Yup, additionally you have to give permissions every time you relaunch.. and because these are alerts.. the simulator takes forever to render. This is not an acceptable workflow. For now im just rendering on a device. Really hoping this gets fixed proper and soon.

🎉 I've been facing the same problem for a month, however I finally found a solution that worked for me:

  1. Updated my Xcode to Version 11.1 ✨
  2. Opened Xcode 11.1: (1) Double checked if "Xcode 11.1" was selected as my "Command Line Tool"; (2) Under the "Components" tab, I manually downloaded a simulator (iOS 12.2)
  3. Updated Expo Client to @3.1.2 ✨ sudo npm install --unsafe-perm -g expo-cli
  4. Updated Node.js from version 11.6.0 to 12.0.0
sudo npm install -g n
npm cache clean -f
  1. Restarted my project & my simulator
  2. npm start

✨ Which successfully launched my iOS simulator and built my project!

尝试先从 Xcode 打开模拟器,然后启动 Expo Metro。

For me I happen to learn that it requires all the three to make react native app run on the iOS simulator.

  1. Xcode should be running
  2. Simulator should be running
  3. Expo Start and click on Run on iOS Simulator

It will then prompt on Simulator to install Expo Go for the first time and then would run app normally.

I was missing one or the other in my first two attempts to run the app on iOS Simulator.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM