`react-native run-ios --device` not behaving like `react-native run-android --device`
See original GitHub issueEnvironment
Environment: OS: macOS High Sierra 10.13.5 Node: 6.9.1 Yarn: 1.7.0 npm: 3.10.8 Watchman: 4.9.0 Xcode: Xcode 9.4.1 Build version 9F2000 Android Studio: Not Found
Packages: (wanted => installed) react: 16.3.1 => 16.3.1 react-native: 0.55.4 => 0.55.4
Description
The react-native run-android --device
command will build the application, install it on the device, and then launch the application on the device. The react-native run-ios --device
command is not working completely: the command builds the application and installs it on the device correctly, however it will typically hang forever after that without ever launching the application. Most of the time it just hangs with the following message:
** BUILD SUCCEEDED **
installing and launching your app on [my device name]
Only on rare occasions does it get past this step and it then prints something like “shake the device and enable JS debugging”, which will make everything work as expected. However this is exceedingly rare, the majority of the time the cli just hangs.
Reproducible Demo
- Initialize a new project:
react-native init TestRn
- in XCode create the provisioning profile for the app
- Run:
react-native run-ios --device
– the majority of the time it will build and install correctly but it will almost always hang when trying to connect with the javascript debugger (at least that’s what I suspect it’s doing when it hangs).
Note I’m testing this on an iPhone with the following specs:
- Version: 10.3.3
- Model: ME553LL/A
What’s more is that the app will install and launch correctly 100% of the time if it’s run through XCode, however this isn’t an option for me because I can’t debug any of the react-native javascript in XCode (unless there is a way that I’m not aware of).
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:24
I believe that react-native is a great platform and would like to see it spread. First time experience for novice users should just work.
I appreciate your effort in assisting, but it is not the first time I see well intentioned volunteers closing issues without proper understanding of the issue.
I am going to restate the issue as I see it, please read carefully (based on your comment above “see why it’s not launching on the simulator” I see that it isn’t clear yet what the problem is).
Summary: react-native run-ios on real device for barebones RN app created per official instructions does not launch the app and run-ios command never returns
The OP was essentially:
react-native run-android --device
it automatically builds and installs the application on my device, then launches the app on the devicereact-native run-ios --device
it automatically builds and installs the application on my device, but it is unable to launch the app on the device and the CLI just hangs foreverI’m saying that the behavior of these two commands should be consistent.
Where I’m seeing this issue is in Visual Studio Code: I want to debug the application with the “Debug iOS” option. The “Debug Android” option works perfectly in VS Code but “Debug iOS” hangs forever.