question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`react-native run-ios --device` not behaving like `react-native run-android --device`

See original GitHub issue

Environment

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:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:24

github_iconTop GitHub Comments

11reactions
bogdantcommented, Aug 20, 2018

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

  • install latest RN per instructions on site
  • generate a barebones project using react-native init
  • running on emulator experience:
    • $react-native run-ios
    • compiling window displays build messages, finally says build was successful then installing and launching message, app launches and the command ends returning back to the terminal console
    • all looks good 😃
  • running on actual device:
    • $react-native run-ios --device myiPhoneName
    • all similar up to installing and launching message, then no progress, the command never returns back to cursor and there is no indication the app was deployed.
4reactions
Sean-Browncommented, Jul 2, 2018

The OP was essentially:

  • when I run react-native run-android --device it automatically builds and installs the application on my device, then launches the app on the device
  • when I run react-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 forever

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running On Device - React Native
This document will guide you through the necessary steps to run your React Native app on a device and to get it ready...
Read more >
Run react-native application on iOS device directly from ...
2>. Select device using this command which you want to run your app. Using Device Name react-native run-ios --device "Kool's iPhone".
Read more >
"react-native run-ios --device" fa… | Apple Developer Forums
The react-native run-ios --device command fails with an error. The app runs on the simulator using the react-native run-ios command without any problem....
Read more >
How to Run React Native App On Real Device Android
1 Debug App in Real Android Device using USB Connection · 2 Enable Debugging Over USB option · 3 Attach your Real Device...
Read more >
React Native | WebStorm Documentation - JetBrains
Running and debugging a React Native application ... You can run and debug your application on a physical device or on a simulator....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found