-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
add --port options to run-android, defaults to 8081 #15316
add --port options to run-android, defaults to 8081 #15316
Conversation
Generated by 🚫 dangerJS |
local-cli/runAndroid/runAndroid.js
Outdated
@@ -56,10 +56,10 @@ function getAdbPath() { | |||
} | |||
|
|||
// Runs ADB reverse tcp:8081 tcp:8081 to allow loading the jsbundle from the packager | |||
function tryRunAdbReverse(device) { | |||
function tryRunAdbReverse(args, device) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of passing args through, can you pass packagerPort
? That keeps the API saner.
@javache has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: The pull request adds the `--port` option to `run-ios` allowing a developer to build and launch a react-native app using a single command line like this: ``` react-native run-ios --port 8088 ``` It defaults to the current port 8081. This pull request fixes issue #9145 and issue #14113. This patch also extends `run-android` to properly test and launch the packager with the specified port, extending the work done in PR: ##15316 1. Create a new react-native app, or simply clone this branch and then update your version of react-native using `yarn add file:./path/to/this/fork/of/react-native` 2. run `react-native run-ios --port 8088` 3. watch the packager start on the desired port (8088 in this case) and watch your app in your simulator connect to the packager and launch the app. Closes #16172 Differential Revision: D6612534 Pulled By: shergin fbshipit-source-id: 50af449f5e4c32fb76ba95f4cb7bf179e35526d5
Summary: The pull request adds the `--port` option to `run-ios` allowing a developer to build and launch a react-native app using a single command line like this: ``` react-native run-ios --port 8088 ``` It defaults to the current port 8081. This pull request fixes issue facebook#9145 and issue facebook#14113. This patch also extends `run-android` to properly test and launch the packager with the specified port, extending the work done in PR: #facebook#15316 1. Create a new react-native app, or simply clone this branch and then update your version of react-native using `yarn add file:./path/to/this/fork/of/react-native` 2. run `react-native run-ios --port 8088` 3. watch the packager start on the desired port (8088 in this case) and watch your app in your simulator connect to the packager and launch the app. Closes facebook#16172 Differential Revision: D6612534 Pulled By: shergin fbshipit-source-id: 50af449f5e4c32fb76ba95f4cb7bf179e35526d5
Summary: Closes facebook/react-native#15316 Differential Revision: D5582599 Pulled By: javache fbshipit-source-id: 575e0540965792a25e6cc572cff103da2c65a262
Test:
npm link
to work correctly with my existing project, so this is a roundabout way of testing it.In this repo:
Run
react-native init fakeProject && cd fakeProject
Run
node '../local-cli/cli.js' run-android --help
, list help and noticed port is present.Run
node '../local-cli/cli.js' run-android --port=8088
, run command noticed adb is set correctly to 8088In android emulator open debug tools (command+M) goto
Debug server host & port for device
and change it to
localhost:8088
.Run
react-native start --port=8088
, in a different shell.Reload.
Profit.
Suggestion welcome, if anyone knows a better way to test
runAndroid
command.