forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
437 lines (427 loc) · 56.4 KB
/
index.html
File metadata and controls
437 lines (427 loc) · 56.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Getting Started · React Native</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta name="description" content="This page will help you install and build your first React Native app. If you already have React Native installed, you can skip ahead to the [Tutorial](/docs/0.54/tutorial)."/><meta name="docsearch:version" content="0.54"/><meta name="docsearch:language" content="en"/><meta property="og:title" content="Getting Started · React Native"/><meta property="og:type" content="website"/><meta property="og:url" content="https://reactnative.dev/"/><meta property="og:description" content="This page will help you install and build your first React Native app. If you already have React Native installed, you can skip ahead to the [Tutorial](/docs/0.54/tutorial)."/><meta property="og:image" content="https://reactnative.dev/img/logo-og.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://reactnative.dev/img/logo-og.png"/><link rel="shortcut icon" href="/img/favicon.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/solarized-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://reactnative.dev/blog/atom.xml" title="React Native Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://reactnative.dev/blog/feed.xml" title="React Native Blog RSS Feed"/><script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-41298772-2', 'auto');
ga('send', 'pageview');
</script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/focus-visible@5.0.2/dist/focus-visible.min.js"></script><script type="text/javascript" src="https://snack.expo.io/embed.js"></script><script type="text/javascript" src="https://platform.twitter.com/widgets.js"></script><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="/js/codeblocks.js"></script><script type="text/javascript" src="/js/tabs.js"></script><script type="text/javascript" src="/js/docs-rating.js"></script><script type="text/javascript" src="/js/announcement.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
document.addEventListener('DOMContentLoaded', function() {
addBackToTop(
{"zIndex":100}
)
});
</script><script src="/js/scrollSpy.js"></script><link rel="stylesheet" href="/css/prism.css"/><link rel="stylesheet" href="/css/main.css"/><script src="/js/codetabs.js"></script></head><body class="sideNavVisible separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/"><img class="logo" src="/img/header_logo.svg" alt="React Native"/><h2 class="headerTitleWithLogo">React Native</h2></a><a href="/versions"><h3>0.54</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive siteNavItemActive"><a href="/docs/0.54/getting-started" target="_self">Docs</a></li><li class="siteNavGroupActive"><a href="/docs/0.54/components-and-apis" target="_self">Components</a></li><li class="siteNavGroupActive"><a href="/docs/0.54/accessibilityinfo" target="_self">API</a></li><li class=""><a href="/help" target="_self">Community</a></li><li class=""><a href="/blog/" target="_self">Blog</a></li><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li><li class=""><a href="https://github.com/facebook/react-native" target="_self">GitHub</a></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><div class="hamburger-menu"><div class="line1"></div><div class="line2"></div><div class="line3"></div></div></div><h2><i>›</i><span>The Basics</span></h2><div class="tocToggler" id="tocToggler"><i class="icon-toc"></i></div></div><div class="navGroups"><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">The Basics<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem navListItemActive"><a class="navItem" href="/docs/0.54/getting-started">Getting Started</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/tutorial">Learn the Basics</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/props">Props</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/state">State</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/style">Style</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/height-and-width">Height and Width</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/flexbox">Layout with Flexbox</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/handling-text-input">Handling Text Input</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/handling-touches">Handling Touches</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/using-a-scrollview">Using a ScrollView</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/using-a-listview">Using List Views</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/network">Networking</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/more-resources">More Resources</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">Guides<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/docs/0.54/components-and-apis">Components and APIs</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/platform-specific-code">Platform Specific Code</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/navigation">Navigating Between Screens</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/images">Images</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/animations">Animations</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/accessibility">Accessibility</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/improvingux">Improving User Experience</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/timers">Timers</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/debugging">Debugging</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/performance">Performance</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/gesture-responder-system">Gesture Responder System</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/javascript-environment">JavaScript Environment</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/direct-manipulation">Direct Manipulation</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/colors">Color Reference</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/integration-with-existing-apps">Integration with Existing Apps</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/building-for-tv">Building For TV Devices</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/running-on-device">Running On Device</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/upgrading">Upgrading to new React Native versions</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/troubleshooting">Troubleshooting</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/native-modules-setup">Native Modules Setup</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">Guides (iOS)<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/docs/0.54/native-modules-ios">Native Modules</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/native-components-ios">Native UI Components</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/linking-libraries-ios">Linking Libraries</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/running-on-simulator-ios">Running On Simulator</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/communication-ios">Communication between native and React Native</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/app-extensions">App Extensions</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">Guides (Android)<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/docs/0.54/native-modules-android">Native Modules</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/native-components-android">Native UI Components</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/headless-js-android">Headless JS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/signed-apk-android">Publishing to Google Play Store</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/removing-default-permissions">Removing Default Permissions</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">Components<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/docs/0.54/activityindicator">ActivityIndicator</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/button">Button</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/datepickerios">DatePickerIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/drawerlayoutandroid">DrawerLayoutAndroid</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/flatlist">FlatList</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/image">Image</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/imagebackground">ImageBackground</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/keyboardavoidingview">KeyboardAvoidingView</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/listview">ListView</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/maskedviewios">MaskedViewIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/modal">Modal</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/navigatorios">NavigatorIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/picker">Picker</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/pickerios">PickerIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/progressbarandroid">ProgressBarAndroid</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/progressviewios">ProgressViewIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/refreshcontrol">RefreshControl</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/safeareaview">SafeAreaView</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/scrollview">ScrollView</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/sectionlist">SectionList</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/segmentedcontrolios">SegmentedControlIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/slider">Slider</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/snapshotviewios">SnapshotViewIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/statusbar">StatusBar</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/switch">Switch</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/tabbarios">TabBarIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/tabbarios-item">TabBarIOS.Item</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/text">Text</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/textinput">TextInput</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/toolbarandroid">ToolbarAndroid</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/touchablehighlight">TouchableHighlight</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/touchablenativefeedback">TouchableNativeFeedback</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/touchableopacity">TouchableOpacity</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/touchablewithoutfeedback">TouchableWithoutFeedback</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/view">View</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/viewpagerandroid">ViewPagerAndroid</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/virtualizedlist">VirtualizedList</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/webview">WebView</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">APIs<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/docs/0.54/accessibilityinfo">AccessibilityInfo</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/actionsheetios">ActionSheetIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/alert">Alert</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/alertios">AlertIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/animated">Animated</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/appregistry">AppRegistry</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/appstate">AppState</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/asyncstorage">AsyncStorage</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/backandroid">BackAndroid</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/backhandler">BackHandler</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/cameraroll">CameraRoll</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/clipboard">Clipboard</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/datepickerandroid">DatePickerAndroid</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/dimensions">Dimensions</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/easing">Easing</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/geolocation">Geolocation</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/imageeditor">ImageEditor</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/imagepickerios">ImagePickerIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/imagestore">ImageStore</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/image-style-props">Image Style Props</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/interactionmanager">InteractionManager</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/keyboard">Keyboard</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/layout-props">Layout Props</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/layoutanimation">LayoutAnimation</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/linking">Linking</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/listviewdatasource">ListViewDataSource</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/netinfo">NetInfo</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/panresponder">PanResponder</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/permissionsandroid">PermissionsAndroid</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/pixelratio">PixelRatio</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/pushnotificationios">PushNotificationIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/settings">Settings</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/shadow-props">Shadow Props</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/share">Share</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/statusbarios">StatusBarIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/stylesheet">StyleSheet</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/systrace">Systrace</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/text-style-props">Text Style Props</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/timepickerandroid">TimePickerAndroid</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/toastandroid">ToastAndroid</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/transforms">Transforms</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/vibration">Vibration</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/vibrationios">VibrationIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.54/view-style-props">View Style Props</a></li></ul></div></div></section></div><script>
var coll = document.getElementsByClassName('collapsible');
var checkActiveCategory = true;
for (var i = 0; i < coll.length; i++) {
var links = coll[i].nextElementSibling.getElementsByTagName('*');
if (checkActiveCategory){
for (var j = 0; j < links.length; j++) {
if (links[j].classList.contains('navListItemActive')){
coll[i].nextElementSibling.classList.toggle('hide');
coll[i].childNodes[1].classList.toggle('rotate');
checkActiveCategory = false;
break;
}
}
}
coll[i].addEventListener('click', function() {
var arrow = this.childNodes[1];
arrow.classList.toggle('rotate');
var content = this.nextElementSibling;
content.classList.toggle('hide');
});
}
document.addEventListener('DOMContentLoaded', function() {
createToggler('#navToggler', '#docsNav', 'docsSliderActive');
createToggler('#tocToggler', 'body', 'tocActive');
var headings = document.querySelector('.toc-headings');
headings && headings.addEventListener('click', function(event) {
var el = event.target;
while(el !== headings){
if (el.tagName === 'A') {
document.body.classList.remove('tocActive');
break;
} else{
el = el.parentNode;
}
}
}, false);
function createToggler(togglerSelector, targetSelector, className) {
var toggler = document.querySelector(togglerSelector);
var target = document.querySelector(targetSelector);
if (!toggler) {
return;
}
toggler.onclick = function(event) {
event.preventDefault();
target.classList.toggle(className);
};
}
});
</script></nav></div><div class="container mainContainer docsContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/react-native-website/blob/master/docs/getting-started.md" target="_blank" rel="noreferrer noopener">Edit</a><h1 id="__docusaurus" class="postHeaderTitle">Getting Started</h1></header><article><div><span><p>This page will help you install and build your first React Native app. If you already have React Native installed, you can skip ahead to the <a href="/docs/0.54/tutorial">Tutorial</a>.</p>
<p><strong>If you are new to mobile development</strong>, the easiest way to get started is with Expo CLI. Expo is a set of tools built around React Native and, while it has many <a href="https://expo.io/features">features</a>, the most relevant feature for us right now is that it can get you writing a React Native app within minutes. You will only need a recent version of Node.js and a phone or emulator. If you'd like to try out React Native directly in your web browser before installing any tools, you can try out <a href="https://snack.expo.io/">Snack</a>.</p>
<p><strong>If you are already familiar with mobile development</strong>, you may want to use React Native CLI. It requires Xcode or Android Studio to get started. If you already have one of these tools installed, you should be able to get up and running within a few minutes. If they are not installed, you should expect to spend about an hour installing and configuring them.</p>
<div class="toggler">
<ul role="tablist" id="toggle-guide">
<li id="quickstart" class="button-quickstart" aria-selected="false" role="tab" tabindex="0" aria-controls="quickstarttab" onclick="displayTab('guide', 'quickstart')">
Expo CLI Quickstart
</li>
<li id="native" class="button-native" aria-selected="false" role="tab" tabindex="0" aria-controls="nativetab" onclick="displayTab('guide', 'native')">
React Native CLI Quickstart
</li>
</ul>
</div>
<p><block class="quickstart mac windows linux ios android" /></p>
<p>Assuming that you have <a href="https://nodejs.org/en/download/">Node 10 LTS</a> or greater installed, you can use npm to install the Expo CLI command line utility:</p>
<pre><code class="hljs css language-sh"><span class="token function">npm</span> <span class="token function">install</span> -g expo-cli
</code></pre>
<p>Then run the following commands to create a new React Native project called "AwesomeProject":</p>
<pre><code class="hljs css language-sh">expo init AwesomeProject
<span class="token builtin class-name">cd</span> AwesomeProject
<span class="token function">npm</span> start <span class="token comment"># you can also use: expo start</span>
</code></pre>
<p>This will start a development server for you.</p>
<p><h2>Running your React Native application</h2></p>
<p>Install the <a href="https://expo.io">Expo</a> client app on your iOS or Android phone and connect to the same wireless network as your computer. On Android, use the Expo app to scan the QR code from your terminal to open your project. On iOS, follow on-screen instructions to get a link.</p>
<p><h3>Modifying your app</h3></p>
<p>Now that you have successfully run the app, let's modify it. Open <code>App.js</code> in your text editor of choice and edit some lines. The application should reload automatically once you save your changes.</p>
<p><h3>That's it!</h3></p>
<p>Congratulations! You've successfully run and modified your first React Native app.</p>
<p><center><img src="/docs/assets/GettingStartedCongratulations.png" width="150"></img></center></p>
<p><h2>Now what?</h3></p>
<p>Expo also has <a href="https://docs.expo.io">docs</a> you can reference if you have questions specific to the tool. You can also ask for help at <a href="https://forums.expo.io">Expo forums</a>.</p>
<p>These tools help you get started quickly, but before committing to building your app with Expo CLI, <a href="https://docs.expo.io/versions/latest/introduction/why-not-expo/">read about the limitations</a>.</p>
<p>If you have a problem with Expo, before creating a new issue, please see if there's an existing issue about it:</p>
<ul>
<li>in the <a href="https://github.com/expo/expo-cli/issues">Expo CLI issues</a> (for issues related to Expo CLI), or</li>
<li>in the <a href="https://github.com/expo/expo/issues">Expo issues</a> (for issues about the Expo client or SDK).</li>
</ul>
<p>If you're curious to learn more about React Native, continue on to the <a href="/docs/0.54/tutorial">Tutorial</a>.</p>
<p><h3>Running your app on a simulator or virtual device</h3></p>
<p>Expo CLI allows you to run your React Native app on a physical device without setting up a development environment. If you want to run your app on the iOS Simulator or an Android Virtual Device, please refer to the instructions for "React Native CLI Quickstart" to learn how to install Xcode or set up your Android development environment.</p>
<p>Once you've set these up, you can launch your app on an Android Virtual Device by running <code>npm run android</code>, or on the iOS Simulator by running <code>npm run ios</code> (macOS only).</p>
<p><h3>Caveats</h3></p>
<p>Because you don't build any native code when using Expo to create a project, it's not possible to include custom native modules beyond the React Native APIs and components that are available in the Expo client app.</p>
<p>If you know that you'll eventually need to include your own native code, Expo is still a good way to get started. In that case you'll need to "<a href="https://docs.expo.io/versions/latest/workflow/customizing/">eject</a>" eventually to create your own native builds. If you do eject, the "React Native CLI Quickstart" instructions will be required to continue working on your project.</p>
<p>Expo CLI configures your project to use the most recent React Native version that is supported by the Expo client app. The Expo client app usually gains support for a given React Native version about a week after the React Native version is released as stable. You can check <a href="https://docs.expo.io/versions/latest/sdk/overview/#sdk-version">this document</a> to find out what versions are supported.</p>
<p>If you're integrating React Native into an existing project, you'll want to skip Expo CLI and go directly to setting up the native build environment. Select "React Native CLI Quickstart" above for instructions on configuring a native build environment for React Native.</p>
<p><block class="native mac windows linux ios android" /></p>
<p>Follow these instructions if you need to build native code in your project. For example, if you are integrating React Native into an existing application, or if you "ejected" from <a href="getting-started" onclick="displayTab('guide', 'quickstart')">Expo</a>, you'll need this section.</p>
<p>The instructions are a bit different depending on your development operating system, and whether you want to start developing for iOS or Android. If you want to develop for both Android and iOS, that's fine - you can pick one to start with, since the setup is a bit different.</p>
<div class="toggler">
<span>Development OS:</span>
<span role="tablist" id="toggle-os">
<button role="tab" class="button-mac" onclick="displayTab('os', 'mac')">macOS</button>
<button role="tab" class="button-windows" onclick="displayTab('os', 'windows')">Windows</button>
<button role="tab" class="button-linux" onclick="displayTab('os', 'linux')">Linux</button>
</span>
</div>
<div class="toggler">
<span>Target OS:</span>
<span role="tablist" id="toggle-platform">
<button role="tab" class="button-ios" onclick="displayTab('platform', 'ios')">iOS</button>
<button role="tab" class="button-android" onclick="displayTab('platform', 'android')">Android</button>
</span>
</div>
<p><block class="native linux windows ios" /></p>
<p><h2>Unsupported</h2></p>
<blockquote><p>A Mac is required to build projects with native code for iOS. You can follow the <a href="getting-started" onclick="displayTab('guide', 'quickstart')">Quick Start</a> to learn how to build your app using Expo instead.</p></blockquote>
<p><block class="native mac ios" /></p>
<p><h2>Installing dependencies</h2></p>
<p>You will need Node, Watchman, the React Native command line interface, and Xcode.</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>
<p><block class="native mac android" /></p>
<p><h2>Installing dependencies</h2></p>
<p>You will need Node, Watchman, the React Native command line interface, a JDK, and Android Studio.</p>
<p><block class="native linux android" /></p>
<p><h2>Installing dependencies</h2></p>
<p>You will need Node, the React Native command line interface, a JDK, and Android Studio.</p>
<p><block class="native windows android" /></p>
<p><h2>Installing dependencies</h2></p>
<p>You will need Node, the React Native command line interface, Python2, a JDK, and Android Studio.</p>
<p><block class="native mac windows linux android" /></p>
<p>While you can use any editor of your choice to develop your app, you will need to install Android Studio in order to set up the necessary tooling to build your React Native app for Android.</p>
<p><block class="native mac ios android" /></p>
<p><h3>Node, Watchman, JDK</h3></p>
<p>We recommend installing Node, Watchman, and JDK using <a href="http://brew.sh/">Homebrew</a>. Run the following commands in a Terminal after installing Homebrew:</p>
<pre><code class="hljs"><span class="hljs-keyword">brew </span>install yarn
<span class="hljs-keyword">brew </span>install node
<span class="hljs-keyword">brew </span>install watchman
<span class="hljs-keyword">brew </span>tap AdoptOpenJDK/openjdk
<span class="hljs-keyword">brew </span>cask install adoptopenjdk8
</code></pre>
<p>If you have already installed Node on your system, make sure it is Node 8.3 or newer.</p>
<p><a href="https://facebook.github.io/watchman">Watchman</a> is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance.</p>
<p>If you have already installed JDK on your system, make sure it is JDK 8 or newer.</p>
<p><block class="native linux android" /></p>
<p><h3>Node</h3></p>
<p>Follow the <a href="https://nodejs.org/en/download/package-manager/">installation instructions for your Linux distribution</a> to install Node 8.3 or newer.</p>
<p><block class='native windows android' /></p>
<p><h3>Node, Python2, JDK</h3></p>
<p>We recommend installing Node and Python2 via <a href="https://chocolatey.org">Chocolatey</a>, a popular package manager for Windows.</p>
<p>React Native also requires a recent version of the <a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">Java SE Development Kit (JDK)</a>, as well as Python 2. Both can be installed using Chocolatey.</p>
<p>Open an Administrator Command Prompt (right click Command Prompt and select "Run as Administrator"), then run the following command:</p>
<pre><code class="hljs css language-powershell">choco install <span class="hljs-literal">-y</span> nodejs.install python2 jdk8
</code></pre>
<p>If you have already installed Node on your system, make sure it is Node 8.3 or newer. If you already have a JDK on your system, make sure it is version 8 or newer.</p>
<blockquote>
<p>You can find additional installation options on <a href="https://nodejs.org/en/download/">Node's Downloads page</a>.</p>
</blockquote>
<p><block class="native mac ios android" /></p>
<p><h3>The React Native CLI</h3></p>
<p>Node comes with npm, which lets you install the React Native command line interface.</p>
<p>Run the following command in a Terminal:</p>
<pre><code class="hljs"><span class="hljs-built_in">npm</span> install -g react-<span class="hljs-keyword">native</span>-cli
</code></pre>
<blockquote>
<p>If you get an error like <code>Cannot find module 'npmlog'</code>, try installing npm directly: <code>curl -0 -L https://npmjs.org/install.sh | sudo sh</code>.</p>
</blockquote>
<p><block class="native windows linux android" /></p>
<p><h3>The React Native CLI</h3></p>
<p>Node comes with npm, which lets you install the React Native command line interface.</p>
<p>Run the following command in a Command Prompt or shell:</p>
<pre><code class="hljs css language-powershell">npm install <span class="hljs-literal">-g</span> react<span class="hljs-literal">-native</span><span class="hljs-literal">-cli</span>
</code></pre>
<blockquote>
<p>If you get an error like <code>Cannot find module 'npmlog'</code>, try installing npm directly: <code>curl -0 -L https://npmjs.org/install.sh | sudo sh</code>.</p>
</blockquote>
<p><block class="native mac ios" /></p>
<p><h3>Xcode</h3></p>
<p>The easiest way to install Xcode is via the <a href="https://itunes.apple.com/us/app/xcode/id497799835?mt=12">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 9.4 or newer.</p>
<p><h4>Command Line Tools</h4></p>
<p>You will also need to install the Xcode Command Line Tools. Open Xcode, then choose "Preferences..." 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 src="/docs/assets/GettingStartedXcodeCommandLineTools.png" alt="Xcode Command Line Tools"></p>
<p><block class="native linux android" /></p>
<p><h3>Java Development Kit</h3></p>
<p>React Native requires version 8 of the Java SE Development Kit (JDK). You may download and install <a href="http://openjdk.java.net">OpenJDK</a> from <a href="https://adoptopenjdk.net/">AdoptOpenJDK</a> or your system packager. You may also <a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">Download and install Oracle JDK 8</a> if desired.</p>
<p><block class="native mac linux windows android" /></p>
<p><h3>Android development environment</h3></p>
<p>Setting up your development environment can be somewhat tedious if you're new to Android development. If you're already familiar with Android development, there are a few things you may need to configure. In either case, please make sure to carefully follow the next few steps.</p>
<p><block class="native mac windows linux android" /></p>
<p><h4>1. Install Android Studio</h4></p>
<p><a href="https://developer.android.com/studio/index.html">Download and install Android Studio</a>. Choose a "Custom" setup when prompted to select an installation type. Make sure the boxes next to all of the following are checked:</p>
<p><block class="native mac windows android" /></p>
<ul>
<li><code>Android SDK</code></li>
<li><code>Android SDK Platform</code></li>
<li><code>Performance (Intel ® HAXM)</code> (<a href="https://android-developers.googleblog.com/2018/07/android-emulator-amd-processor-hyper-v.html">See here for AMD</a>)</li>
<li><code>Android Virtual Device</code></li>
</ul>
<p><block class="native linux android" /></p>
<ul>
<li><code>Android SDK</code></li>
<li><code>Android SDK Platform</code></li>
<li><code>Android Virtual Device</code></li>
</ul>
<p><block class="native mac windows linux android" /></p>
<p>Then, click "Next" to install all of these components.</p>
<blockquote>
<p>If the checkboxes are grayed out, you will have a chance to install these components later on.</p>
</blockquote>
<p>Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.</p>
<p><h4>2. Install the Android SDK</h4></p>
<p>Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the <code>Android 9 (Pie)</code> SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.</p>
<p>The SDK Manager can be accessed from the "Welcome to Android Studio" screen. Click on "Configure", then select "SDK Manager".</p>
<p><block class="native mac android" /></p>
<p><img src="/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png" alt="Android Studio Welcome"></p>
<p><block class="native windows android" /></p>
<p><img src="/docs/assets/GettingStartedAndroidStudioWelcomeWindows.png" alt="Android Studio Welcome"></p>
<p><block class="native mac windows linux android" /></p>
<blockquote>
<p>The SDK Manager can also be found within the Android Studio "Preferences" dialog, under <strong>Appearance & Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p>Select the "SDK Platforms" tab from within the SDK Manager, then check the box next to "Show Package Details" in the bottom right corner. Look for and expand the <code>Android 9 (Pie)</code> entry, then make sure the following items are checked:</p>
<ul>
<li><code>Android SDK Platform 28</code></li>
<li><code>Intel x86 Atom_64 System Image</code> or <code>Google APIs Intel x86 Atom System Image</code></li>
</ul>
<p>Next, select the "SDK Tools" tab and check the box next to "Show Package Details" here as well. Look for and expand the "Android SDK Build-Tools" entry, then make sure that <code>28.0.3</code> is selected.</p>
<p>Finally, click "Apply" to download and install the Android SDK and related build tools.</p>
<p><h4>3. Configure the ANDROID_HOME environment variable</h4></p>
<p>The React Native tools require some environment variables to be set up in order to build apps with native code.</p>
<p><block class="native mac linux android" /></p>
<p>Add the following lines to your <code>$HOME/.bash_profile</code> or <code>$HOME/.bashrc</code> config file:</p>
<p><block class="native mac android" /></p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_HOME</span>=<span class="hljs-variable">$HOME</span>/Library/Android/sdk
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">PATH</span>=<span class="hljs-variable">$PATH</span>:$ANDROID_HOME/emulator
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">PATH</span>=<span class="hljs-variable">$PATH</span>:$ANDROID_HOME/tools
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">PATH</span>=<span class="hljs-variable">$PATH</span>:$ANDROID_HOME/tools/bin
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">PATH</span>=<span class="hljs-variable">$PATH</span>:$ANDROID_HOME/platform-tools
</code></pre>
<p><block class="native linux android" /></p>
<pre><code class="hljs"><span class="hljs-builtin-name">export</span> <span class="hljs-attribute">ANDROID_HOME</span>=<span class="hljs-variable">$HOME</span>/Android/Sdk
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">PATH</span>=<span class="hljs-variable">$PATH</span>:$ANDROID_HOME/emulator
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">PATH</span>=<span class="hljs-variable">$PATH</span>:$ANDROID_HOME/tools
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">PATH</span>=<span class="hljs-variable">$PATH</span>:$ANDROID_HOME/tools/bin
<span class="hljs-builtin-name">export</span> <span class="hljs-attribute">PATH</span>=<span class="hljs-variable">$PATH</span>:$ANDROID_HOME/platform-tools
</code></pre>
<p><block class="native mac linux android" /></p>
<blockquote>
<p><code>.bash_profile</code> is specific to <code>bash</code>. If you're using another shell, you will need to edit the appropriate shell-specific config file.</p>
</blockquote>
<p>Type <code>source $HOME/.bash_profile</code> to load the config into your current shell. Verify that ANDROID_HOME has been added to your path by running <code>echo $PATH</code>.</p>
<blockquote>
<p>Please make sure you use the correct Android SDK path. You can find the actual location of the SDK in the Android Studio "Preferences" dialog, under <strong>Appearance & Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
</blockquote>
<p><block class="native windows android" /></p>
<p>Open the System pane under <strong>System and Security</strong> in the Windows Control Panel, then click on <strong>Change settings...</strong>. Open the <strong>Advanced</strong> tab and click on <strong>Environment Variables...</strong>. Click on <strong>New...</strong> to create a new <code>ANDROID_HOME</code> user variable that points to the path to your Android SDK:</p>
<p><img src="/docs/assets/GettingStartedAndroidEnvironmentVariableANDROID_HOME.png" alt="ANDROID_HOME Environment Variable"></p>
<p>The SDK is installed, by default, at the following location:</p>
<pre><code class="hljs css language-powershell">c:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk
</code></pre>
<p>You can find the actual location of the SDK in the Android Studio "Preferences" dialog, under <strong>Appearance & Behavior</strong> → <strong>System Settings</strong> → <strong>Android SDK</strong>.</p>
<p>Open a new Command Prompt window to ensure the new environment variable is loaded before proceeding to the next step.</p>
<p><h4>4. Add platform-tools to Path</h4></p>
<p>Open the System pane under <strong>System and Security</strong> in the Windows Control Panel, then click on <strong>Change settings...</strong>. Open the <strong>Advanced</strong> tab and click on <strong>Environment Variables...</strong>. Select the <strong>Path</strong> variable, then click <strong>Edit</strong>. Click <strong>New</strong> and add the path to platform-tools to the list.</p>
<p>The default location for this folder is:</p>
<pre><code class="hljs css language-powershell">c:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk\platform<span class="hljs-literal">-tools</span>
</code></pre>
<p><block class="native linux android" /></p>
<p><h3>Watchman</h3></p>
<p>Follow the <a href="https://facebook.github.io/watchman/docs/install#buildinstall">Watchman installation guide</a> to compile and install Watchman from source.</p>
<blockquote>
<p><a href="https://facebook.github.io/watchman/docs/install">Watchman</a> is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance and increased compatibility in certain edge cases (translation: you may be able to get by without installing this, but your mileage may vary; installing this now may save you from a headache later).</p>
</blockquote>
<p><block class="native mac ios" /></p>
<p><h2>Creating a new application</h2></p>
<p>Use the React Native command line interface to generate a new React Native project called "AwesomeProject":</p>
<pre><code class="hljs">react-<span class="hljs-keyword">native</span> <span class="hljs-keyword">init</span> AwesomeProject
</code></pre>
<p>This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see <a href="/docs/0.54/platform-specific-code">Platform Specific Code</a>). You can also use a third-party CLI to init your React Native app, such as <a href="https://github.com/infinitered/ignite">Ignite CLI</a>.</p>
<p><h3>[Optional] Using a specific version</h3></p>
<p>If you want to start a new project with a specific React Native version, you can use the <code>--version</code> argument:</p>
<pre><code class="hljs"><span class="hljs-selector-tag">react-native</span> <span class="hljs-selector-tag">init</span> <span class="hljs-selector-tag">AwesomeProject</span> <span class="hljs-selector-tag">--version</span> <span class="hljs-selector-tag">X</span><span class="hljs-selector-class">.XX</span><span class="hljs-selector-class">.X</span>
</code></pre>
<pre><code class="hljs">react-<span class="hljs-keyword">native</span> init AwesomeProject --version react-<span class="hljs-keyword">native</span><span class="hljs-meta">@next</span>
</code></pre>
<p><block class="native mac windows linux android" /></p>
<p><h2>Creating a new application</h2></p>
<p>Use the React Native command line interface to generate a new React Native project called "AwesomeProject":</p>
<pre><code class="hljs">react-<span class="hljs-keyword">native</span> <span class="hljs-keyword">init</span> AwesomeProject
</code></pre>
<p>This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see <a href="/docs/0.54/platform-specific-code">Platform Specific Code</a>). You can also use a third-party CLI to init your React Native app, such as <a href="https://github.com/infinitered/ignite">Ignite CLI</a>.</p>
<p><h3>[Optional] Using a specific version</h3></p>
<p>If you want to start a new project with a specific React Native version, you can use the <code>--version</code> argument:</p>
<pre><code class="hljs"><span class="hljs-selector-tag">react-native</span> <span class="hljs-selector-tag">init</span> <span class="hljs-selector-tag">AwesomeProject</span> <span class="hljs-selector-tag">--version</span> <span class="hljs-selector-tag">X</span><span class="hljs-selector-class">.XX</span><span class="hljs-selector-class">.X</span>
</code></pre>
<pre><code class="hljs">react-<span class="hljs-keyword">native</span> init AwesomeProject --version react-<span class="hljs-keyword">native</span><span class="hljs-meta">@next</span>
</code></pre>
<p><block class="native mac windows linux android" /></p>
<p><h2>Preparing the Android device</h2></p>
<p>You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.</p>
<p>Either way, you will need to prepare the device to run Android apps for development.</p>
<p><h3>Using a physical device</h3></p>
<p>If you have a physical Android device, you can use it for development in place of an AVD by plugging it in to your computer using a USB cable and following the instructions <a href="/docs/0.54/running-on-device">here</a>.</p>
<p><h3>Using a virtual device</h3></p>
<p>If you use Android Studio to open <code>./AwesomeProject/android</code>, you can see the list of available Android Virtual Devices (AVDs) by opening the "AVD Manager" from within Android Studio. Look for an icon that looks like this:</p>
<p><img src="/docs/assets/GettingStartedAndroidStudioAVD.png" alt="Android Studio AVD Manager"></p>
<p>If you have recently installed Android Studio, you will likely need to <a href="https://developer.android.com/studio/run/managing-avds.html">create a new AVD</a>. Select "Create Virtual Device...", then pick any Phone from the list and click "Next", then select the <strong>Pie</strong> API Level 28 image.</p>
<p><block class="native linux android" /></p>
<blockquote>
<p>We recommend configuring <a href="https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux">VM acceleration</a> on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.</p>
</blockquote>
<p><block class="native windows android" /></p>
<blockquote>
<p>If you don't have HAXM installed, click on "Install HAXM" or follow <a href="https://github.com/intel/haxm/wiki/Installation-Instructions-on-Windows">these instructions</a> to set it up, then go back to the AVD Manager.</p>
</blockquote>
<p><block class="native mac android" /></p>
<blockquote>
<p>If you don't have HAXM installed, follow <a href="https://github.com/intel/haxm/wiki/Installation-Instructions-on-macOS">these instructions</a> to set it up, then go back to the AVD Manager.</p>
</blockquote>
<p><block class="native mac windows linux android" /></p>
<p>Click "Next" then "Finish" to create your AVD. At this point you should be able to click on the green triangle button next to your AVD to launch it, then proceed to the next step.</p>
<p><block class="native mac ios" /></p>
<p><h2>Running your React Native application</h2></p>
<p>Run <code>react-native run-ios</code> inside your React Native project folder:</p>
<pre><code class="hljs">cd AwesomeProject
react-native <span class="hljs-keyword">run</span><span class="bash">-ios</span>
</code></pre>
<p>You should see your new app running in the iOS Simulator shortly.</p>
<p><img src="/docs/assets/GettingStartediOSSuccess.png" alt="AwesomeProject on iOS"></p>
<p><code>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't get this to work, see the <a href="/docs/0.54/troubleshooting#content">Troubleshooting</a> page.</p>
</blockquote>
<p><h3>Running on a device</h3></p>
<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/0.54/running-on-device">here</a>.</p>
<p><block class="native mac windows linux android" /></p>
<p><h2>Running your React Native application</h2></p>
<p>Run <code>react-native run-android</code> inside your React Native project folder:</p>
<pre><code class="hljs">cd AwesomeProject
react-native <span class="hljs-keyword">run</span><span class="bash">-android</span>
</code></pre>
<p>If everything is set up correctly, you should see your new app running in your Android emulator shortly.</p>
<p><block class="native mac android" /></p>
<p><img src="/docs/assets/GettingStartedAndroidSuccessMacOS.png" alt="AwesomeProject on Android"></p>
<p><block class="native windows android" /></p>
<p><img src="/docs/assets/GettingStartedAndroidSuccessWindows.png" alt="AwesomeProject on Android"></p>
<p><block class="native mac windows linux android" /></p>
<p><code>react-native run-android</code> is one way to run your app - you can also run it directly from within Android Studio.</p>
<blockquote>
<p>If you can't get this to work, see the <a href="/docs/0.54/troubleshooting#content">Troubleshooting</a> page.</p>
</blockquote>
<p><block class="native mac ios android" /></p>
<p><h3>Modifying your app</h3></p>
<p>Now that you have successfully run the app, let's modify it.</p>
<p><block class="native mac ios" /></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>
<p><block class="native mac android" /></p>
<ul>
<li>Open <code>App.js</code> in your text editor of choice and edit some lines.</li>
<li>Press the <code>R</code> key twice or select <code>Reload</code> from the Developer Menu (<code>⌘M</code>) to see your changes!</li>
</ul>
<p><block class="native windows linux android" /></p>
<p><h3>Modifying your app</h3></p>
<p>Now that you have successfully run the app, let's modify it.</p>
<ul>
<li>Open <code>App.js</code> in your text editor of choice and edit some lines.</li>
<li>Press the <code>R</code> key twice or select <code>Reload</code> from the Developer Menu (<code>Ctrl + M</code>) to see your changes!</li>
</ul>
<p><block class="native mac ios android" /></p>
<p><h3>That's it!</h3></p>
<p>Congratulations! You've successfully run and modified your first React Native app.</p>
<p><center><img src="/docs/assets/GettingStartedCongratulations.png" width="150"></img></center></p>
<p><block class="native windows linux android" /></p>
<p><h3>That's it!</h3></p>
<p>Congratulations! You've successfully run and modified your first React Native app.</p>
<p><center><img src="/docs/assets/GettingStartedCongratulations.png" width="150"></img></center></p>
<p><block class="native mac ios" /></p>
<p><h2>Now what?</h2></p>
<ul>
<li><p>Turn on <a href="/docs/0.54/debugging#reloading-javascript">Live Reload</a> in the Developer Menu. Your app will now reload automatically whenever you save any changes!</p></li>
<li><p>If you want to add this new React Native code to an existing application, check out the <a href="/docs/0.54/integration-with-existing-apps">Integration guide</a>.</p></li>
</ul>
<p>If you're curious to learn more about React Native, continue on to the <a href="/docs/0.54/tutorial">Tutorial</a>.</p>
<p><block class="native windows linux mac android" /></p>
<p><h2>Now what?</h2></p>
<ul>
<li><p>Turn on <a href="/docs/0.54/debugging#reloading-javascript">Live Reload</a> in the Developer Menu. Your app will now reload automatically whenever you save any changes!</p></li>
<li><p>If you want to add this new React Native code to an existing application, check out the <a href="/docs/0.54/integration-with-existing-apps">Integration guide</a>.</p></li>
</ul>
<p>If you're curious to learn more about React Native, continue on to the <a href="/docs/0.54/tutorial">Tutorial</a>.</p>
</span></div></article></div><div class="docs-prevnext"><a class="docs-next button" href="/docs/0.54/tutorial"><span>Learn the Basics</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><div><h5>Docs</h5><a href="/docs/getting-started">Getting Started</a><a href="/docs/tutorial">Tutorial</a><a href="/docs/components-and-apis">Components and APIs</a><a href="/docs/more-resources">More Resources</a></div><div><h5>Community</h5><a href="/help">The React Native Community</a><a href="/showcase">Who's using React Native?</a><a href="https://stackoverflow.com/questions/tagged/react-native" target="_blank">Ask Questions on Stack Overflow</a><a href="https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md">Contributor Guide</a><a href="https://dev.to/t/reactnative" target="_blank">DEV Community</a></div><div><h5>More Resources</h5><a href="/blog">Blog</a><a href="https://twitter.com/reactnative" target="_blank">Twitter</a><a href="https://github.com/facebook/react-native" target="_blank">GitHub</a><a href="https://reactjs.org" target="_blank">React</a></div></section><a href="https://code.facebook.com/projects/" target="_blank" class="fbOpenSource"><img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright">Copyright © 2020 Facebook Inc.</section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'1677033832619985',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
document.addEventListener('keyup', function(e) {
if (e.target !== document.body) {
return;
}
// keyCode for '/' (slash)
if (e.keyCode === 191) {
const search = document.getElementById('search_input_react');
search && search.focus();
}
});
</script><script>
var search = docsearch({
apiKey: '2c98749b4a1e588efec53b2acec13025',
indexName: 'react-native-versions',
inputSelector: '#search_input_react',
algoliaOptions: {"facetFilters":["tags:0.54"],"hitsPerPage":5}
});
</script></body></html>