Updated docs for next

This commit is contained in:
Website Deployment Script
2016-06-23 16:48:39 +00:00
parent 1fa08e4b12
commit cc30ede003
4 changed files with 7 additions and 1 deletions
@@ -15,7 +15,13 @@ Bus <span class="token number">001</span> Device <span class="token number">002<
Bus <span class="token number">001</span> Device <span class="token number">001</span><span class="token punctuation">:</span> ID 1d6b<span class="token punctuation">:</span><span class="token number">0002</span> Linux Foundation <span class="token number">2.0</span> root hub
Bus <span class="token number">004</span> Device <span class="token number">001</span><span class="token punctuation">:</span> ID 1d6b<span class="token punctuation">:</span><span class="token number">0003</span> Linux Foundation <span class="token number">3.0</span> root hub
Bus <span class="token number">003</span> Device <span class="token number">001</span><span class="token punctuation">:</span> ID 1d6b<span class="token punctuation">:</span><span class="token number">0002</span> Linux Foundation <span class="token number">2.0</span> root hub</div><p>You&#x27;ll see that after removing the phone, the line which has the phone model (&quot;Motorola PCS&quot; in this case) disappeared from the list. This is the line that we care about.</p><p><code>Bus 001 Device 003: ID 22b8:2e76 Motorola PCS</code></p><p>From the above line, you want to grab the first four digits from the device ID:</p><p><code>22b8:2e76</code></p><p>In this case, it&#x27;s <code>22b8</code>. That&#x27;s the identifier for Motorola.</p><p>You&#x27;ll need to input this into your udev rules in order to get up and running:</p><div class="prism language-javascript">echo SUBSYSTEM<span class="token operator">==</span><span class="token string">&quot;usb&quot;</span><span class="token punctuation">,</span> ATTR<span class="token punctuation">{</span>idVendor<span class="token punctuation">}</span><span class="token operator">==</span><span class="token string">&quot;22b8&quot;</span><span class="token punctuation">,</span> MODE<span class="token operator">=</span><span class="token string">&quot;0666&quot;</span><span class="token punctuation">,</span> GROUP<span class="token operator">=</span><span class="token string">&quot;plugdev&quot;</span> <span class="token operator">|</span> sudo tee <span class="token operator">/</span>etc<span class="token operator">/</span>udev<span class="token operator">/</span>rules<span class="token punctuation">.</span>d<span class="token operator">/</span><span class="token number">51</span><span class="token operator">-</span>android<span class="token operator">-</span>usb<span class="token punctuation">.</span>rules</div><p>Make sure that you replace <code>22b8</code> with the identifier you get in the above command.</p><p>Now check that your device is properly connecting to ADB, the Android Debug Bridge, by using <code>adb devices</code>.</p><div class="prism language-javascript">List of devices attached
TA9300GLMK device</div><h2><a class="anchor" name="accessing-development-server-from-device"></a>Accessing development server from device <a class="hash-link" href="docs/running-on-device-android.html#accessing-development-server-from-device">#</a></h2><p>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.</p><blockquote><p>Hint</p><p>Most modern android devices don&#x27;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 (to reload, debug, etc.). Alternatively, you can run the command <code>adb shell input keyevent 82</code> to open the dev menu (82 being the <a href="http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_MENU" target="_blank">Menu</a> key code).</p></blockquote><h3><a class="anchor" name="using-adb-reverse"></a>Using adb reverse <a class="hash-link" href="docs/running-on-device-android.html#using-adb-reverse">#</a></h3><blockquote><p>Note that this option is available on devices running android 5.0+ (API 21).</p></blockquote><p>Have your device connected via USB with debugging enabled (see paragraph above on how to enable USB debugging on your device).</p><ol><li>Run <code>adb reverse tcp:8081 tcp:8081</code></li><li>You can use <code>Reload JS</code> and other development options with no extra configuration</li></ol><h3><a class="anchor" name="configure-your-app-to-connect-to-the-local-dev-server-via-wi-fi"></a>Configure your app to connect to the local dev server via Wi-Fi <a class="hash-link" href="docs/running-on-device-android.html#configure-your-app-to-connect-to-the-local-dev-server-via-wi-fi">#</a></h3><ol><li>Make sure your laptop and your phone are on the <strong>same Wi-Fi network</strong>.</li><li>Open your React Native app on your device. You can do this the same way you&#x27;d open any other app.</li><li>You&#x27;ll see a red screen with an error. This is OK. The following steps will fix that.</li><li>Open the <strong>Developer menu</strong> by shaking the device or running <code>adb shell input keyevent 82</code> from the command line.</li><li>Go to <code>Dev Settings</code>.</li><li>Go to <code>Debug server host for device</code>.</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). <strong>On Mac</strong>, you can find the IP address in System Preferences / Network. <strong>On Windows</strong>, 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>).</li><li>Go back to the <strong>Developer menu</strong> and select <code>Reload JS</code>.</li></ol></div><div class="docs-prevnext"><a class="docs-next" href="docs/signed-apk-android.html#content">Next →</a></div></div></section><footer class="wrap"><div class="center">© 2016 Facebook Inc.</div></footer></div><div id="fb-root"></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>
TA9300GLMK device</div><h2><a class="anchor" name="accessing-development-server-from-device"></a>Accessing development server from device <a class="hash-link" href="docs/running-on-device-android.html#accessing-development-server-from-device">#</a></h2><p>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.</p><blockquote><p>Hint</p><p>Most modern android devices don&#x27;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 (to reload, debug, etc.). Alternatively, you can run the command <code>adb shell input keyevent 82</code> to open the dev menu (82 being the <a href="http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_MENU" target="_blank">Menu</a> key code).</p></blockquote><h3><a class="anchor" name="using-adb-reverse"></a>Using adb reverse <a class="hash-link" href="docs/running-on-device-android.html#using-adb-reverse">#</a></h3><blockquote><p>Note that this option is available on devices running android 5.0+ (API 21).</p></blockquote><p>Have your device connected via USB with debugging enabled (see paragraph above on how to enable USB debugging on your device).</p><ol><li>Run <code>adb reverse tcp:8081 tcp:8081</code></li><li>You can use <code>Reload JS</code> and other development options with no extra configuration</li></ol><h3><a class="anchor" name="running-packager-on-a-non-standard-port"></a>Running packager on a non-standard port <a class="hash-link" href="docs/running-on-device-android.html#running-packager-on-a-non-standard-port">#</a></h3><p>Launch the packager manually with <code>react-native start --port [PORT]</code></p><p>For Android: Use the developer menu by clicking the menu button or shake. Select &#x27;Debug server host &amp; port for device&#x27; to set a different port.</p><span><center>
<img src="img/AndroidDeveloperMenu.png" width="162" />
<img src="img/AndroidDevSettings.png" width="150" />
<img src="img/AndroidDevServerDialog.png" width="150" />
</center>
</span><p>For IOS: Edit the AppDelegate.m and change the line below to match the port number you&#x27;re running:</p><p><code>jsCodeLocation = [NSURL URLWithString:@&quot;http://localhost:8081/index.ios.bundle?platform=ios&amp;dev=true&quot;];</code></p><h3><a class="anchor" name="configure-your-app-to-connect-to-the-local-dev-server-via-wi-fi"></a>Configure your app to connect to the local dev server via Wi-Fi <a class="hash-link" href="docs/running-on-device-android.html#configure-your-app-to-connect-to-the-local-dev-server-via-wi-fi">#</a></h3><ol><li>Make sure your laptop and your phone are on the <strong>same Wi-Fi network</strong>.</li><li>Open your React Native app on your device. You can do this the same way you&#x27;d open any other app.</li><li>You&#x27;ll see a red screen with an error. This is OK. The following steps will fix that.</li><li>Open the <strong>Developer menu</strong> by shaking the device or running <code>adb shell input keyevent 82</code> from the command line.</li><li>Go to <code>Dev Settings</code>.</li><li>Go to <code>Debug server host for device</code>.</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). <strong>On Mac</strong>, you can find the IP address in System Preferences / Network. <strong>On Windows</strong>, 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>).</li><li>Go back to the <strong>Developer menu</strong> and select <code>Reload JS</code>.</li></ol></div><div class="docs-prevnext"><a class="docs-next" href="docs/signed-apk-android.html#content">Next →</a></div></div></section><footer class="wrap"><div class="center">© 2016 Facebook Inc.</div></footer></div><div id="fb-root"></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB