From 2abfb3f34e73adccd4b69db244e4b53089523b7c Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sat, 31 Oct 2015 16:33:17 +0000 Subject: [PATCH] update website --- docs/running-on-device-android.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/running-on-device-android.html b/docs/running-on-device-android.html index ee80c8c2d90..d833c726d2f 100644 --- a/docs/running-on-device-android.html +++ b/docs/running-on-device-android.html @@ -1,4 +1,4 @@ -Running On Device – React Native | A framework for building native apps using React

Running On Device

USB Debugging #

The easiest way to develop on a device is by USB debugging. First, make sure you have USB debugging enabled on your device. Once debugging is enabled on the device you can use react-native run-android in the same way as with emulator to install and launch your React Native app on the connected device.

Accessing development server from device #

You can also iterate quickly on device using the development server. Follow one of the steps described below to make your development server running on your laptop accessible for your device.

Hint

Most modern android devices don't have a hardware menu button, which we use to trigger the developer menu. In that case you can shake the device to open the dev menu (reload, debug, etc.)

Using adb reverse #

Note that this option is available on devices running android 5.0+ (API 21).

Have your device connected via USB with debugging enabled (see paragraph above on how to enable USB debugging on your device).

  1. Run adb reverse tcp:8081 tcp:8081
  2. You can use Reload JS and other development options with no extra configuration

Configure device 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.
  2. Open your React Native app on your device.
  3. Open the Developer menu by shaking the device or running adb shell input keyevent 82 from the command line.
  4. Go to Dev Settings.
  5. Go to Debug server host for device.
  6. Type in your machine's IP address and the port of the packager (e.g. 10.0.1.1:8081). On Mac, you can find the IP address in System Preferences / Network. On Windows, open the command prompt and type ipconfig to find your machine's IP address (more info).
  7. Go back to the Developer menu and select Reload JS.
© 2015 Facebook Inc.

Running On Device

USB Debugging #

The easiest way to develop on a device is by USB debugging. First, make sure you have USB debugging enabled on your device. Once debugging is enabled on the device you can use react-native run-android in the same way as with emulator to install and launch your React Native app on the connected device.

Accessing development server from device #

You can also iterate quickly on device using the development server. Follow one of the steps described below to make your development server running on your laptop accessible for your device.

Hint

Most modern android devices don't have a hardware menu button, which we use to trigger the developer menu. In that case you can shake the device to open the dev menu (reload, debug, etc.)

Using adb reverse #

Note that this option is available on devices running android 5.0+ (API 21).

Have your device connected via USB with debugging enabled (see paragraph above on how to enable USB debugging on your device).

  1. Run adb reverse tcp:8081 tcp:8081
  2. You can use Reload JS and other development options with no extra configuration

Configure device 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.
  2. Open your React Native app on your device.
  3. Open the Developer menu by shaking the device or running adb shell input keyevent 82 from the command line.
  4. Go to Dev Settings.
  5. Go to Debug server host for device.
  6. Type in your machine's IP address and the port of the local dev server (e.g. 10.0.1.1:8081). On Mac, you can find the IP address in System Preferences / Network. On Windows, open the command prompt and type ipconfig to find your machine's IP address (more info).
  7. Go back to the Developer menu and select Reload JS.
© 2015 Facebook Inc.