sudo yarn run ios
It will open up the ios simulator but stop at Starting simulator... and forever.
Have try
Make sure Xcode is installed and open it to accept the license agreement if it prompts you. You can install it from the Mac App Store.
Open Xcode's Preferences, the Locations tab, and make sure that the Command Line Tools menu option is set to something. Sometimes when the CLI tools are first installed by Homebrew this option is left blank, which can prevent Apple utilities from finding the simulator. Make sure to re-run npm/yarn run ios after doing so.
If that doesn't work, open the Simulator, and under the app menu select Reset Contents and Settings.... After that has finished, quit the Simulator, and re-run npm/yarn run ios.
open the RN application
What actually happened when you performed the above actions?
If there's an error message, please paste the full terminal output and error message in this code block:
Error text goes here!
Please run these commands in the project folder and fill in their results:
npm ls react-native-scripts:[email protected]npm ls react-native:[email protected]npm ls expo: [email protected]node -v:v8.2.1npm -v:5.3.0yarn --version:0.27.5watchman version:Please provide a minimized reproducible demonstration of the problem you're reporting.
Issues that come with minimal repro's are resolved much more quickly than issues where a maintainer has to reproduce themselves.
Did you find a solution to this?
I have the same error here, it just hangs at Starting simulator...
The simulator opens but the application is not in it.
I have tried all the steps specified on the post and it still doesn't work.
npm ls react-native-scripts: [email protected]
npm ls react-native: [email protected]
npm ls expo: [email protected]
npm -v: 4.6.1
node -v: v8.7.0
watchman version:
{
"version": "4.9.0"
}
OSX 10.12.6
What happens if you open the iOS simulator before running yarn run ios?
@dikaiosune simulator opens fine as iPhone X. When I run sudo npm run ios it just hangs on Starting simulator... and no changes on the opened simulator.
I suspect it could be some kind of permission issue? Even though the project folder is on my desktop I have to run npm run ios with sudo, otherwise I get the following error Error: EACCES: permission denied, open '/Users/douglascarvalho/.expo/log'
Complete output from logs when running without sudo:
https://pastebin.com/6jSyukAb
sudo npm start works fine and I can access the app via the Expo app on my iPhone. npm start does not work...
I don't think you want to use sudo to run a CRNA project. What happens if you don't use sudo?
You are right.
If I don't use sudo I get the following:
22:29:31: Starting packager...
Error: EACCES: permission denied, open '/Users/douglascarvalho/.expo/log'
Could it be that I installed some dependency with sudo and now its owner is the root user?
It looks like because you ran CRNA at some point using sudo, the ~/.expo directory is now owned by root. Can you remove that directory and see what happens?
running:
sudo chown my_username ~/.expo
sudo chown my_username ~/.babel.json
solved my issue!
I can now run npm start without sudo, and, more importantly, npm run ios now works fine!
App is now working on the simulator.
Thank you so much for the help!
@dougbacelar,
sudo chown my_username ~/.babel.json
not:
sudo chown my_username ~./babel.json
:)
@D-sense ooops. fixed
sounds like you folks solved the issue! closing
I am still facing the same issue after running
sudo chown my_username ~/.expo
sudo chown my_username ~/.babel.json
@SYN-nikhilbahalkar chown isn't recursive, btw. If the contents of the .expo directory aren't owned by you, owning the directory won't help.
@SYN-nikhilbahalkar have you tried:
sudo chown -R `whoami` ~/.expo
It worked for me
worked for me too . Thanks 馃憤
Restart my Macbook. After everything works fine.
After i ran sudo chown -R `whoami ` ~/.expo and restarted my macbook, npm run ios worked, only that it took about 5 mins to start the app.
I had the same issue, it looked like it was hanging, but it must have been a slow internet connection, because I left it and about 5 minutes later Expo suddenly started installing and opening the app. I did not have to apply any of the above workarounds, just had to wait.
For me, this helped me start the iOS from react-native run-ios. Previously it was just opening the simulator but not opening any phones. Just the simulator app would app and nothing would happen. If I opened the phones, the package would be built in the secondary window where the server runs, but nothing would happen on the phone.
After running these commands (
sudo chown -R `whoami` ~/.babel.json and
sudo chown -R `whoami` ~/.expo
it would actually open the phone and run the application, but the build was failing due to various random permissions problems.
I ended up having to go to the root directory of my project (not ios/android roots but the root with node_modules and package.json) and use
sudo chown -R `whoami` ./
Worked right away after doing this. Just not sure how safe that actually is.. but it's a temporary fix that works.
For me, I have to download Exponent for iOS from ~/.expo/cache/versions.json with iosUrl, then extract it into ~/.expo/ios-simulator-app-cache. Next, rename the extracted folder with a '.app' suffix
Finally, I run this command:
sudo chown -R `whoami` ~/react_native_projects
And npm run ios works well.
I have tried both chown commands and am still getting a permission denied error.
EDIT: I just did sudo chown -R whoami ~/Tutorial\ Projects and it's no longer giving me an error, but now it's hanging.
Just leaving a comment in case anyone else finds this thread through a Google search like I did. I was running yarn run ios and everything was running fine. Then this morning, Xcode updated the simulator with the new iPhone XS Max and iOS 12.0 (as opposed to the iPhone 7 running iOS 11.4, which is what I was simulating my app on before). What happened for me was that the simulator eventually did start, albeit a lot more slowly than usual, and Expo didn't open automatically like it did before. I was able to open Expo manually and run my app like usual, though.
If anyone discovers this thread more recently and has a solution to making the whole process work automatically like it used to, that would be great. Again, this may be a one time fluke, but I wanted to throw it out there in case this is not an isolated issue.
Most helpful comment
running:
sudo chown my_username ~/.exposudo chown my_username ~/.babel.jsonsolved my issue!
I can now run
npm startwithoutsudo, and, more importantly,npm run iosnow works fine!App is now working on the simulator.
Thank you so much for the help!