this repo has no description
at main 80 kB view raw
1<!doctype html><html lang=en dir=ltr class="docs-wrapper plugin-docs plugin-id-default docs-version-0.79 docs-doc-page docs-doc-id-running-on-device" data-has-hydrated=false><meta charset=UTF-8><meta name=generator content="Docusaurus v3.8.0"><title data-rh=true>Running On Device · React Native</title><meta data-rh=true name=viewport content="width=device-width, initial-scale=1.0"><meta data-rh=true property=og:url content=https://reactnative.dev/docs/running-on-device><meta data-rh=true property=og:locale content=en><meta data-rh=true name=docusaurus_locale content=en><meta data-rh=true name=docsearch:language content=en><meta data-rh=true property=og:image content=https://reactnative.dev/img/logo-share.png><meta data-rh=true name=twitter:card content=summary_large_image><meta data-rh=true name=twitter:image content=https://reactnative.dev/img/logo-share.png><meta data-rh=true name=twitter:site content=@reactnative><meta data-rh=true name=docusaurus_version content=0.79><meta data-rh=true name=docusaurus_tag content=docs-default-0.79><meta data-rh=true name=docsearch:version content=0.79><meta data-rh=true name=docsearch:docusaurus_tag content=docs-default-0.79><meta data-rh=true property=og:title content="Running On Device · React Native"><meta data-rh=true name=description content="It's always a good idea to test your app on an actual device before releasing it to your users. This document will guide you through the necessary steps to run your React Native app on a device and to get it ready for production."><meta data-rh=true property=og:description content="It's always a good idea to test your app on an actual device before releasing it to your users. This document will guide you through the necessary steps to run your React Native app on a device and to get it ready for production."><link data-rh=true rel=icon href=/img/favicon.ico><link data-rh=true rel=canonical href=https://reactnative.dev/docs/running-on-device><link data-rh=true rel=alternate href=https://reactnative.dev/docs/running-on-device hreflang=en><link data-rh=true rel=alternate href=https://reactnative.dev/docs/running-on-device hreflang=x-default><link data-rh=true rel=preconnect href=https://8TDSE0OHGQ-dsn.algolia.net crossorigin=anonymous><link rel=alternate type=application/rss+xml href=/blog/rss.xml title="React Native RSS Feed"><link rel=alternate type=application/atom+xml href=/blog/atom.xml title="React Native Atom Feed"><link rel=alternate type=application/json href=/blog/feed.json title="React Native JSON Feed"><link rel=preconnect href=https://www.google-analytics.com><script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)},ga.l=+new Date,ga("create","UA-41298772-2","auto"),ga("send","pageview")</script><script async src=https://www.google-analytics.com/analytics.js></script><link rel=preconnect href=https://www.google-analytics.com><link rel=preconnect href=https://www.googletagmanager.com><script async src="https://www.googletagmanager.com/gtag/js?id=G-58L13S6BDP"></script><script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","G-58L13S6BDP",{})</script><link rel=search type=application/opensearchdescription+xml title="React Native" href=/opensearch.xml><link rel=icon href=/img/pwa/manifest-icon-512.png><link rel=manifest href=/manifest.json><meta name=theme-color content=#20232a><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=#20232a><link rel=apple-touch-icon href=/img/pwa/manifest-icon-512.png><link rel=mask-icon href=/img/pwa/manifest-icon-512.png color=#06bcee><meta name=msapplication-TileImage href=/img/pwa/manifest-icon-512.png><meta name=msapplication-TileColor content=#20232a><script src=https://cdn.jsdelivr.net/npm/focus-visible@5.2.0/dist/focus-visible.min.js defer></script><script src=https://widget.surveymonkey.com/collect/website/js/tRaiETqnLgj758hTBazgd8ryO5qrZo8Exadq9qmt1wtm4_2FdZGEAKHDFEt_2BBlwwM4.js defer></script><script src=https://snack.expo.dev/embed.js defer></script><script src=https://platform.twitter.com/widgets.js async></script><link rel=stylesheet href=/assets/css/styles.883cb042.css><script src=/assets/js/runtime~main.8ac1e6f0.js defer></script><script src=/assets/js/main.341783f5.js defer></script><body class=navigation-with-keyboard><svg xmlns=http://www.w3.org/2000/svg style="display: none;"><defs> 2<symbol id=theme-svg-external-link viewBox="0 0 24 24"><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></symbol> 3</defs></svg> 4<script>!function(){var t=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();document.documentElement.setAttribute("data-theme",t||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")),document.documentElement.setAttribute("data-theme-choice",t||"system")}(),function(){try{for(var[t,e]of new URLSearchParams(window.location.search).entries())if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}(),document.documentElement.setAttribute("data-announcement-bar-initially-dismissed",function(){try{return"true"===localStorage.getItem("docusaurus.announcement.dismiss")}catch(t){}return!1}())</script><div id=__docusaurus><div role=region aria-label="Skip to main content"><a class=skipToContent_oPtH href=#__docusaurus_skipToContent_fallback>Skip to main content</a></div><div class="theme-announcement-bar announcementBar_zJRd" style=background-color:#20232a;color:#fff role=banner><div class="content_bSb_ announcementBarContent_t7IR">Join us for React Conf on Oct 7-8. <a target=_blank rel="noopener noreferrer" href=https://conf.react.dev>Learn more</a>.</div></div><nav aria-label=Main class="theme-layout-navbar navbar navbar--fixed-top navbar--dark"><div class=navbar__inner><div class="theme-layout-navbar-left navbar__items"><button aria-label="Toggle navigation bar" aria-expanded=false class="navbar__toggle clean-btn" type=button><svg width=30 height=30 viewBox="0 0 30 30" aria-hidden=true><path stroke=currentColor stroke-linecap=round stroke-miterlimit=10 stroke-width=2 d="M4 7h22M4 15h22M4 23h22"/></svg></button><a class=navbar__brand href=/><div class=navbar__logo><img src=/img/header_logo.svg alt="React Native" class="themedComponent_siVc themedComponent--light_hHel"><img src=/img/header_logo.svg alt="React Native" class="themedComponent_siVc themedComponent--dark_yETr"></div><b class="navbar__title text--truncate">React Native</b></a><div class="navbar__item dropdown dropdown--hoverable"><a class=navbar__link aria-haspopup=true aria-expanded=false role=button href=/docs/running-on-device>0.79</a><ul class=dropdown__menu><li><a class=dropdown__link href=/docs/next/running-on-device>Next</a><li><a aria-current=page class="dropdown__link dropdown__link--active" href=/docs/running-on-device>0.79</a><li><a class=dropdown__link href=/docs/0.78/running-on-device>0.78</a><li><a class=dropdown__link href=/docs/0.77/running-on-device>0.77</a><li><a class=dropdown__link href=/docs/0.76/running-on-device>0.76</a><li><a class=dropdown__link href=/docs/0.75/running-on-device>0.75</a><li><a class=dropdown__link href=/docs/0.74/running-on-device>0.74</a><li><a class=dropdown__link href=/docs/0.73/running-on-device>0.73</a><li><a class=dropdown__link href=/docs/0.72/running-on-device>0.72</a><li><a class=dropdown__link href=/docs/0.71/running-on-device>0.71</a><li><a class=dropdown__link href=/docs/0.70/running-on-device>0.70</a><li><a class=dropdown__link href=/versions>All versions</a></ul></div></div><div class="theme-layout-navbar-right navbar__items navbar__items--right"><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a href=# aria-haspopup=true aria-expanded=false role=button class=navbar__link>Development</a><ul class=dropdown__menu><li><a aria-current=page class="dropdown__link dropdown__link--active" href=/docs/getting-started>Guides</a><li><a class=dropdown__link href=/docs/components-and-apis>Components</a><li><a class=dropdown__link href=/docs/accessibilityinfo>APIs</a><li><a class=dropdown__link href=/architecture/overview>Architecture</a></ul></div><a class="navbar__item navbar__link" href=/contributing/overview>Contributing</a><a class="navbar__item navbar__link" href=/community/overview>Community</a><a class="navbar__item navbar__link" href=/showcase>Showcase</a><a class="navbar__item navbar__link" href=/blog>Blog</a><a href=https://github.com/facebook/react-native target=_blank rel="noopener noreferrer" class="navbar__item navbar__link navbar-github-link" aria-label="GitHub repository"></a><div class="toggle_ki11 colorModeToggle_Hewu"><button class="clean-btn toggleButton_MMFG toggleButtonDisabled_Uw7m darkNavbarColorModeToggle_m8pZ" type=button disabled title="system mode" aria-label="Switch between dark and light mode (currently system mode)"><svg viewBox="0 0 24 24" width=24 height=24 aria-hidden=true class="toggleIcon_k9hJ lightToggleIcon_lgto"><path fill=currentColor d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"/></svg><svg viewBox="0 0 24 24" width=24 height=24 aria-hidden=true class="toggleIcon_k9hJ darkToggleIcon_U96C"><path fill=currentColor d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"/></svg><svg viewBox="0 0 24 24" width=24 height=24 aria-hidden=true class="toggleIcon_k9hJ systemToggleIcon_E5c0"><path fill=currentColor d="m12 21c4.971 0 9-4.029 9-9s-4.029-9-9-9-9 4.029-9 9 4.029 9 9 9zm4.95-13.95c1.313 1.313 2.05 3.093 2.05 4.95s-0.738 3.637-2.05 4.95c-1.313 1.313-3.093 2.05-4.95 2.05v-14c1.857 0 3.637 0.737 4.95 2.05z"/></svg></button></div><div class=navbarSearchContainer_bzqh><button type=button class="DocSearch DocSearch-Button" aria-label="Search (Command+K)"><span class=DocSearch-Button-Container><svg width=20 height=20 class=DocSearch-Search-Icon viewBox="0 0 20 20" aria-hidden=true><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke=currentColor fill=none fill-rule=evenodd stroke-linecap=round stroke-linejoin=round /></svg><span class=DocSearch-Button-Placeholder>Search</span></span><span class=DocSearch-Button-Keys></span></button></div></div></div><div role=presentation class=navbar-sidebar__backdrop></div></nav><div id=__docusaurus_skipToContent_fallback class="theme-layout-main main-wrapper mainWrapper_MB5r"><div class=docsWrapper__sE8><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_iEvu" type=button></button><div class=docRoot_DfVB><aside class="theme-doc-sidebar-container docSidebarContainer_c7NB"><div class=sidebarViewport_KYo0><div class=sidebar_CUen><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_jmj1 menuWithAnnouncementBar_YufC"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/getting-started>The Basics</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/environment-setup>Environment setup</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" role=button aria-expanded=true href=/docs/running-on-device>Workflow</a></div><ul class=menu__list><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current=page tabindex=0 href=/docs/running-on-device>Running On Device</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/docs/fast-refresh>Fast Refresh</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/docs/metro>Metro</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/docs/libraries>Using Libraries</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/docs/typescript>Using TypeScript</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/docs/upgrading>Upgrading to new versions</a></ul><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/style>UI & Interaction</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/debugging>Debugging</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/testing-overview>Testing</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/performance>Performance</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/javascript-environment>JavaScript Runtime</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/the-new-architecture/what-is-codegen>Codegen</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/native-platform>Native Development</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/headless-js-android>Android and iOS guides</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/legacy/native-modules-intro>Legacy Architecture</a></div></ul></nav></div></div></aside><main class=docMainContainer_a9sJ><div class="container padding-top--md padding-bottom--lg"><div class=row><div class=col><div class=docItemContainer_tjFy><article><div class="theme-doc-markdown markdown"><header><h1>Running On Device</h1></header><p>It's always a good idea to test your app on an actual device before releasing it to your users. This document will guide you through the necessary steps to run your React Native app on a device and to get it ready for production.</p> 5<div class="theme-admonition theme-admonition-info admonition_WCGJ alert alert--info"><div class=admonitionHeading_GCBg><span class=admonitionIcon_L39b><svg viewBox="0 0 14 16"><path fill-rule=evenodd d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"/></svg></span>info</div><div class=admonitionContent_pbrs><p>If you used <code>create-expo-app</code> to set up your project, you can run your app on a device in Expo Go by scanning the QR code that is displayed when you run <code>npm start</code>. Refer to the Expo guide for <a href=https://docs.expo.dev/get-started/expo-go/ target=_blank rel="noopener noreferrer">running your project on your device</a> for more information.</div></div> 6<div class="tabs-container tabList_J5MA"><ul role=tablist aria-orientation=horizontal class="tabs pill-tabs"><li role=tab tabindex=0 aria-selected=true class="tabs__item tabItem_l0OV tabs__item--active">Android<li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">iOS</ul><div class=margin-top--md><div role=tabpanel class=tabItem_wHwb><h2 class="anchor anchorWithStickyNavbar_JmGV" id=running-your-app-on-android-devices>Running your app on Android devices<a href=#running-your-app-on-android-devices class=hash-link aria-label="Direct link to Running your app on Android devices" title="Direct link to Running your app on Android devices"></a></h2><h4 class="anchor anchorWithStickyNavbar_JmGV" id=development-os>Development OS<a href=#development-os class=hash-link aria-label="Direct link to Development OS" title="Direct link to Development OS"></a></h4><div class="tabs-container tabList_J5MA"><ul role=tablist aria-orientation=horizontal class="tabs pill-tabs"><li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">macOS<li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">Windows<li role=tab tabindex=0 aria-selected=true class="tabs__item tabItem_l0OV tabs__item--active">Linux</ul><div class=margin-top--md><div role=tabpanel class=tabItem_wHwb hidden><h3 class="anchor anchorWithStickyNavbar_JmGV" id=1-enable-debugging-over-usb>1. Enable Debugging over USB<a href=#1-enable-debugging-over-usb class=hash-link aria-label="Direct link to 1. Enable Debugging over USB" title="Direct link to 1. Enable Debugging over USB"></a></h3><p>Most Android devices can only install and run apps downloaded from Google Play, by default. You will need to enable USB Debugging on your device in order to install your app during development.<p>To enable USB debugging on your device, you will first need to enable the "Developer options" menu by going to <strong>Settings</strong><strong>About phone</strong><strong>Software information</strong> and then tapping the <code>Build number</code> row at the bottom seven times. You can then go back to <strong>Settings</strong><strong>Developer options</strong> to enable "USB debugging".<h3 class="anchor anchorWithStickyNavbar_JmGV" id=2-plug-in-your-device-via-usb>2. Plug in your device via USB<a href=#2-plug-in-your-device-via-usb class=hash-link aria-label="Direct link to 2. Plug in your device via USB" title="Direct link to 2. Plug in your device via USB"></a></h3><p>Let's now set up an Android device to run our React Native projects. Go ahead and plug in your device via USB to your development machine.<p>Now check that your device is properly connecting to ADB, the Android Debug Bridge, by running <code>adb devices</code>.<div class="language-shell codeBlockContainer_mQmQ theme-code-block" style=--prism-color:#FFFFFF;--prism-background-color:#282C34><div class=codeBlockTitle_kY6l>shell</div><div class=codeBlockContent_t_Hd><pre tabindex=0 class="prism-code language-shell codeBlock_RMoD thin-scrollbar" style=color:#FFFFFF;background-color:#282C34><code class=codeBlockLines_AclH><span class=token-line style=color:#FFFFFF><span class="token plain">$ adb devices</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">List of devices attached</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">emulator-5554 offline </span><span class="token comment" style=color:#93a1a1># Google emulator</span><span class="token plain"></span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">14ed2fcc device </span><span class="token comment" style=color:#93a1a1># Physical device</span><br></span></code></pre></div></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.<div class="theme-admonition theme-admonition-note admonition_WCGJ alert alert--secondary"><div class=admonitionHeading_GCBg><span class=admonitionIcon_L39b><svg viewBox="0 0 14 16"><path fill-rule=evenodd d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"/></svg></span>note</div><div class=admonitionContent_pbrs><p>If you see <code>unauthorized</code> in the list you will need to run <code>adb reverse tcp:8081 tcp:8081</code> and press allow USB debugging on the device.</div></div><h3 class="anchor anchorWithStickyNavbar_JmGV" id=3-run-your-app>3. Run your app<a href=#3-run-your-app class=hash-link aria-label="Direct link to 3. Run your app" title="Direct link to 3. Run your app"></a></h3><p>From the root of your project; type the following in your command prompt to install and launch your app on the device:<div class="tabs-container tabList_J5MA"><ul role=tablist aria-orientation=horizontal class=tabs><li role=tab tabindex=0 aria-selected=true class="tabs__item tabItem_l0OV tabs__item--active">npm<li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">Yarn</ul><div class=margin-top--md><div role=tabpanel class=tabItem_wHwb><div class="language-shell codeBlockContainer_mQmQ theme-code-block" style=--prism-color:#FFFFFF;--prism-background-color:#282C34><div class=codeBlockTitle_kY6l>shell</div><div class=codeBlockContent_t_Hd><pre tabindex=0 class="prism-code language-shell codeBlock_RMoD thin-scrollbar" style=color:#FFFFFF;background-color:#282C34><code class=codeBlockLines_AclH><span class=token-line style=color:#FFFFFF><span class="token function" style=color:#79b6f2>npm</span><span class="token plain"> run android</span><br></span></code></pre></div></div></div><div role=tabpanel class=tabItem_wHwb hidden><div class="language-shell codeBlockContainer_mQmQ theme-code-block" style=--prism-color:#FFFFFF;--prism-background-color:#282C34><div class=codeBlockTitle_kY6l>shell</div><div class=codeBlockContent_t_Hd><pre tabindex=0 class="prism-code language-shell codeBlock_RMoD thin-scrollbar" style=color:#FFFFFF;background-color:#282C34><code class=codeBlockLines_AclH><span class=token-line style=color:#FFFFFF><span class="token function" style=color:#79b6f2>yarn</span><span class="token plain"> android</span><br></span></code></pre></div></div></div></div></div><blockquote> 7<p>If you get a "bridge configuration isn't available" error, see <a href=/docs/running-on-device#method-1-using-adb-reverse-recommended>Using adb reverse</a>.</p> 8</blockquote><blockquote> 9<p>Hint: You can also use the <code>React Native CLI</code> to generate and run a <code>release</code> build (e.g. from the root of your project: <code>yarn android --mode release</code>).</p> 10</blockquote><h2>Connecting to the development server</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.<h3 class="anchor anchorWithStickyNavbar_JmGV" id=method-1-using-adb-reverse-recommended>Method 1: Using adb reverse (recommended)<a href=#method-1-using-adb-reverse-recommended class=hash-link aria-label="Direct link to Method 1: Using adb reverse (recommended)" title="Direct link to Method 1: Using adb reverse (recommended)"></a></h3><p>You can use this method if your device is running Android 5.0 (Lollipop) or newer, it has USB debugging enabled, and it is connected via USB to your development machine.<p>Run the following in a command prompt:<div class="language-shell codeBlockContainer_mQmQ theme-code-block" style=--prism-color:#FFFFFF;--prism-background-color:#282C34><div class=codeBlockTitle_kY6l>shell</div><div class=codeBlockContent_t_Hd><pre tabindex=0 class="prism-code language-shell codeBlock_RMoD thin-scrollbar" style=color:#FFFFFF;background-color:#282C34><code class=codeBlockLines_AclH><span class=token-line style=color:#FFFFFF><span class="token plain">$ adb </span><span class="token parameter variable" style=color:#cb4b16>-s</span><span class="token plain"> </span><span class="token operator" style=color:#fc929e>&lt;</span><span class="token plain">device name</span><span class="token operator" style=color:#fc929e>></span><span class="token plain"> reverse tcp:8081 tcp:8081</span><br></span></code></pre></div></div><p>To find the device name, run the following adb command:<div class="language-shell codeBlockContainer_mQmQ theme-code-block" style=--prism-color:#FFFFFF;--prism-background-color:#282C34><div class=codeBlockTitle_kY6l>shell</div><div class=codeBlockContent_t_Hd><pre tabindex=0 class="prism-code language-shell codeBlock_RMoD thin-scrollbar" style=color:#FFFFFF;background-color:#282C34><code class=codeBlockLines_AclH><span class=token-line style=color:#FFFFFF><span class="token plain">$ adb devices</span><br></span></code></pre></div></div><p>You can now enable Fast Refresh from the <a href=/docs/debugging#opening-the-dev-menu>Dev Menu</a>. Your app will reload whenever your JavaScript code has changed.<h3 class="anchor anchorWithStickyNavbar_JmGV" id=method-2-connect-via-wi-fi>Method 2: Connect via Wi-Fi<a href=#method-2-connect-via-wi-fi class=hash-link aria-label="Direct link to Method 2: Connect via Wi-Fi" title="Direct link to Method 2: Connect via Wi-Fi"></a></h3><p>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.<p>You can find the IP address in <strong>System Settings (or System Preferences)</strong><strong>Network</strong>.<ol> 11<li>Make sure your laptop and your phone are on the <strong>same</strong> Wi-Fi network.</li> 12<li>Open your React Native app on your device.</li> 13<li>You'll see a <a href=/docs/debugging#logbox>red screen with an error</a>. This is OK. The following steps will fix that.</li> 14<li>Open the in-app <a href=/docs/debugging#opening-the-dev-menu>Dev Menu</a>.</li> 15<li>Go to <strong>Dev Settings</strong><strong>Debug server host & port for device</strong>.</li> 16<li>Type in your machine's IP address and the port of the local dev server (e.g. <code>10.0.1.1:8081</code>).</li> 17<li>Go back to the <strong>Dev Menu</strong> and select <strong>Reload JS</strong>.</li> 18</ol><p>You can now enable Fast Refresh from the <a href=/docs/debugging#opening-the-dev-menu>Dev Menu</a>. Your app will reload whenever your JavaScript code has changed.<h2 class="anchor anchorWithStickyNavbar_JmGV" id=building-your-app-for-production>Building your app for production<a href=#building-your-app-for-production class=hash-link aria-label="Direct link to Building your app for production" title="Direct link to Building your app for production"></a></h2><p>You have built a great app using React Native, and you are now itching to release it in the Play Store. The process is the same as any other native Android app, with some additional considerations to take into account. Follow the guide for <a href=/docs/signed-apk-android>generating a signed APK</a> to learn more.</div><div role=tabpanel class=tabItem_wHwb hidden><h3 class="anchor anchorWithStickyNavbar_JmGV" id=1-enable-debugging-over-usb-1>1. Enable Debugging over USB<a href=#1-enable-debugging-over-usb-1 class=hash-link aria-label="Direct link to 1. Enable Debugging over USB" title="Direct link to 1. Enable Debugging over USB"></a></h3><p>Most Android devices can only install and run apps downloaded from Google Play, by default. You will need to enable USB Debugging on your device in order to install your app during development.<p>To enable USB debugging on your device, you will first need to enable the "Developer options" menu by going to <strong>Settings</strong><strong>About phone</strong><strong>Software information</strong> and then tapping the <code>Build number</code> row at the bottom seven times. You can then go back to <strong>Settings</strong><strong>Developer options</strong> to enable "USB debugging".<h3 class="anchor anchorWithStickyNavbar_JmGV" id=2-plug-in-your-device-via-usb-1>2. Plug in your device via USB<a href=#2-plug-in-your-device-via-usb-1 class=hash-link aria-label="Direct link to 2. Plug in your device via USB" title="Direct link to 2. Plug in your device via USB"></a></h3><p>Let's now set up an Android device to run our React Native projects. Go ahead and plug in your device via USB to your development machine.<p>Now check that your device is properly connecting to ADB, the Android Debug Bridge, by running <code>adb devices</code>.<div class="language-shell codeBlockContainer_mQmQ theme-code-block" style=--prism-color:#FFFFFF;--prism-background-color:#282C34><div class=codeBlockTitle_kY6l>shell</div><div class=codeBlockContent_t_Hd><pre tabindex=0 class="prism-code language-shell codeBlock_RMoD thin-scrollbar" style=color:#FFFFFF;background-color:#282C34><code class=codeBlockLines_AclH><span class=token-line style=color:#FFFFFF><span class="token plain">$ adb devices</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">List of devices attached</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">emulator-5554 offline </span><span class="token comment" style=color:#93a1a1># Google emulator</span><span class="token plain"></span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">14ed2fcc device </span><span class="token comment" style=color:#93a1a1># Physical device</span><br></span></code></pre></div></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.<h3 class="anchor anchorWithStickyNavbar_JmGV" id=3-run-your-app-1>3. Run your app<a href=#3-run-your-app-1 class=hash-link aria-label="Direct link to 3. Run your app" title="Direct link to 3. Run your app"></a></h3><p>From the root of your project, run the following in your command prompt to install and launch your app on the device:<div class="tabs-container tabList_J5MA"><ul role=tablist aria-orientation=horizontal class=tabs><li role=tab tabindex=0 aria-selected=true class="tabs__item tabItem_l0OV tabs__item--active">npm<li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">Yarn</ul><div class=margin-top--md><div role=tabpanel class=tabItem_wHwb><div class="language-shell codeBlockContainer_mQmQ theme-code-block" style=--prism-color:#FFFFFF;--prism-background-color:#282C34><div class=codeBlockTitle_kY6l>shell</div><div class=codeBlockContent_t_Hd><pre tabindex=0 class="prism-code language-shell codeBlock_RMoD thin-scrollbar" style=color:#FFFFFF;background-color:#282C34><code class=codeBlockLines_AclH><span class=token-line style=color:#FFFFFF><span class="token function" style=color:#79b6f2>npm</span><span class="token plain"> run android</span><br></span></code></pre></div></div></div><div role=tabpanel class=tabItem_wHwb hidden><div class="language-shell codeBlockContainer_mQmQ theme-code-block" style=--prism-color:#FFFFFF;--prism-background-color:#282C34><div class=codeBlockTitle_kY6l>shell</div><div class=codeBlockContent_t_Hd><pre tabindex=0 class="prism-code language-shell codeBlock_RMoD thin-scrollbar" style=color:#FFFFFF;background-color:#282C34><code class=codeBlockLines_AclH><span class=token-line style=color:#FFFFFF><span class="token function" style=color:#79b6f2>yarn</span><span class="token plain"> android</span><br></span></code></pre></div></div></div></div></div><blockquote> 19<p>Hint: You can also use the <code>React Native CLI</code> to generate and run a <code>release</code> build (e.g. from the root of your project: <code>yarn android --mode release</code>).</p> 20</blockquote><h2>Connecting to the development server</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.<h3 class="anchor anchorWithStickyNavbar_JmGV" id=method-1-using-adb-reverse-recommended-1>Method 1: Using adb reverse (recommended)<a href=#method-1-using-adb-reverse-recommended-1 class=hash-link aria-label="Direct link to Method 1: Using adb reverse (recommended)" title="Direct link to Method 1: Using adb reverse (recommended)"></a></h3><p>You can use this method if your device is running Android 5.0 (Lollipop) or newer, it has USB debugging enabled, and it is connected via USB to your development machine.<p>Run the following in a command prompt:<div class="language-shell codeBlockContainer_mQmQ theme-code-block" style=--prism-color:#FFFFFF;--prism-background-color:#282C34><div class=codeBlockTitle_kY6l>shell</div><div class=codeBlockContent_t_Hd><pre tabindex=0 class="prism-code language-shell codeBlock_RMoD thin-scrollbar" style=color:#FFFFFF;background-color:#282C34><code class=codeBlockLines_AclH><span class=token-line style=color:#FFFFFF><span class="token plain">$ adb </span><span class="token parameter variable" style=color:#cb4b16>-s</span><span class="token plain"> </span><span class="token operator" style=color:#fc929e>&lt;</span><span class="token plain">device name</span><span class="token operator" style=color:#fc929e>></span><span class="token plain"> reverse tcp:8081 tcp:8081</span><br></span></code></pre></div></div><p>To find the device name, run the following adb command:<div class="language-shell codeBlockContainer_mQmQ theme-code-block" style=--prism-color:#FFFFFF;--prism-background-color:#282C34><div class=codeBlockTitle_kY6l>shell</div><div class=codeBlockContent_t_Hd><pre tabindex=0 class="prism-code language-shell codeBlock_RMoD thin-scrollbar" style=color:#FFFFFF;background-color:#282C34><code class=codeBlockLines_AclH><span class=token-line style=color:#FFFFFF><span class="token plain">$ adb devices</span><br></span></code></pre></div></div><p>You can now enable Fast Refresh from the <a href=/docs/debugging#opening-the-dev-menu>Dev Menu</a>. Your app will reload whenever your JavaScript code has changed.<h3 class="anchor anchorWithStickyNavbar_JmGV" id=method-2-connect-via-wi-fi-1>Method 2: Connect via Wi-Fi<a href=#method-2-connect-via-wi-fi-1 class=hash-link aria-label="Direct link to Method 2: Connect via Wi-Fi" title="Direct link to Method 2: Connect via Wi-Fi"></a></h3><p>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.<p>Open the command prompt and type <code>ipconfig</code> to find your machine's IP address (<a href=https://windows.microsoft.com/en-us/windows/using-command-line-tools-networking-information target=_blank rel="noopener noreferrer">more info</a>).<ol> 21<li>Make sure your laptop and your phone are on the <strong>same</strong> Wi-Fi network.</li> 22<li>Open your React Native app on your device.</li> 23<li>You'll see a <a href=/docs/debugging#logbox>red screen with an error</a>. This is OK. The following steps will fix that.</li> 24<li>Open the in-app <a href=/docs/debugging#opening-the-dev-menu>Dev Menu</a>.</li> 25<li>Go to <strong>Dev Settings</strong><strong>Debug server host & port for device</strong>.</li> 26<li>Type in your machine's IP address and the port of the local dev server (e.g. <code>10.0.1.1:8081</code>).</li> 27<li>Go back to the <strong>Dev Menu</strong> and select <strong>Reload JS</strong>.</li> 28</ol><p>You can now enable Fast Refresh from the <a href=/docs/debugging#opening-the-dev-menu>Dev Menu</a>. Your app will reload whenever your JavaScript code has changed.<h2 class="anchor anchorWithStickyNavbar_JmGV" id=building-your-app-for-production-1>Building your app for production<a href=#building-your-app-for-production-1 class=hash-link aria-label="Direct link to Building your app for production" title="Direct link to Building your app for production"></a></h2><p>You have built a great app using React Native, and you are now itching to release it in the Play Store. The process is the same as any other native Android app, with some additional considerations to take into account. Follow the guide for <a href=/docs/signed-apk-android>generating a signed APK</a> to learn more.</div><div role=tabpanel class=tabItem_wHwb><h3 class="anchor anchorWithStickyNavbar_JmGV" id=1-enable-debugging-over-usb-2>1. Enable Debugging over USB<a href=#1-enable-debugging-over-usb-2 class=hash-link aria-label="Direct link to 1. Enable Debugging over USB" title="Direct link to 1. Enable Debugging over USB"></a></h3><p>Most Android devices can only install and run apps downloaded from Google Play, by default. You will need to enable USB Debugging on your device in order to install your app during development.<p>To enable USB debugging on your device, you will first need to enable the "Developer options" menu by going to <strong>Settings</strong><strong>About phone</strong><strong>Software information</strong> and then tapping the <code>Build number</code> row at the bottom seven times. You can then go back to <strong>Settings</strong><strong>Developer options</strong> to enable "USB debugging".<h3 class="anchor anchorWithStickyNavbar_JmGV" id=2-plug-in-your-device-via-usb-2>2. Plug in your device via USB<a href=#2-plug-in-your-device-via-usb-2 class=hash-link aria-label="Direct link to 2. Plug in your device via USB" title="Direct link to 2. Plug in your device via USB"></a></h3><p>Let's now set up an Android device to run our React Native projects. Go ahead and plug in your device via USB to your development machine.<p>Next, check the manufacturer code by using <code>lsusb</code> (on mac, you must first <a href=https://github.com/jlhonora/lsusb target=_blank rel="noopener noreferrer">install lsusb</a>). <code>lsusb</code> should output something like this:<div class="language-bash codeBlockContainer_mQmQ theme-code-block" style=--prism-color:#FFFFFF;--prism-background-color:#282C34><div class=codeBlockTitle_kY6l>bash</div><div class=codeBlockContent_t_Hd><pre tabindex=0 class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style=color:#FFFFFF;background-color:#282C34><code class=codeBlockLines_AclH><span class=token-line style=color:#FFFFFF><span class="token plain">$ lsusb</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">Bus 002 Device 002: ID </span><span class="token number" style=color:#5a9bcf>8087</span><span class="token plain">:0024 Intel Corp. Integrated Rate Matching Hub</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">Bus 002 Device 001: ID 1d6b:0002 Linux Foundation </span><span class="token number" style=color:#5a9bcf>2.0</span><span class="token plain"> root hub</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">Bus 001 Device 003: ID 22b8:2e76 Motorola PCS</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">Bus 001 Device 002: ID </span><span class="token number" style=color:#5a9bcf>8087</span><span class="token plain">:0024 Intel Corp. Integrated Rate Matching Hub</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">Bus 001 Device 001: ID 1d6b:0002 Linux Foundation </span><span class="token number" style=color:#5a9bcf>2.0</span><span class="token plain"> root hub</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">Bus 004 Device 001: ID 1d6b:0003 Linux Foundation </span><span class="token number" style=color:#5a9bcf>3.0</span><span class="token plain"> root hub</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">Bus 003 Device 001: ID 1d6b:0002 Linux Foundation </span><span class="token number" style=color:#5a9bcf>2.0</span><span class="token plain"> root hub</span><br></span></code></pre></div></div><p>These lines represent the USB devices currently connected to your machine.<p>You want the line that represents your phone. If you're in doubt, try unplugging your phone and running the command again:<div class="language-bash codeBlockContainer_mQmQ theme-code-block" style=--prism-color:#FFFFFF;--prism-background-color:#282C34><div class=codeBlockTitle_kY6l>bash</div><div class=codeBlockContent_t_Hd><pre tabindex=0 class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style=color:#FFFFFF;background-color:#282C34><code class=codeBlockLines_AclH><span class=token-line style=color:#FFFFFF><span class="token plain">$ lsusb</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">Bus 002 Device 002: ID </span><span class="token number" style=color:#5a9bcf>8087</span><span class="token plain">:0024 Intel Corp. Integrated Rate Matching Hub</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">Bus 002 Device 001: ID 1d6b:0002 Linux Foundation </span><span class="token number" style=color:#5a9bcf>2.0</span><span class="token plain"> root hub</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">Bus 001 Device 002: ID </span><span class="token number" style=color:#5a9bcf>8087</span><span class="token plain">:0024 Intel Corp. Integrated Rate Matching Hub</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">Bus 001 Device 001: ID 1d6b:0002 Linux Foundation </span><span class="token number" style=color:#5a9bcf>2.0</span><span class="token plain"> root hub</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">Bus 004 Device 001: ID 1d6b:0003 Linux Foundation </span><span class="token number" style=color:#5a9bcf>3.0</span><span class="token plain"> root hub</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">Bus 003 Device 001: ID 1d6b:0002 Linux Foundation </span><span class="token number" style=color:#5a9bcf>2.0</span><span class="token plain"> root hub</span><br></span></code></pre></div></div><p>You'll see that after removing the phone, the line which has the phone model ("Motorola PCS" in this case) disappeared from the list. This is the line that we care about.<p><code>Bus 001 Device 003: ID 22b8:2e76 Motorola PCS</code><p>From the above line, you want to grab the first four digits from the device ID:<p><code>22b8:2e76</code><p>In this case, it's <code>22b8</code>. That's the identifier for Motorola.<p>You'll need to input this into your udev rules in order to get up and running:<div class="language-shell codeBlockContainer_mQmQ theme-code-block" style=--prism-color:#FFFFFF;--prism-background-color:#282C34><div class=codeBlockTitle_kY6l>shell</div><div class=codeBlockContent_t_Hd><pre tabindex=0 class="prism-code language-shell codeBlock_RMoD thin-scrollbar" style=color:#FFFFFF;background-color:#282C34><code class=codeBlockLines_AclH><span class=token-line style=color:#FFFFFF><span class="token builtin class-name" style=color:#fac863>echo</span><span class="token plain"> </span><span class="token string" style=color:#8dc891>'SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"'</span><span class="token plain"> </span><span class="token operator" style=color:#fc929e>|</span><span class="token plain"> </span><span class="token function" style=color:#79b6f2>sudo</span><span class="token plain"> </span><span class="token function" style=color:#79b6f2>tee</span><span class="token plain"> /etc/udev/rules.d/51-android-usb.rules</span><br></span></code></pre></div></div><p>Make sure that you replace <code>22b8</code> with the identifier you get in the above command.<p>Now check that your device is properly connecting to ADB, the Android Debug Bridge, by running <code>adb devices</code>.<div class="language-shell codeBlockContainer_mQmQ theme-code-block" style=--prism-color:#FFFFFF;--prism-background-color:#282C34><div class=codeBlockTitle_kY6l>shell</div><div class=codeBlockContent_t_Hd><pre tabindex=0 class="prism-code language-shell codeBlock_RMoD thin-scrollbar" style=color:#FFFFFF;background-color:#282C34><code class=codeBlockLines_AclH><span class=token-line style=color:#FFFFFF><span class="token plain">$ adb devices</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">List of devices attached</span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">emulator-5554 offline </span><span class="token comment" style=color:#93a1a1># Google emulator</span><span class="token plain"></span><br></span><span class=token-line style=color:#FFFFFF><span class="token plain">14ed2fcc device </span><span class="token comment" style=color:#93a1a1># Physical device</span><br></span></code></pre></div></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.<h3 class="anchor anchorWithStickyNavbar_JmGV" id=3-run-your-app-2>3. Run your app<a href=#3-run-your-app-2 class=hash-link aria-label="Direct link to 3. Run your app" title="Direct link to 3. Run your app"></a></h3><p>From the root of your project, type the following in your command prompt to install and launch your app on the device:<div class="tabs-container tabList_J5MA"><ul role=tablist aria-orientation=horizontal class=tabs><li role=tab tabindex=0 aria-selected=true class="tabs__item tabItem_l0OV tabs__item--active">npm<li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">Yarn</ul><div class=margin-top--md><div role=tabpanel class=tabItem_wHwb><div class="language-shell codeBlockContainer_mQmQ theme-code-block" style=--prism-color:#FFFFFF;--prism-background-color:#282C34><div class=codeBlockTitle_kY6l>shell</div><div class=codeBlockContent_t_Hd><pre tabindex=0 class="prism-code language-shell codeBlock_RMoD thin-scrollbar" style=color:#FFFFFF;background-color:#282C34><code class=codeBlockLines_AclH><span class=token-line style=color:#FFFFFF><span class="token function" style=color:#79b6f2>npm</span><span class="token plain"> run android</span><br></span></code></pre></div></div></div><div role=tabpanel class=tabItem_wHwb hidden><div class="language-shell codeBlockContainer_mQmQ theme-code-block" style=--prism-color:#FFFFFF;--prism-background-color:#282C34><div class=codeBlockTitle_kY6l>shell</div><div class=codeBlockContent_t_Hd><pre tabindex=0 class="prism-code language-shell codeBlock_RMoD thin-scrollbar" style=color:#FFFFFF;background-color:#282C34><code class=codeBlockLines_AclH><span class=token-line style=color:#FFFFFF><span class="token function" style=color:#79b6f2>yarn</span><span class="token plain"> android</span><br></span></code></pre></div></div></div></div></div><blockquote> 29<p>If you get a "bridge configuration isn't available" error, see <a href=/docs/running-on-device#method-1-using-adb-reverse-recommended>Using adb reverse</a>.</p> 30</blockquote><blockquote> 31<p>Hint: You can also use the <code>React Native CLI</code> to generate and run a <code>release</code> build (e.g. from the root of your project: <code>yarn android --mode release</code>).</p> 32</blockquote><h2>Connecting to the development server</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.<h3 class="anchor anchorWithStickyNavbar_JmGV" id=method-1-using-adb-reverse-recommended-2>Method 1: Using adb reverse (recommended)<a href=#method-1-using-adb-reverse-recommended-2 class=hash-link aria-label="Direct link to Method 1: Using adb reverse (recommended)" title="Direct link to Method 1: Using adb reverse (recommended)"></a></h3><p>You can use this method if your device is running Android 5.0 (Lollipop) or newer, it has USB debugging enabled, and it is connected via USB to your development machine.<p>Run the following in a command prompt:<div class="language-shell codeBlockContainer_mQmQ theme-code-block" style=--prism-color:#FFFFFF;--prism-background-color:#282C34><div class=codeBlockTitle_kY6l>shell</div><div class=codeBlockContent_t_Hd><pre tabindex=0 class="prism-code language-shell codeBlock_RMoD thin-scrollbar" style=color:#FFFFFF;background-color:#282C34><code class=codeBlockLines_AclH><span class=token-line style=color:#FFFFFF><span class="token plain">$ adb </span><span class="token parameter variable" style=color:#cb4b16>-s</span><span class="token plain"> </span><span class="token operator" style=color:#fc929e>&lt;</span><span class="token plain">device name</span><span class="token operator" style=color:#fc929e>></span><span class="token plain"> reverse tcp:8081 tcp:8081</span><br></span></code></pre></div></div><p>To find the device name, run the following adb command:<div class="language-shell codeBlockContainer_mQmQ theme-code-block" style=--prism-color:#FFFFFF;--prism-background-color:#282C34><div class=codeBlockTitle_kY6l>shell</div><div class=codeBlockContent_t_Hd><pre tabindex=0 class="prism-code language-shell codeBlock_RMoD thin-scrollbar" style=color:#FFFFFF;background-color:#282C34><code class=codeBlockLines_AclH><span class=token-line style=color:#FFFFFF><span class="token plain">$ adb devices</span><br></span></code></pre></div></div><p>You can now enable Fast Refresh from the <a href=/docs/debugging#opening-the-dev-menu>Dev Menu</a>. Your app will reload whenever your JavaScript code has changed.<h3 class="anchor anchorWithStickyNavbar_JmGV" id=method-2-connect-via-wi-fi-2>Method 2: Connect via Wi-Fi<a href=#method-2-connect-via-wi-fi-2 class=hash-link aria-label="Direct link to Method 2: Connect via Wi-Fi" title="Direct link to Method 2: Connect via Wi-Fi"></a></h3><p>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.<p>Open a terminal and type <code>/sbin/ifconfig</code> to find your machine's IP address.<ol> 33<li>Make sure your laptop and your phone are on the <strong>same</strong> Wi-Fi network.</li> 34<li>Open your React Native app on your device.</li> 35<li>You'll see a <a href=/docs/debugging#logbox>red screen with an error</a>. This is OK. The following steps will fix that.</li> 36<li>Open the in-app <a href=/docs/debugging#opening-the-dev-menu>Dev Menu</a>.</li> 37<li>Go to <strong>Dev Settings</strong><strong>Debug server host & port for device</strong>.</li> 38<li>Type in your machine's IP address and the port of the local dev server (e.g. <code>10.0.1.1:8081</code>).</li> 39<li>Go back to the <strong>Dev Menu</strong> and select <strong>Reload JS</strong>.</li> 40</ol><p>You can now enable Fast Refresh from the <a href=/docs/debugging#opening-the-dev-menu>Dev Menu</a>. Your app will reload whenever your JavaScript code has changed.<h2 class="anchor anchorWithStickyNavbar_JmGV" id=building-your-app-for-production-2>Building your app for production<a href=#building-your-app-for-production-2 class=hash-link aria-label="Direct link to Building your app for production" title="Direct link to Building your app for production"></a></h2><p>You have built a great app using React Native, and you are now itching to release it in the Play Store. The process is the same as any other native Android app, with some additional considerations to take into account. Follow the guide for <a href=/docs/signed-apk-android>generating a signed APK</a> to learn more.</div></div></div></div><div role=tabpanel class=tabItem_wHwb hidden><h2 class="anchor anchorWithStickyNavbar_JmGV" id=running-your-app-on-ios-devices>Running your app on iOS devices<a href=#running-your-app-on-ios-devices class=hash-link aria-label="Direct link to Running your app on iOS devices" title="Direct link to Running your app on iOS devices"></a></h2><h4 class="anchor anchorWithStickyNavbar_JmGV" id=development-os-1>Development OS<a href=#development-os-1 class=hash-link aria-label="Direct link to Development OS" title="Direct link to Development OS"></a></h4><div class="tabs-container tabList_J5MA"><ul role=tablist aria-orientation=horizontal class="tabs pill-tabs"><li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">macOS<li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">Windows<li role=tab tabindex=0 aria-selected=true class="tabs__item tabItem_l0OV tabs__item--active">Linux</ul><div class=margin-top--md><div role=tabpanel class=tabItem_wHwb hidden><h3 class="anchor anchorWithStickyNavbar_JmGV" id=1-plug-in-your-device-via-usb>1. Plug in your device via USB<a href=#1-plug-in-your-device-via-usb class=hash-link aria-label="Direct link to 1. Plug in your device via USB" title="Direct link to 1. Plug in your device via USB"></a></h3><p>Connect your iOS device to your Mac using a USB to Lightning or USB-C cable. Navigate to the <code>ios</code> folder in your project, then open the <code>.xcodeproj</code> file, or if you are using CocoaPods open <code>.xcworkspace</code>, within it using Xcode.<p>If this is your first time running an app on your iOS device, you may need to register your device for development. Open the <strong>Product</strong> menu from Xcode's menubar, then go to <strong>Destination</strong>. Look for and select your device from the list. Xcode will then register your device for development.<h3 class="anchor anchorWithStickyNavbar_JmGV" id=2-configure-code-signing>2. Configure code signing<a href=#2-configure-code-signing class=hash-link aria-label="Direct link to 2. Configure code signing" title="Direct link to 2. Configure code signing"></a></h3><p>Register for an <a href=https://developer.apple.com/ target=_blank rel="noopener noreferrer">Apple developer account</a> if you don't have one yet.<p>Select your project in the Xcode Project Navigator, then select your main target (it should share the same name as your project). Look for the "General" tab. Go to "Signing" and make sure your Apple developer account or team is selected under the Team dropdown. Do the same for the tests target (it ends with Tests, and is below your main target).<p><strong>Repeat</strong> this step for the <strong>Tests</strong> target in your project.<p><img decoding=async loading=lazy src=/assets/images/RunningOnDeviceCodeSigning-daffe4c45a59c3f5031b35f6b24def1d.png width=809 height=446 class=img_SS3x><h3 class="anchor anchorWithStickyNavbar_JmGV" id=3-build-and-run-your-app>3. Build and Run your app<a href=#3-build-and-run-your-app class=hash-link aria-label="Direct link to 3. Build and Run your app" title="Direct link to 3. Build and Run your app"></a></h3><p>If everything is set up correctly, your device will be listed as the build target in the Xcode toolbar, and it will also appear in the Devices pane (<kbd>Shift ⇧</kbd> + <kbd>Cmd ⌘</kbd> + <kbd>2</kbd>). You can now press the <strong>Build and run</strong> button (<kbd>Cmd ⌘</kbd> + <kbd>R</kbd>) or select <strong>Run</strong> from the <strong>Product</strong> menu. Your app will launch on your device shortly.<p><img decoding=async loading=lazy src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoEAAAAdCAIAAABaCiH+AAAcxklEQVR4AeyVhcoDMRCE8/6vV3dX7K+7DH9gKltvTzhmoBv72Ay7DeeGDzUYDOxS/Pe8ePHixYsX7zDcO2O0m+LFixcvXvyXvHg3uFS/3+f8/pF48eLFixcv/lveYdbr9fpGdpNKEt9oNEqlUi6Xy2Qy2TvCkT19kUdm5G+1Wo/90AaT/NYPorfxuD7NZrNYLJ5nC8CP+Gj6yz+8b3Fo/sWLFw/h3fGFnsvxrWJCcUmRSRJfqVRqtdpkMtntdodgtN1ukR8Xlcvle35wWq/XA7WBzLRxrz4hVEOKsL8QTuPQYknSC+Ujdd1ut2fETbuTGL7RaKAiKM1+v99ut5hAVxNEyO6/zvv8iLgLN1o/9Xrd2/gs/4s8hX8AbNj6WBuB+REfQX+xc9XiMP2LFy+eHwK8xPPvkcMP8gsrnnKSGL5QKIzH4x1ka0fZQn/Kj0Yj3PjURtB+cBdtUNZGkH7ER9BfRLY4Av/ixYs3L/T0De78y08YIc4tkAA+k8ksFgsUZbPZIEKcI0L3l5/wy+USN1o/2MQRyaD94K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+P+2P+KGOT4Y4bl6eDZaP/XIAwlLF/HjK/bysc9TtrwiKBzy9ogilv6YsHf/NLBx/gsH9+vX3xHwiPnfLmzmeKhvZNS/2jcDTIlhIAzn/repAi1aKEigdF8P0B6gvcH7bfjFjtZa2Q3xD/ImydfkN5N5a1cDbed55o9PXbzNr01xQf3ixYu3HwQulisMDlvr0KrhQwjbtqVRs3G03Y/5fd+xo9UTZZD8th7I8N7b+GAQU8Ty6hFfPL88aQX1ixcvnhXK8nTrusZOdK669Kvh8W4zXhSK365OYxw0wCc8DHthR6tnnudpmvjIV/VQxk00yOfXI75cfuNJw2xB/eLFi7cV6uhZu5iqh8cViGEYcFkNv9FdhJKOsfd4rIz1sQv2snpSGbi3fhwHH8yrBzKw/jiO2MuGgjIAWBn59Ygvkd/0wCPFP9MvXrx4W6E09/e02Hnx0xG2lfHe+77v27ZtmgYX29HSYTf6sNR/k8fKWD+EcK8HQCoDllEPZXjv7+MDoOs6wFwzvx7x5fKbHvif6RcvXjwr1P7/d/HP42nRYZt26YgXL168ePHis/DucW3LsthB8eLFixcvXnwW/h9ANZXZVIUD8QAAAABJRU5ErkJggg==" width=641 height=29 class=img_SS3x><blockquote> 41<p>If you run into any issues, please take a look at Apple's <a href=https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/LaunchingYourApponDevices/LaunchingYourApponDevices.html#//apple_ref/doc/uid/TP40012582-CH27-SW4 target=_blank rel="noopener noreferrer">Launching Your App on a Device</a> docs.</p> 42</blockquote><h2>Connecting to the development server</h2><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 your device to open the <a href=/docs/debugging#opening-the-dev-menu>Dev Menu</a>, then enable Fast Refresh. Your app will reload whenever your JavaScript code has changed.<p><img decoding=async loading=lazy src=/assets/images/debugging-dev-menu-076-f2f50e00c40ec72dede2d760c174b987.jpg width=1600 height=840 class=img_SS3x><h3 class="anchor anchorWithStickyNavbar_JmGV" id=troubleshooting>Troubleshooting<a href=#troubleshooting class=hash-link aria-label="Direct link to Troubleshooting" title="Direct link to Troubleshooting"></a></h3><blockquote> 43<p>If you have any issues, ensure that your Mac and device are on the same network and can reach each other. Many open wireless networks with captive portals are configured to prevent devices from reaching other devices on the network. You may use your device's Personal Hotspot feature in this case. You may also share your internet (Wi-Fi/Ethernet) connection from your Mac to your device via USB and connect to the bundler through this tunnel for very high transfer speeds.</p> 44</blockquote><p>When trying to connect to the development server you might get a <a href=/docs/debugging#logbox>red screen with an error</a> saying:<blockquote> 45<p>Connection to <code>http://localhost:8081/debugger-proxy?role=client</code> timed out. Are you running node proxy? If you are running on the device, check if you have the right IP address in <code>RCTWebSocketExecutor.m</code>.</p> 46</blockquote><p>To solve this issue check the following points.<h4 class="anchor anchorWithStickyNavbar_JmGV" id=1-wi-fi-network>1. Wi-Fi network.<a href=#1-wi-fi-network class=hash-link aria-label="Direct link to 1. Wi-Fi network." title="Direct link to 1. Wi-Fi network."></a></h4><p>Make sure your laptop and your phone are on the <strong>same</strong> Wi-Fi network.<h4 class="anchor anchorWithStickyNavbar_JmGV" id=2-ip-address>2. IP address<a href=#2-ip-address class=hash-link aria-label="Direct link to 2. IP address" title="Direct link to 2. IP address"></a></h4><p>Make sure that the build script detected the IP address of your machine correctly (e.g. <code>10.0.1.123</code>).<p><img decoding=async loading=lazy src=/assets/images/XcodeBuildIP-dfc8243436f5436466109acb8f9e0502.png width=1400 height=936 class=img_SS3x><p>Open the <strong>Report navigator</strong> tab, select the last <strong>Build</strong> and search for <code>IP=</code> followed by an IP address. The IP address which gets embedded in the app should match your machines IP address.<h2 class="anchor anchorWithStickyNavbar_JmGV" id=building-your-app-for-production-3>Building your app for production<a href=#building-your-app-for-production-3 class=hash-link aria-label="Direct link to Building your app for production" title="Direct link to Building your app for production"></a></h2><p>You have built a great app using React Native, and you are now itching to release it in the App Store. The process is the same as any other native iOS app, with some additional considerations to take into account. Follow the guide for <a href=/docs/publishing-to-app-store>publishing to the Apple App Store</a> to learn more.</div><div role=tabpanel class=tabItem_wHwb hidden><blockquote> 47<p>A Mac is required in order to build your app for iOS devices. Alternatively, you can refer to our <a href=/docs/environment-setup>environment setup guide</a> to learn how to build your app using Expo CLI, which will allow you to run your app using the Expo client app.</p> 48</blockquote></div><div role=tabpanel class=tabItem_wHwb><blockquote> 49<p>A Mac is required in order to build your app for iOS devices. Alternatively, you can refer to our <a href=/docs/environment-setup>environment setup guide</a> to learn how to build your app using Expo CLI, which will allow you to run your app using the Expo client app.</p> 50</blockquote></div></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class=editButtons_t0bR><a href=https://github.com/facebook/react-native-website/edit/main/docs/running-on-device.md target=_blank rel="noopener noreferrer" class=theme-edit-this-page><svg fill=currentColor height=20 width=20 viewBox="0 0 40 40" class=iconEdit_bHB7 aria-hidden=true><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"/></g></svg>Edit page for next release</a><a href=https://github.com/facebook/react-native-website/edit/main/website/versioned_docs/version-0.79/running-on-device.md target=_blank rel="noopener noreferrer" class=theme-edit-this-page><svg fill=currentColor height=20 width=20 viewBox="0 0 40 40" class=iconEdit_bHB7 aria-hidden=true><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"/></g></svg>Edit page for current release</a></div><div class=lastUpdated_VsjB><span class=theme-last-updated>Last updated<!-- --> on <b><time datetime=2025-04-14T14:14:17.000Z itemprop=dateModified>Apr 14, 2025</time></b></span></div></div></footer></article><nav class="docusaurus-mt-lg pagination-nav" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href=/docs/out-of-tree-platforms><div class=pagination-nav__sublabel>Previous</div><div class=pagination-nav__label>Out-of-Tree Platforms</div></a><a class="pagination-nav__link pagination-nav__link--next" href=/docs/fast-refresh><div class=pagination-nav__sublabel>Next</div><div class=pagination-nav__label>Fast Refresh</div></a></nav></div></div></div></div></main></div></div></div><footer class="theme-layout-footer footer footer--dark"><div class="container container-fluid"><div class="row footer__links"><div class="theme-layout-footer-column col footer__col"><div class=footer__title>Develop</div><ul class="footer__items clean-list"><li class=footer__item><a class=footer__link-item href=/docs/getting-started>Guides</a><li class=footer__item><a class=footer__link-item href=/docs/components-and-apis>Components</a><li class=footer__item><a class=footer__link-item href=/docs/accessibilityinfo>APIs</a><li class=footer__item><a class=footer__link-item href=/architecture/overview>Architecture</a></ul></div><div class="theme-layout-footer-column col footer__col"><div class=footer__title>Participate</div><ul class="footer__items clean-list"><li class=footer__item><a class=footer__link-item href=/showcase>Showcase</a><li class=footer__item><a class=footer__link-item href=/contributing/overview>Contributing</a><li class=footer__item><a class=footer__link-item href=/community/overview>Community</a><li class=footer__item><a href=https://reactnative.directory/ target=_blank rel="noopener noreferrer" class=footer__link-item>Directory<svg width=13.5 height=13.5 aria-hidden=true viewBox="0 0 24 24" class=iconExternalLink_2l9O><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg></a><li class=footer__item><a href=https://stackoverflow.com/questions/tagged/react-native target=_blank rel="noopener noreferrer" class=footer__link-item>Stack Overflow<svg width=13.5 height=13.5 aria-hidden=true viewBox="0 0 24 24" class=iconExternalLink_2l9O><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg></a></ul></div><div class="theme-layout-footer-column col footer__col"><div class=footer__title>Find us</div><ul class="footer__items clean-list"><li class=footer__item><a class=footer__link-item href=/blog>Blog</a><li class=footer__item><a href=https://x.com/reactnative target=_blank rel="noopener noreferrer" class=footer__link-item>X<svg width=13.5 height=13.5 aria-hidden=true viewBox="0 0 24 24" class=iconExternalLink_2l9O><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg></a><li class=footer__item><a href=https://bsky.app/profile/reactnative.dev target=_blank rel="noopener noreferrer" class=footer__link-item>Bluesky<svg width=13.5 height=13.5 aria-hidden=true viewBox="0 0 24 24" class=iconExternalLink_2l9O><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg></a><li class=footer__item><a href=https://github.com/facebook/react-native target=_blank rel="noopener noreferrer" class=footer__link-item>GitHub<svg width=13.5 height=13.5 aria-hidden=true viewBox="0 0 24 24" class=iconExternalLink_2l9O><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg></a></ul></div><div class="theme-layout-footer-column col footer__col"><div class=footer__title>Explore More</div><ul class="footer__items clean-list"><li class=footer__item><a href=https://react.dev/ target=_blank rel="noopener noreferrer" class=footer__link-item>ReactJS<svg width=13.5 height=13.5 aria-hidden=true viewBox="0 0 24 24" class=iconExternalLink_2l9O><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg></a><li class=footer__item><a href=https://opensource.fb.com/legal/privacy/ target=_blank rel="noopener noreferrer" class=footer__link-item>Privacy Policy<svg width=13.5 height=13.5 aria-hidden=true viewBox="0 0 24 24" class=iconExternalLink_2l9O><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg></a><li class=footer__item><a href=https://opensource.fb.com/legal/terms/ target=_blank rel="noopener noreferrer" class=footer__link-item>Terms of Service<svg width=13.5 height=13.5 aria-hidden=true viewBox="0 0 24 24" class=iconExternalLink_2l9O><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg></a></ul></div></div><div class="footer__bottom text--center"><div class=margin-bottom--sm><a href=https://opensource.fb.com/ rel="noopener noreferrer" class=footerLogoLink_tutC><img src=/img/oss_logo.svg alt="Meta Open Source Logo" class="footer__logo themedComponent_siVc themedComponent--light_hHel"><img src=/img/oss_logo.svg alt="Meta Open Source Logo" class="footer__logo themedComponent_siVc themedComponent--dark_yETr"></a></div><div class=footer__copyright>Copyright © 2025 Meta Platforms, Inc.</div></div></div></footer></div>