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: example/README.md
+41-24
Original file line number
Diff line number
Diff line change
@@ -1,58 +1,75 @@
1
1
# Getting Started
2
2
3
-
>[!IMPORTANT]
4
-
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.
3
+
> **Note**: Make sure you have completed the [Set Up Your Environment](https://reactnative.dev/docs/set-up-your-environment) guide before proceeding.
5
4
6
-
## Step 1: Start the Metro Server
5
+
## Step 1: Start Metro
7
6
8
-
First, you will need to start**Metro**, the JavaScript _bundler_ that ships _with_ React Native.
7
+
First, you will need to run**Metro**, the JavaScript build tool for React Native.
9
8
10
-
To start Metro, run the following command from the _root_ of your React Native project:
9
+
To start the Metro dev server, run the following command from the root of your React Native project:
11
10
12
-
```bash
13
-
#using npm
11
+
```sh
12
+
#Using npm
14
13
npm start
15
14
16
15
# OR using Yarn
17
16
yarn start
18
17
```
19
18
20
-
## Step 2: Start your Application
19
+
## Step 2: Build and run your app
21
20
22
-
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:
21
+
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:
23
22
24
-
### For Android
23
+
### Android
25
24
26
-
```bash
27
-
#using npm
25
+
```sh
26
+
#Using npm
28
27
npm run android
29
28
30
29
# OR using Yarn
31
30
yarn android
32
31
```
33
32
34
-
### For iOS
33
+
### iOS
35
34
36
-
```bash
37
-
# using npm
35
+
For iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps).
36
+
37
+
The first time you create a new project, run the Ruby bundler to install CocoaPods itself:
38
+
39
+
```sh
40
+
bundle install
41
+
```
42
+
43
+
Then, and every time you update your native dependencies, run:
44
+
45
+
```sh
46
+
bundle exec pod install
47
+
```
48
+
49
+
For more information, please visit [CocoaPods Getting Started guide](https://guides.cocoapods.org/using/getting-started.html).
50
+
51
+
```sh
52
+
# Using npm
38
53
npm run ios
39
54
40
55
# OR using Yarn
41
56
yarn ios
42
57
```
43
58
44
-
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.
59
+
If everything is set up correctly, you should see your new app running in the Android Emulator, iOS Simulator, or your connected device.
60
+
61
+
This is one way to run your app — you can also build it directly from Android Studio or Xcode.
45
62
46
-
This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
63
+
## Step 3: Modify your app
47
64
48
-
## Step 3: Modifying your App
65
+
Now that you have successfully run the app, let's make changes!
49
66
50
-
Now that you have successfully run the app, let's modify it.
67
+
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).
51
68
52
-
1. Open `App.tsx` in your text editor of choice and edit some lines.
53
-
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!
69
+
When you want to forcefully reload, for example to reset the state of your app, you can perform a full reload:
54
70
55
-
For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!
71
+
-**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).
72
+
-**iOS**: Press <kbd>R</kbd> in iOS Simulator.
56
73
57
74
## Congratulations! :tada:
58
75
@@ -61,11 +78,11 @@ You've successfully run and modified your React Native App. :partying_face:
61
78
### Now what?
62
79
63
80
- 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).
64
-
- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
81
+
- If you're curious to learn more about React Native, check out the [docs](https://reactnative.dev/docs/getting-started).
65
82
66
83
# Troubleshooting
67
84
68
-
If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
85
+
If you're having issues getting the above steps to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
0 commit comments