Skip to content
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

Conversation

chtrinh
Copy link

@chtrinh chtrinh commented Aug 1, 2017

Test:

  • I couldn't get 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 8088

In 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 runAndroidcommand.

@facebook-github-bot facebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Aug 1, 2017
@pull-bot
Copy link

pull-bot commented Aug 1, 2017

Warnings
⚠️

📋 Test Plan - This PR appears to be missing a Test Plan.

Generated by 🚫 dangerJS

@@ -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) {
Copy link
Member

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.

@facebook-github-bot facebook-github-bot added GH Review: accepted Import Started This pull request has been imported. This does not imply the PR has been approved. and removed GH Review: review-needed labels Aug 8, 2017
@facebook-github-bot
Copy link
Contributor

@javache has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

facebook-github-bot pushed a commit that referenced this pull request Jan 5, 2018
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
mathiasbynens pushed a commit to mathiasbynens/react-native that referenced this pull request Jan 13, 2018
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
grabbou pushed a commit to react-native-community/cli that referenced this pull request Sep 26, 2018
Summary: Closes facebook/react-native#15316

Differential Revision: D5582599

Pulled By: javache

fbshipit-source-id: 575e0540965792a25e6cc572cff103da2c65a262
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Import Started This pull request has been imported. This does not imply the PR has been approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants