mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-01 13:03:08 +08:00
Fixes #8252: Document how to connect to a non-default packager port o…
Summary: Added some documentation to the `RunningOnDeviceAndroid.md` with screenshots to set custom port Closes https://github.com/facebook/react-native/pull/8355 Differential Revision: D3475846 Pulled By: mkonicek fbshipit-source-id: 73675b19e2bb93c859bda239f228da0883f0e305
This commit is contained in:
committed by
Facebook Github Bot 4
parent
1cc7ef072e
commit
fe55dd1a9a
@@ -93,6 +93,22 @@ Have your device connected via USB with debugging enabled (see paragraph above o
|
||||
1. Run `adb reverse tcp:8081 tcp:8081`
|
||||
2. You can use `Reload JS` and other development options with no extra configuration
|
||||
|
||||
|
||||
### Running packager on a non-standard port
|
||||
|
||||
Launch the packager manually with `react-native start --port [PORT]`
|
||||
|
||||
For Android: Use the developer menu by clicking the menu button or shake. Select 'Debug server host & port for device' to set a different port.
|
||||
<center>
|
||||
<img src="img/AndroidDeveloperMenu.png" width="162" />
|
||||
<img src="img/AndroidDevSettings.png" width="150" />
|
||||
<img src="img/AndroidDevServerDialog.png" width="150" />
|
||||
</center>
|
||||
|
||||
For IOS: Edit the AppDelegate.m and change the line below to match the port number you're running:
|
||||
|
||||
```jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];```
|
||||
|
||||
### Configure your app to connect to the local dev server via Wi-Fi
|
||||
|
||||
1. Make sure your laptop and your phone are on the **same Wi-Fi network**.
|
||||
|
||||
BIN
website/src/react-native/img/AndroidDevServerDialog.png
Normal file
BIN
website/src/react-native/img/AndroidDevServerDialog.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 140 KiB |
BIN
website/src/react-native/img/AndroidDevSettings.png
Normal file
BIN
website/src/react-native/img/AndroidDevSettings.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 192 KiB |
BIN
website/src/react-native/img/AndroidDeveloperMenu.png
Normal file
BIN
website/src/react-native/img/AndroidDeveloperMenu.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 80 KiB |
Reference in New Issue
Block a user