Expo React-Native iOS Simulator not working

2020-02-24 13:45发布

问题:

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..

回答1:

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



回答2:

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



回答3:

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",



回答4:

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



回答5:

Manually opening the simulator first can help:

open -a Simulator

Then if using expo:

expo start 

Finally click:

"Run on iOS simulator"


回答6:

expo client:install:ios

This worked for me.



回答7:

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.



回答8:

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.



回答9: