From 4aad9e02411d0d7f14d80861325e310d4e99be64 Mon Sep 17 00:00:00 2001 From: Website Deployment Script Date: Mon, 26 Dec 2016 13:07:40 +0000 Subject: [PATCH] Updated docs for next --- releases/next/docs/running-on-device.html | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/releases/next/docs/running-on-device.html b/releases/next/docs/running-on-device.html index 6c623894257..7abf165cb21 100644 --- a/releases/next/docs/running-on-device.html +++ b/releases/next/docs/running-on-device.html @@ -63,17 +63,21 @@ List of devices attached emulator-5554 offline # Google emulator 14ed2fcc device # Physical device

Seeing device in the right column means the device is connected. You must have only one device connected at a time.

3. Run your app #

Type the following in your command prompt to install and launch your app on the device:

$ react-native run-android

If you get a "bridge configuration isn't available" error, see Using adb reverse.

Hint

You can also use the React Native CLI to generate and run a Release build (e.g. react-native run-android --configuration Release).

-

Connecting to the development server #

You can also iterate quickly on a device by connecting to the development server running on your development machine. There are several ways of accomplishing this, depending on whether you have access to a USB cable or a Wi-Fi network.

Method 1: Using adb reverse (recommended) #

+

Connecting to the development server #

-

You can use this method if your device is running Android 5.0 (Lollipop), it has USB debugging enabled, and it is connected via USB to your development machine.

+

You can also iterate quickly on a device using the development server. You only have to be on the same Wi-Fi network as your computer. Shake the device to open the Developer menu.

-

Run the following in a command prompt:

$ adb reverse tcp:8081 tcp:8081

You can now use Reload JS from the React Native in-app Developer menu without any additional configuration.

Method 2: Connect via Wi-Fi #

You can also connect to the development server over Wi-Fi. You'll first need to install the app on your device using a USB cable, but once that has been done you can debug wirelessly by following these instructions. You'll need your development machine's current IP address before proceeding.

+

You can also iterate quickly on a device by connecting to the development server running on your development machine. There are several ways of accomplishing this, depending on whether you have access to a USB cable or a Wi-Fi network.

Method 1: Using adb reverse (recommended) #

-

You can find the IP address in System PreferencesNetwork.

+

You can use this method if your device is running Android 5.0 (Lollipop), it has USB debugging enabled, and it is connected via USB to your development machine.

-

Open the command prompt and type ipconfig to find your machine's IP address (more info).

+

Run the following in a command prompt:

$ adb reverse tcp:8081 tcp:8081

You can now use Reload JS from the React Native in-app Developer menu without any additional configuration.

Method 2: Connect via Wi-Fi #

You can also connect to the development server over Wi-Fi. You'll first need to install the app on your device using a USB cable, but once that has been done you can debug wirelessly by following these instructions. You'll need your development machine's current IP address before proceeding.

-

Open a terminal and type /sbin/ifconfig to find your machine's IP address.

+

You can find the IP address in System PreferencesNetwork.

+ +

Open the command prompt and type ipconfig to find your machine's IP address (more info).

+ +

Open a terminal and type /sbin/ifconfig to find your machine's IP address.

  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. You'll see a red screen with an error. This is OK. The following steps will fix that.
  4. Open the in-app Developer menu.
  5. Go to Dev SettingsDebug 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).
  7. Go back to the Developer menu and select Reload JS.