Files
react-native/docs/next/_getting-started-macos-ios.html
T
2021-03-09 10:10:39 +00:00

54 lines
30 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="Docusaurus v2.0.0-alpha.70">
<link rel="alternate" type="application/rss+xml" href="/blog/rss.xml" title="React Native Blog RSS Feed">
<link rel="alternate" type="application/atom+xml" href="/blog/atom.xml" title="React Native Blog Atom 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=UA-41298772-2"></script>
<script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","UA-41298772-2",{})</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="defer"></script>
<script src="https://snack.expo.io/embed.js" defer="defer"></script><title data-react-helmet="true">_getting-started-macos-ios · React Native</title><meta data-react-helmet="true" name="twitter:image:alt" content="Image for React Native"><meta data-react-helmet="true" name="docsearch:language" content="en"><meta data-react-helmet="true" name="docsearch:version" content="current"><meta data-react-helmet="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-react-helmet="true" property="og:image" content="https://reactnative.dev/img/logo-og.png"><meta data-react-helmet="true" name="twitter:card" content="summary"><meta data-react-helmet="true" name="twitter:image" content="https://reactnative.dev/img/logo-og.png"><meta data-react-helmet="true" property="og:title" content="_getting-started-macos-ios · React Native"><meta data-react-helmet="true" name="description" content="Installing dependencies"><meta data-react-helmet="true" property="og:description" content="Installing dependencies"><meta data-react-helmet="true" property="og:url" content="https://reactnative.dev/docs/next/_getting-started-macos-ios"><link data-react-helmet="true" rel="shortcut icon" href="/img/favicon.ico"><link data-react-helmet="true" rel="preconnect" href="https://BH4D9OD16A-dsn.algolia.net" crossorigin="anonymous"><link data-react-helmet="true" rel="canonical" href="https://reactnative.dev/docs/next/_getting-started-macos-ios"><link rel="stylesheet" href="/styles.f56da522.css">
<link rel="stylesheet" href="/main.3de2b5ef.css">
<link rel="preload" href="/styles.dfe3b9eb.js" as="script">
<link rel="preload" href="/runtime~main.5916a0a4.js" as="script">
<link rel="preload" href="/main.6094b97f.js" as="script">
<link rel="preload" href="/1.8c647f8e.js" as="script">
<link rel="preload" href="/2.e133592c.js" as="script">
<link rel="preload" href="/931.624ff15d.js" as="script">
<link rel="preload" href="/935f2afb.abc3c679.js" as="script">
<link rel="preload" href="/17896441.1e68c5df.js" as="script">
<link rel="preload" href="/8d0344ba.011fb5c4.js" as="script">
<link rel="preload" href="/cd82ed0c.d8fd72d0.js" as="script">
</head>
<body>
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
<nav aria-label="Skip navigation links"><button type="button" tabindex="0" class="skipToContent_3aLp">Skip to main content</button></nav><nav class="navbar navbar--fixed-top navbar--dark"><div class="navbar__inner"><div class="navbar__items"><div aria-label="Navigation bar toggle" class="navbar__toggle" role="button" tabindex="0"><svg aria-label="Menu" width="30" height="30" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></div><a class="navbar__brand" href="/"><img src="/img/header_logo.svg" alt="React Native" class="themedImage_phiS themedImage--light_VJaY navbar__logo"><img src="/img/header_logo.svg" alt="React Native" class="themedImage_phiS themedImage--dark_1NF3 navbar__logo"><strong class="navbar__title">React Native</strong></a><div class="navbar__item dropdown dropdown--hoverable dropdown--left"><a class="navbar__item navbar__link" href="/docs/next/getting-started">Next</a><ul class="dropdown__menu"><li><a aria-current="page" class="dropdown__link dropdown__link--active" href="/docs/next/_getting-started-macos-ios">Next</a></li><li><a class="dropdown__link" href="/docs/_getting-started-macos-ios">0.63</a></li><li><a class="dropdown__link" href="/docs/0.62/_getting-started-macos-ios">0.62</a></li><li><a class="dropdown__link" href="/docs/0.61/_getting-started-macos-ios">0.61</a></li><li><a class="dropdown__link" href="/docs/0.60/_getting-started-macos-ios">0.60</a></li><li><a class="dropdown__link" href="/versions">All versions</a></li></ul></div></div><div class="navbar__items navbar__items--right"><a class="navbar__item navbar__link" href="/docs/next/getting-started">Docs</a><a class="navbar__item navbar__link" href="/docs/next/components-and-apis">Components</a><a class="navbar__item navbar__link" href="/docs/next/accessibilityinfo">API</a><a class="navbar__item navbar__link" href="/help">Community</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="react-toggle react-toggle--disabled displayOnlyInLargeViewport_Bh6k"><div class="react-toggle-track"><div class="react-toggle-track-check"><span class="toggle_1UDy">🌜</span></div><div class="react-toggle-track-x"><span class="toggle_1UDy">🌞</span></div></div><div class="react-toggle-thumb"></div><input type="checkbox" disabled="" aria-label="Dark mode toggle" class="react-toggle-screenreader-only"></div><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20"><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"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span></button></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div><div class="navbar-sidebar"><div class="navbar-sidebar__brand"><a class="navbar__brand" href="/"><img src="/img/header_logo.svg" alt="React Native" class="themedImage_phiS themedImage--light_VJaY navbar__logo"><img src="/img/header_logo.svg" alt="React Native" class="themedImage_phiS themedImage--dark_1NF3 navbar__logo"><strong class="navbar__title">React Native</strong></a></div><div class="navbar-sidebar__items"><div class="menu"><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" href="/docs/next/getting-started">Docs</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/next/components-and-apis">Components</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/next/accessibilityinfo">API</a></li><li class="menu__list-item"><a class="menu__link" href="/help">Community</a></li><li class="menu__list-item"><a class="menu__link" href="/blog">Blog</a></li><li class="menu__list-item"><a role="button" class="menu__link menu__link--sublist">Versions</a><ul class="menu__list"><li class="menu__list-item"><a aria-current="page" class="menu__link menu__link--active" href="/docs/next/_getting-started-macos-ios">Next</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/_getting-started-macos-ios">0.63</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/0.62/_getting-started-macos-ios">0.62</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/0.61/_getting-started-macos-ios">0.61</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/0.60/_getting-started-macos-ios">0.60</a></li><li class="menu__list-item"><a class="menu__link" href="/versions">All versions</a></li></ul></li><li class="menu__list-item"><a href="https://github.com/facebook/react-native" target="_blank" rel="noopener noreferrer" class="menu__link navbar-github-link" aria-label="GitHub repository"></a></li></ul></div></div></div></nav><div class="main-wrapper"><div class="docPage_1mVJ"><main class="docMainContainer_1zi2"><div class="container padding-vert--lg docItemWrapper_1hMI"><div class="row"><div class="col docItemCol_2AGf"><div class="alert alert--warning margin-bottom--md" role="alert"><div>This is unreleased documentation for React Native <strong>Next</strong> version.</div><div class="margin-top--md">For up-to-date documentation, see the <strong><a href="/docs/_getting-started-macos-ios">latest version</a></strong> (0.63).</div></div><div class="docItemContainer_1tAC"><article><div><span class="badge badge--secondary">Version: Next</span></div><header><h1 class="docTitle_cWlf">_getting-started-macos-ios</h1></header><div class="markdown"><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_E4oP" id="installing-dependencies"></a>Installing dependencies<a class="hash-link" href="#installing-dependencies" title="Direct link to heading">#</a></h2><p>You will need Node, Watchman, the React Native command line interface, Xcode and CocoaPods.</p><p>While you can use any editor of your choice to develop your app, you will need to install Xcode in order to set up the necessary tooling to build your React Native app for iOS.</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_E4oP" id="node--watchman"></a>Node &amp; Watchman<a class="hash-link" href="#node--watchman" title="Direct link to heading">#</a></h3><p>We recommend installing Node and Watchman using <a href="http://brew.sh/" target="_blank" rel="noopener noreferrer">Homebrew</a>. Run the following commands in a Terminal after installing Homebrew:</p><div class="mdxCodeBlock_1daz"><div class="codeBlockContent_2es_"><div tabindex="0" class="prism-code language-shell codeBlock_27aQ thin-scrollbar"><div class="codeBlockLines_2rCb" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain">brew </span><span class="token function" style="color:#79b6f2">install</span><span class="token plain"> node</span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain">brew </span><span class="token function" style="color:#79b6f2">install</span><span class="token plain"> watchman</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2bml">Copy</button></div></div><p>If you have already installed Node on your system, make sure it is Node 12 or newer.</p><p><a href="https://facebook.github.io/watchman" target="_blank" rel="noopener noreferrer">Watchman</a> is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance.</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_E4oP" id="xcode"></a>Xcode<a class="hash-link" href="#xcode" title="Direct link to heading">#</a></h3><p>The easiest way to install Xcode is via the <a href="https://itunes.apple.com/us/app/xcode/id497799835?mt=12" target="_blank" rel="noopener noreferrer">Mac App Store</a>. Installing Xcode will also install the iOS Simulator and all the necessary tools to build your iOS app.</p><p>If you have already installed Xcode on your system, make sure it is version 10 or newer.</p><h4><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_E4oP" id="command-line-tools"></a>Command Line Tools<a class="hash-link" href="#command-line-tools" title="Direct link to heading">#</a></h4><p>You will also need to install the Xcode Command Line Tools. Open Xcode, then choose &quot;Preferences...&quot; from the Xcode menu. Go to the Locations panel and install the tools by selecting the most recent version in the Command Line Tools dropdown.</p><p><img alt="Xcode Command Line Tools" src="/assets/images/GettingStartedXcodeCommandLineTools-8259be8d3ab8575bec2b71988163c850.png"></p><h4><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_E4oP" id="installing-an-ios-simulator-in-xcode"></a>Installing an iOS Simulator in Xcode<a class="hash-link" href="#installing-an-ios-simulator-in-xcode" title="Direct link to heading">#</a></h4><p>To install a simulator, open <strong>Xcode &gt; Preferences...</strong> and select the <strong>Components</strong> tab. Select a simulator with the corresponding version of iOS you wish to use.</p><h4><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_E4oP" id="cocoapods"></a>CocoaPods<a class="hash-link" href="#cocoapods" title="Direct link to heading">#</a></h4><p><a href="https://cocoapods.org/" target="_blank" rel="noopener noreferrer">CocoaPods</a> is built with Ruby and it will be installable with the default Ruby available on macOS. You can use a Ruby Version manager, however we recommend that you use the standard Ruby available on macOS unless you know what you&#x27;re doing.</p><p>Using the default Ruby install will require you to use <code>sudo</code> when installing gems. (This is only an issue for the duration of the gem installation, though.)</p><div class="mdxCodeBlock_1daz"><div class="codeBlockContent_2es_"><div tabindex="0" class="prism-code language-shell codeBlock_27aQ thin-scrollbar"><div class="codeBlockLines_2rCb" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token function" style="color:#79b6f2">sudo</span><span class="token plain"> gem </span><span class="token function" style="color:#79b6f2">install</span><span class="token plain"> cocoapods</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2bml">Copy</button></div></div><p>For more information, please visit <a href="https://guides.cocoapods.org/using/getting-started.html" target="_blank" rel="noopener noreferrer">CocoaPods Getting Started guide</a>.</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_E4oP" id="react-native-command-line-interface"></a>React Native Command Line Interface<a class="hash-link" href="#react-native-command-line-interface" title="Direct link to heading">#</a></h3><p>React Native has a built-in command line interface. Rather than install and manage a specific version of the CLI globally, we recommend you access the current version at runtime using <code>npx</code>, which ships with Node.js. With <code>npx react-native &lt;command&gt;</code>, the current stable version of the CLI will be downloaded and executed at the time the command is run.</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_E4oP" id="creating-a-new-application"></a>Creating a new application<a class="hash-link" href="#creating-a-new-application" title="Direct link to heading">#</a></h2><blockquote><p>If you previously installed a global <code>react-native-cli</code> package, please remove it as it may cause unexpected issues.</p></blockquote><p>You can use React Native&#x27;s built-in command line interface to generate a new project. Let&#x27;s create a new React Native project called &quot;AwesomeProject&quot;:</p><div class="mdxCodeBlock_1daz"><div class="codeBlockContent_2es_"><div tabindex="0" class="prism-code language-shell codeBlock_27aQ thin-scrollbar"><div class="codeBlockLines_2rCb" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain">npx react-native init AwesomeProject</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2bml">Copy</button></div></div><p>This is not necessary if you are integrating React Native into an existing application, if you &quot;ejected&quot; from Expo, or if you&#x27;re adding iOS support to an existing React Native project (see <a href="/docs/next/integration-with-existing-apps">Integration with Existing Apps</a>). You can also use a third-party CLI to init your React Native app, such as <a href="https://github.com/infinitered/ignite" target="_blank" rel="noopener noreferrer">Ignite CLI</a>.</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_E4oP" id="optional-using-a-specific-version-or-template"></a>[Optional] Using a specific version or template<a class="hash-link" href="#optional-using-a-specific-version-or-template" title="Direct link to heading">#</a></h3><p>If you want to start a new project with a specific React Native version, you can use the <code>--version</code> argument:</p><div class="mdxCodeBlock_1daz"><div class="codeBlockContent_2es_"><div tabindex="0" class="prism-code language-shell codeBlock_27aQ thin-scrollbar"><div class="codeBlockLines_2rCb" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain">npx react-native init AwesomeProject --version X.XX.X</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2bml">Copy</button></div></div><p>You can also start a project with a custom React Native template, like TypeScript, with <code>--template</code> argument:</p><div class="mdxCodeBlock_1daz"><div class="codeBlockContent_2es_"><div tabindex="0" class="prism-code language-shell codeBlock_27aQ thin-scrollbar"><div class="codeBlockLines_2rCb" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain">npx react-native init AwesomeTSProject --template react-native-template-typescript</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2bml">Copy</button></div></div><blockquote><p><strong>Note</strong> If the above command is failing, you may have old version of <code>react-native</code> or <code>react-native-cli</code> installed globally on your pc. Try uninstalling the cli and run the cli using <code>npx</code>.</p></blockquote><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_E4oP" id="running-your-react-native-application"></a>Running your React Native application<a class="hash-link" href="#running-your-react-native-application" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_E4oP" id="step-1-start-metro"></a>Step 1: Start Metro<a class="hash-link" href="#step-1-start-metro" title="Direct link to heading">#</a></h3><p>First, you will need to start Metro, the JavaScript bundler that ships with React Native. Metro &quot;takes in an entry file and various options, and returns a single JavaScript file that includes all your code and its dependencies.&quot;<a href="https://facebook.github.io/metro/docs/concepts" target="_blank" rel="noopener noreferrer">Metro Docs</a></p><p>To start Metro, run <code>npx react-native start</code> inside your React Native project folder:</p><div class="mdxCodeBlock_1daz"><div class="codeBlockContent_2es_"><div tabindex="0" class="prism-code language-shell codeBlock_27aQ thin-scrollbar"><div class="codeBlockLines_2rCb" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain">npx react-native start</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2bml">Copy</button></div></div><p><code>react-native start</code> starts Metro Bundler.</p><blockquote><p>If you use the Yarn package manager, you can use <code>yarn</code> instead of <code>npx</code> when running React Native commands inside an existing project.</p></blockquote><blockquote><p>If you&#x27;re familiar with web development, Metro is a lot like webpack—for React Native apps. Unlike Kotlin or Java, JavaScript isn&#x27;t compiled—and neither is React Native. Bundling isn&#x27;t the same as compiling, but it can help improve startup performance and translate some platform-specific JavaScript into more JavaScript.</p></blockquote><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_E4oP" id="step-2-start-your-application"></a>Step 2: Start your application<a class="hash-link" href="#step-2-start-your-application" title="Direct link to heading">#</a></h3><p>Let Metro Bundler run in its own terminal. Open a new terminal inside your React Native project folder. Run the following:</p><div class="mdxCodeBlock_1daz"><div class="codeBlockContent_2es_"><div tabindex="0" class="prism-code language-shell codeBlock_27aQ thin-scrollbar"><div class="codeBlockLines_2rCb" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain">npx react-native run-ios</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2bml">Copy</button></div></div><p>You should see your new app running in the iOS Simulator shortly.</p><p><img alt="AwesomeProject on iOS" src="/assets/images/GettingStartediOSSuccess-e6dd7fc2baa303d1f30373d996a6e51d.png"></p><p><code>npx react-native run-ios</code> is one way to run your app. You can also run it directly from within Xcode.</p><blockquote><p>If you can&#x27;t get this to work, see the <a href="/docs/next/troubleshooting#content">Troubleshooting</a> page.</p></blockquote><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_E4oP" id="running-on-a-device"></a>Running on a device<a class="hash-link" href="#running-on-a-device" title="Direct link to heading">#</a></h3><p>The above command will automatically run your app on the iOS Simulator by default. If you want to run the app on an actual physical iOS device, please follow the instructions <a href="/docs/next/running-on-device">here</a>.</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_E4oP" id="modifying-your-app"></a>Modifying your app<a class="hash-link" href="#modifying-your-app" title="Direct link to heading">#</a></h3><p>Now that you have successfully run the app, let&#x27;s modify it.</p><ul><li>Open <code>App.js</code> in your text editor of choice and edit some lines.</li><li>Hit <code>⌘R</code> in your iOS Simulator to reload the app and see your changes!</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_E4oP" id="thats-it"></a>That&#x27;s it!<a class="hash-link" href="#thats-it" title="Direct link to heading">#</a></h3><p>Congratulations! You&#x27;ve successfully run and modified your first React Native app.</p><center><img src="/docs/assets/GettingStartedCongratulations.png" width="150"></center><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_E4oP" id="now-what"></a>Now what?<a class="hash-link" href="#now-what" title="Direct link to heading">#</a></h2><ul><li>If you want to add this new React Native code to an existing application, check out the <a href="/docs/next/integration-with-existing-apps">Integration guide</a>.</li></ul><p>If you&#x27;re curious to learn more about React Native, check out the <a href="/docs/next/getting-started">Introduction to React Native</a>.</p></div></article><div class="docMetadata margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/facebook/react-native-website/blob/master/website/../docs/_getting-started-macos-ios.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" role="img" viewBox="0 0 40 40" class="iconEdit_2Hwv"><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"></path></g></svg>Edit this page</a></div><div class="col text--right"><em><small class="docMetadata-updated">Last updated on <time datetime="2020-12-18T11:24:20.000Z" class="docLastUpdatedAt_1gIo">12/18/2020</time></small></em></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav" aria-label="Blog list page navigation"><div class="pagination-nav__item"></div><div class="pagination-nav__item pagination-nav__item--next"></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_1zTD thin-scrollbar"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#installing-dependencies" class="table-of-contents__link">Installing dependencies</a><ul><li><a href="#node--watchman" class="table-of-contents__link">Node &amp; Watchman</a></li><li><a href="#xcode" class="table-of-contents__link">Xcode</a></li><li><a href="#react-native-command-line-interface" class="table-of-contents__link">React Native Command Line Interface</a></li></ul></li><li><a href="#creating-a-new-application" class="table-of-contents__link">Creating a new application</a><ul><li><a href="#optional-using-a-specific-version-or-template" class="table-of-contents__link">Optional Using a specific version or template</a></li></ul></li><li><a href="#running-your-react-native-application" class="table-of-contents__link">Running your React Native application</a><ul><li><a href="#step-1-start-metro" class="table-of-contents__link">Step 1: Start Metro</a></li><li><a href="#step-2-start-your-application" class="table-of-contents__link">Step 2: Start your application</a></li><li><a href="#running-on-a-device" class="table-of-contents__link">Running on a device</a></li><li><a href="#modifying-your-app" class="table-of-contents__link">Modifying your app</a></li><li><a href="#thats-it" class="table-of-contents__link">That&#39;s it!</a></li></ul></li><li><a href="#now-what" class="table-of-contents__link">Now what?</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="row footer__links"><div class="col footer__col"><h4 class="footer__title">Docs</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/docs/getting-started">Getting Started</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/tutorial">Tutorial</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/components-and-apis">Components and APIs</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/more-resources">More Resources</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">Community</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/help">The React Native Community</a></li><li class="footer__item"><a class="footer__link-item" href="/showcase">Who&#x27;s using React Native?</a></li><li class="footer__item"><a href="https://stackoverflow.com/questions/tagged/react-native" target="_blank" rel="noopener noreferrer" class="footer__link-item">Ask Questions on Stack Overflow</a></li><li class="footer__item"><a href="https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md" target="_blank" rel="noopener noreferrer" class="footer__link-item">Contributor Guide</a></li><li class="footer__item"><a href="https://dev.to/t/reactnative" target="_blank" rel="noopener noreferrer" class="footer__link-item">DEV Community</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">Find us</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/blog">Blog</a></li><li class="footer__item"><a href="https://twitter.com/reactnative" target="_blank" rel="noopener noreferrer" class="footer__link-item">Twitter</a></li><li class="footer__item"><a href="https://github.com/facebook/react-native" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">More</h4><ul class="footer__items"><li class="footer__item"><a href="https://reactjs.org/" target="_blank" rel="noopener noreferrer" class="footer__link-item">React</a></li><li class="footer__item"><a href="https://opensource.facebook.com/legal/privacy" target="_blank" rel="noopener noreferrer" class="footer__link-item">Privacy Policy</a></li><li class="footer__item"><a href="https://opensource.facebook.com/legal/terms" target="_blank" rel="noopener noreferrer" class="footer__link-item">Terms of Service</a></li></ul></div></div><div class="footer__bottom text--center"><div class="margin-bottom--sm"><a href="https://opensource.facebook.com" target="_blank" rel="noopener noreferrer" class="footerLogoLink_3cAK"><img class="footer__logo" alt="Facebook Open Source Logo" src="/img/oss_logo.png"></a></div><div class="footer__copyright">Copyright © 2021 Facebook, Inc.</div></div></div></footer></div>
<script src="/styles.dfe3b9eb.js"></script>
<script src="/runtime~main.5916a0a4.js"></script>
<script src="/main.6094b97f.js"></script>
<script src="/1.8c647f8e.js"></script>
<script src="/2.e133592c.js"></script>
<script src="/931.624ff15d.js"></script>
<script src="/935f2afb.abc3c679.js"></script>
<script src="/17896441.1e68c5df.js"></script>
<script src="/8d0344ba.011fb5c4.js"></script>
<script src="/cd82ed0c.d8fd72d0.js"></script>
</body>
</html>