Updated docs for next

This commit is contained in:
Website Deployment Script
2016-12-26 13:07:40 +00:00
parent 8d48291108
commit 4aad9e0241
+10 -6
View File
@@ -63,17 +63,21 @@ List of devices attached
emulator<span class="token number">-5554</span> offline # Google emulator
14ed2fcc device # Physical device</div><p>Seeing <code>device</code> in the right column means the device is connected. You must have <strong>only one device connected</strong> at a time.</p><h3><a class="anchor" name="3-run-your-app"></a>3. Run your app <a class="hash-link" href="docs/running-on-device.html#3-run-your-app">#</a></h3><p>Type the following in your command prompt to install and launch your app on the device:</p><div class="prism language-javascript">$ react<span class="token operator">-</span>native run<span class="token operator">-</span>android</div><blockquote><p>If you get a &quot;bridge configuration isn&#x27;t available&quot; error, see <a href="#using-adb-reverse" target="">Using adb reverse</a>.</p><p>Hint</p><p>You can also use the <code>React Native CLI</code> to generate and run a <code>Release</code> build (e.g. <code>react-native run-android --configuration Release</code>).</p></blockquote><span><block class="mac windows linux android ios" />
</span><h2><a class="anchor" name="connecting-to-the-development-server"></a>Connecting to the development server <a class="hash-link" href="docs/running-on-device.html#connecting-to-the-development-server">#</a></h2><p>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.</p><h3><a class="anchor" name="method-1-using-adb-reverse-recommended"></a>Method 1: Using adb reverse (recommended) <a class="hash-link" href="docs/running-on-device.html#method-1-using-adb-reverse-recommended">#</a></h3><span><block class="mac windows linux android" />
</span><h2><a class="anchor" name="connecting-to-the-development-server"></a>Connecting to the development server <a class="hash-link" href="docs/running-on-device.html#connecting-to-the-development-server">#</a></h2><span><block class="mac ios" />
</span><p>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.</p><span><block class="mac windows linux android ios" />
</span><p>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 <a href="/react-native/docs/debugging.html#accessing-the-in-app-developer-menu" target="">Developer menu</a>.</p><span><block class="mac windows linux android" />
</span><p>Run the following in a command prompt:</p><div class="prism language-javascript">$ adb reverse tcp<span class="token punctuation">:</span><span class="token number">8081</span> tcp<span class="token punctuation">:</span><span class="token number">8081</span></div><p>You can now use <code>Reload JS</code> from the React Native in-app Developer menu without any additional configuration.</p><h3><a class="anchor" name="method-2-connect-via-wi-fi"></a>Method 2: Connect via Wi-Fi <a class="hash-link" href="docs/running-on-device.html#method-2-connect-via-wi-fi">#</a></h3><p>You can also connect to the development server over Wi-Fi. You&#x27;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&#x27;ll need your development machine&#x27;s current IP address before proceeding.</p><span><block class="mac android ios" />
</span><p>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.</p><h3><a class="anchor" name="method-1-using-adb-reverse-recommended"></a>Method 1: Using adb reverse (recommended) <a class="hash-link" href="docs/running-on-device.html#method-1-using-adb-reverse-recommended">#</a></h3><span><block class="mac windows linux android" />
</span><p>You can find the IP address in <strong>System Preferences</strong><strong>Network</strong>.</p><span><block class="windows android ios" />
</span><p>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.</p><span><block class="mac windows linux android" />
</span><p>Open the command prompt and type <code>ipconfig</code> to find your machine&#x27;s IP address (<a href="http://windows.microsoft.com/en-us/windows/using-command-line-tools-networking-information" target="_blank">more info</a>).</p><span><block class="linux android ios" />
</span><p>Run the following in a command prompt:</p><div class="prism language-javascript">$ adb reverse tcp<span class="token punctuation">:</span><span class="token number">8081</span> tcp<span class="token punctuation">:</span><span class="token number">8081</span></div><p>You can now use <code>Reload JS</code> from the React Native in-app Developer menu without any additional configuration.</p><h3><a class="anchor" name="method-2-connect-via-wi-fi"></a>Method 2: Connect via Wi-Fi <a class="hash-link" href="docs/running-on-device.html#method-2-connect-via-wi-fi">#</a></h3><p>You can also connect to the development server over Wi-Fi. You&#x27;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&#x27;ll need your development machine&#x27;s current IP address before proceeding.</p><span><block class="mac android" />
</span><p>Open a terminal and type <code>/sbin/ifconfig</code> to find your machine&#x27;s IP address.</p><span><block class="mac windows linux android ios" />
</span><p>You can find the IP address in <strong>System Preferences</strong> <strong>Network</strong>.</p><span><block class="windows android" />
</span><p>Open the command prompt and type <code>ipconfig</code> to find your machine&#x27;s IP address (<a href="http://windows.microsoft.com/en-us/windows/using-command-line-tools-networking-information" target="_blank">more info</a>).</p><span><block class="linux android" />
</span><p>Open a terminal and type <code>/sbin/ifconfig</code> to find your machine&#x27;s IP address.</p><span><block class="mac windows linux android" />
</span><ol><li>Make sure your laptop and your phone are on the <strong>same</strong> Wi-Fi network.</li><li>Open your React Native app on your device.</li><li>You&#x27;ll see a <a href="/react-native/docs/debugging.html#in-app-errors-and-warnings" target="">red screen with an error</a>. This is OK. The following steps will fix that.</li><li>Open the in-app <a href="/react-native/docs/debugging.html#accessing-the-in-app-developer-menu" target="">Developer menu</a>.</li><li>Go to <strong>Dev Settings</strong><strong>Debug server host for device</strong>.</li><li>Type in your machine&#x27;s IP address and the port of the local dev server (e.g. 10.0.1.1:8081).</li><li>Go back to the <strong>Developer menu</strong> and select <strong>Reload JS</strong>.</li></ol><span><block class="mac ios" />