-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to run iOS on Device from Command Line - Simulator Works. RCT_METRO_PORT undefined #18525
Comments
RCT_METRO_PORT was added in 33d710e#diff-0822d6820d37285597b7a89988c8aea1 and it looks like someone else noticed the same behavior back then. The author of the PR that culminated in that commit is @DaKaZ. It looks like they left a comment on the PR that may help (see #16172). @DaKaZ is there any way we can prevent people from running into this issue? |
Hmmm, I am not entirely sure. I guess I always use Xcode to run on device so I had not run into this. A short term fix is likely andding RCT_METRO_PORT as an env var:
I'll try to look into this more |
@hramos, @DaKaZ, thanks for your quick replies. @DaKaZ unfortunately running
|
I can confirm that To fix the issue, I believe one has to adapt the function runOnDevice(...) in file |
@b45ch1 Unfortunately for me, running by |
seens it happen on https://github.com/facebook/react-native/blob/master/local-cli/runIOS/runIOS.js#L130:5 , just missing the port argument for Simply add |
@lizeqing 's workaround does work. tested on |
Looks like this issue was fixed in: #17983 and should be in 0.55. But no backport to 0.54. :( |
@stdavis Thanks for pointing this out, looks like we'll just have to wait for 0.55! That is manageable. VSCode's RN plugin seems to rely on ios-deploy, so you can create a debug configuration like so:
|
Just installed 0.55.0 and it's still happening, can anyone else confirm? |
Yes, try downgrading to react-native: 0.52.2, seems to have solved it for a few of us. |
@hramos This is still happening, why was it closed? |
0.55.0 also seems to break IntelliJ Idea based projects. With 0.54.0 and earlier, running a project launches 0.55.0 breaks this behaviour. In addition to the above Reverting to 0.54.0 is fine, though. Anyone else seeing this? |
Yup, we experience the same issue in 0.55 , same as #18673 |
I am also experiencing this on 0.55. Here is my
|
I am also getting this problem, but I don't see any specific error coming out of the logs when app crashes. That said, launching from XCode works just fine. But app crashes immediately when launching from CLI. |
I am still facing this issue on 0.55.0. Can anyone confirm if this is being fixed or fixed already or any work around. |
We're having this issue as well, any update or fix on this? thanks! |
This issue is really affecting my development workflow as I'm running on a MacBook Air with limited disk space. Installing XCode is not an option. |
Any word on a work around for this issue? |
Personally I started using Expo as much as possible to avoid having to use the react native CLI to run projects. @omatrot this also does not require you to have XCode installed; I understand that Expo does not work for every project, but they have a lot of built-in native libraries now that I feel are able to solve most normal app needs. |
@fadeojo the only workarounds I know are to use expo or run your app from Xcode |
Upgrading to 0.55.0 did it for me. phew... Environment: Packages: (wanted => installed) |
Well on another Mac computer I have the problem with .0.55 Environment: Packages: (wanted => installed) |
fixed the issue for me |
@flyingxu Yep same here :) |
Same issue here, the application builds with Environment: Packages: (wanted => installed) |
Similar to @flyingxu 's solution, this fixed it for me. Note the difference in
|
Similar to @flyingxu and @acoulon99 ... the new version 0.55.4 will fix the error "react": "16.3.1",
"react-native": "0.55.4", |
I didn't want to upgrade my RN version so @b45ch1 solution worked great! 🌮 |
If you're trying to run it from an npm script instead of just the |
This really work, but dear hater-guys I'm longing to tell you that somewhat this command doesnt work - shell says that it is uncapable to install app to device. |
I am unable to run my app on my iOS device via the command
react-native run-ios --device
. I am able to run it on the simulator viareact-native run-ios
and I am able to open the XCode project and run on my device directly from the project. When compiling, I receive the following error:Just from that message, it appears that RCT_METRO_PORT is undefined and causing the build to fail while using the command line to run the app on iOS on my device.
I have googled this error and nothing has come up to this point. Any ideas?
Environment
Steps to Reproduce
You can clone my repository and try out the command
react-native run-ios --device
.Expected Behavior
I expected that it would run on my device.
Actual Behavior
Build fails with an error described above.
The text was updated successfully, but these errors were encountered: