Skip to content
This repository has been archived by the owner. It is now read-only.

Application not open on IOS simulator #422

Closed
EasonWang01 opened this issue Sep 30, 2017 · 21 comments

Comments

Projects
None yet
@EasonWang01
Copy link

commented Sep 30, 2017

Description

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.

Expected Behavior

open the RN application

Observed Behavior

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!

Environment

Please run these commands in the project folder and fill in their results:

  • npm ls react-native-scripts:react-native-scripts@1.5.0
  • npm ls react-native:react-native@0.48.4
  • npm ls expo: expo@21.0.2
  • node -v:v8.2.1
  • npm -v:5.3.0
  • yarn --version:0.27.5
  • watchman version:
    {
    "version": "4.9.0"
    }
    Also specify:
  1. Operating system:OSX
  2. Phone/emulator/simulator & version: 11.0 ip6

Reproducible Demo

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.

@EasonWang01 EasonWang01 changed the title OSX simulator not run application Application not open on OSX simulator Sep 30, 2017

@EasonWang01 EasonWang01 changed the title Application not open on OSX simulator Application not open on IOS simulator Sep 30, 2017

@dougbacelar

This comment has been minimized.

Copy link

commented Oct 16, 2017

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: react-native-scripts@1.5.0
npm ls react-native: react-native@0.48.4
npm ls expo: expo@21.0.2
npm -v: 4.6.1
node -v: v8.7.0
watchman version:
{
"version": "4.9.0"
}

OSX 10.12.6

@anp

This comment has been minimized.

Copy link
Member

commented Oct 17, 2017

What happens if you open the iOS simulator before running yarn run ios?

@dougbacelar

This comment has been minimized.

Copy link

commented Oct 17, 2017

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

@anp

This comment has been minimized.

Copy link
Member

commented Oct 17, 2017

I don't think you want to use sudo to run a CRNA project. What happens if you don't use sudo?

@dougbacelar

This comment has been minimized.

Copy link

commented Oct 17, 2017

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?

@anp

This comment has been minimized.

Copy link
Member

commented Oct 17, 2017

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?

@dougbacelar

This comment has been minimized.

Copy link

commented Oct 17, 2017

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!

@D-sense

This comment has been minimized.

Copy link

commented Oct 26, 2017

@dougbacelar,
sudo chown my_username ~/.babel.json
not:
sudo chown my_username ~./babel.json
:)

@dougbacelar

This comment has been minimized.

Copy link

commented Oct 26, 2017

@D-sense ooops. fixed

@brentvatne

This comment has been minimized.

Copy link
Member

commented Oct 26, 2017

sounds like you folks solved the issue! closing

@brentvatne brentvatne closed this Oct 26, 2017

@SYN-nikhilbahalkar

This comment has been minimized.

Copy link

commented Nov 15, 2017

I am still facing the same issue after running

sudo chown my_username ~/.expo
sudo chown my_username ~/.babel.json

@anp

This comment has been minimized.

Copy link
Member

commented Nov 16, 2017

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

@SoufianeLasri

This comment has been minimized.

Copy link

commented Nov 24, 2017

@SYN-nikhilbahalkar have you tried:

sudo chown -R `whoami` ~/.expo

It worked for me

@SYN-nikhilbahalkar

This comment has been minimized.

Copy link

commented Nov 24, 2017

worked for me too . Thanks 👍

@ahmetilhann

This comment has been minimized.

Copy link

commented Jan 23, 2018

Restart my Macbook. After everything works fine.

@Mrkezii

This comment has been minimized.

Copy link

commented Feb 4, 2018

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.

@johanvdb

This comment has been minimized.

Copy link

commented Feb 17, 2018

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.

@kaym0

This comment has been minimized.

Copy link

commented Apr 22, 2018

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.

@duannl

This comment has been minimized.

Copy link

commented Aug 14, 2018

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.

@elarue53078

This comment has been minimized.

Copy link

commented Sep 11, 2018

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.

@elarue53078

This comment has been minimized.

Copy link

commented Sep 19, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.