Here\'s my environment:
➜ AwesomeProject node --version v6.3.0 ➜ AwesomeProject npm --version 3.10.3 ➜ AwesomeProject react-native --version react-native-cli: 1.0.
Try NOT running the command react-native run-ios
as root
I rebooted the simulator as suggested above tried config reset but no luck.
However while the simulator is open, I went to /Users/username/projectdirectorry/AwesomeProject/ios/build
dragged the AwesomeProject.app on the simulator and it is worked.
I ran into this problem when I ran react-native run-ios
within the terminal multiplexer tmux
. I fixed it by running react-native run-ios
in a normal terminal tab without tmux
running.
I have the same problem when first time to run react-native run-ios
Try Hardware -> Reboot the simulator, and run it again.
I have just solved the same question.
First try using react-native run-ios
instead of the sudo react-native run-ios
.
Next try the following:
In file AppDelegate.m
, change
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
To:
jsCodeLocation = [NSURL URLWithString:@"http://127.0.0.1:8081/index.ios.bundle?platform=ios&dev=true"];
(This may be a security issue with iOS 9);
Next try to reset your env.
When hitting react-native run-ios
, one of the first lines printed to console, would be something like this (or similar)
Launching iPhone 6 (10.0)...
react-native run-ios
again