updated readme for local android setup
This commit is contained in:
parent
d4ae61bc6a
commit
76355136ea
@ -1,18 +1,18 @@
|
||||
# react native app setup (not using Expo)
|
||||
# REACT NATIVE CLI QUICKSTART, NOT EXPO GO QUICKSTART
|
||||
# follow setup guide for each specific platform (iOS or Android) and OS (Linux, Windows, MacOS): https://reactnative.dev/docs/environment-setup
|
||||
|
||||
# REACT NATIVE CLI QUICKSTART (NOT EXPO GO) QUICKSTART
|
||||
|
||||
# follow setup guide for each specific platform (iOS or Android) and OS (Linux, Windows, MacOS): [https://reactnative.dev/docs/environment-setup](https://reactnative.dev/docs/environment-setup "setup")
|
||||
|
||||
- make sure you have node and npm installed
|
||||
|
||||
- cd to directory where you want this app to be installed
|
||||
- create app:
|
||||
- create app (already accomplished, keeping for notes):
|
||||
|
||||
npx react-native@latest init SelahReactNativeApp
|
||||
`npx react-native@latest init SelahReactNativeApp`
|
||||
|
||||
- select yes for installing react-native packages
|
||||
|
||||
NOTE: some of the files might complain about not being able to detect the babel.config.js file. Add this to your
|
||||
settings.json file in VS Code (Open command pallete: View-> Command Pallete or Ctrl+Shift-P and type "settings"):
|
||||
NOTE: in VS Code some of the created files might show errors and complain about not being able to detect the `babel.config.js` file. Add this to your settings.json file in VS Code (Open command pallete: View-> Command Pallete or Ctrl+Shift-P and type "settings"):
|
||||
|
||||
```
|
||||
"eslint.workingDirectories": [
|
||||
@ -20,10 +20,27 @@ settings.json file in VS Code (Open command pallete: View-> Command Pallete or C
|
||||
]
|
||||
```
|
||||
|
||||
- to run the app, open a new terminal and start Metro which is the js bundler that ships with react native. cd into
|
||||
react-native app directory and run:
|
||||
Run the app (Android emulator)
|
||||
|
||||
npx react-native start
|
||||
- make sure your android emulator is running (running API 33 tiramisu per the react-native setup docs)
|
||||
- start Metro which is a js bundler that ships with react native. cd into react-native app directory and run:
|
||||
|
||||
- to start the app in an android device
|
||||
`npx react-native start`
|
||||
|
||||
select yes to install react-native packages
|
||||
|
||||
- let metro run in its own terminal. Open a new terminal to start the app in an android device:
|
||||
|
||||
`npx react-native run-android`
|
||||
|
||||
NOTE: if you get a `error: unknown command 'run-android'` try this command
|
||||
`npm install --save react-native`
|
||||
|
||||
and try again:
|
||||
|
||||
`npx react-native run-android`
|
||||
|
||||
You should have a running react-native app in Android!
|
||||
|
||||
|
||||
TODO: mac/iOS local setup...
|
||||
|
Loading…
Reference in New Issue
Block a user