You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-23
Original file line number
Diff line number
Diff line change
@@ -2,58 +2,76 @@ This is a new [**React Native**](https://reactnative.dev) project, bootstrapped
2
2
3
3
# Getting Started
4
4
5
-
> **Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
5
+
> **Note**: Make sure you have completed the [Set Up Your Environment](https://reactnative.dev/docs/set-up-your-environment) guide before proceeding.
6
6
7
-
## Step 1: Start the Metro Server
7
+
## Step 1: Start Metro
8
8
9
-
First, you will need to start**Metro**, the JavaScript _bundler_ that ships _with_ React Native.
9
+
First, you will need to run**Metro**, the JavaScript build tool for React Native.
10
10
11
-
To start Metro, run the following command from the _root_ of your React Native project:
11
+
To start the Metro dev server, run the following command from the root of your React Native project:
12
12
13
-
```bash
14
-
#using npm
13
+
```sh
14
+
#Using npm
15
15
npm start
16
16
17
17
# OR using Yarn
18
18
yarn start
19
19
```
20
20
21
-
## Step 2: Start your Application
21
+
## Step 2: Build and run your app
22
22
23
-
Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app:
23
+
With Metro running, open a new terminal window/pane from the root of your React Native project, and use one of the following commands to build and run your Android or iOS app:
24
24
25
-
### For Android
25
+
### Android
26
26
27
-
```bash
28
-
#using npm
27
+
```sh
28
+
#Using npm
29
29
npm run android
30
30
31
31
# OR using Yarn
32
32
yarn android
33
33
```
34
34
35
-
### For iOS
35
+
### iOS
36
36
37
-
```bash
38
-
# using npm
37
+
For iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps).
38
+
39
+
The first time you create a new project, run the Ruby bundler to install CocoaPods itself:
40
+
41
+
```sh
42
+
bundle install
43
+
```
44
+
45
+
Then, and every time you update your native dependencies, run:
46
+
47
+
```sh
48
+
bundle exec pod install
49
+
```
50
+
51
+
For more information, please visit [CocoaPods Getting Started guide](https://guides.cocoapods.org/using/getting-started.html).
52
+
53
+
```sh
54
+
# Using npm
39
55
npm run ios
40
56
41
57
# OR using Yarn
42
58
yarn ios
43
59
```
44
60
45
-
If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.
61
+
If everything is set up correctly, you should see your new app running in the Android Emulator, iOS Simulator, or your connected device.
62
+
63
+
This is one way to run your app — you can also build it directly from Android Studio or Xcode.
46
64
47
-
This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
65
+
## Step 3: Modify your app
48
66
49
-
## Step 3: Modifying your App
67
+
Now that you have successfully run the app, let's make changes!
50
68
51
-
Now that you have successfully run the app, let's modify it.
69
+
Open `App.tsx` in your text editor of choice and make some changes. When you save, your app will automatically update and reflect these changes — this is powered by [Fast Refresh](https://reactnative.dev/docs/fast-refresh).
52
70
53
-
1. Open `App.tsx` in your text editor of choice and edit some lines.
54
-
2. For **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Developer Menu** (<kbd>Ctrl</kbd> + <kbd>M</kbd> (on Window and Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (on macOS)) to see your changes!
71
+
When you want to forcefully reload, for example to reset the state of your app, you can perform a full reload:
55
72
56
-
For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!
73
+
-**Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Dev Menu**, accessed via <kbd>Ctrl</kbd> + <kbd>M</kbd> (Windows/Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (macOS).
74
+
-**iOS**: Press <kbd>R</kbd> in iOS Simulator.
57
75
58
76
## Congratulations! :tada:
59
77
@@ -62,11 +80,11 @@ You've successfully run and modified your React Native App. :partying_face:
62
80
### Now what?
63
81
64
82
- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
65
-
- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
83
+
- If you're curious to learn more about React Native, check out the [docs](https://reactnative.dev/docs/getting-started).
66
84
67
85
# Troubleshooting
68
86
69
-
If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
87
+
If you're having issues getting the above steps to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
0 commit comments