โ๐ Native startup consist of React-Native UI and simple applications build using react native expo.
You are required to have the following:
[x] Nodejs [ ] Android Studio
- First you need to download the Java
11+
- To download
Java17
we are going to first make sure that you havechocolatey
installed in your computer. To check that run the following command:
choco --version
If you don't get the version number of chocolatey you can open cmd
as an admin and run the following command to install chocolatey
:
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command " [System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
- To Download
Java17
we will run the following command:
choco install openjdk17
-
The next thing is to install
Android Studio
- During the installation process make sure that Android Studio and Android Virtual Device are checked.
- after the installation is complete we need to install the sdk that is specific for react-native. To do that you need to open android studio go to
SDK Manager
under AndroidSDK
in theSDK Platform
tab. - Locate the
Android 12.0S
SDK and make sure that you check the following options and make sure you clickShow Package Details
and select the following: [x] Android SDK Platform [x] Intel x86 Atom_64 System Image - Go to the
SDK Tools
tab- on the bottom right conner make sure you select the checkbox named
Show Package Details
and go ahead and check the checkbox that says: [x]31.0.0
- on the bottom right conner make sure you select the checkbox named
- Go ahead and click the Apply Button
Wait for the installation to complete and then:
- Click the windows button and search for Environmental Variables.
- Click on Environmental Variables and then on the User Environmental Variables click on the New button and add the following:
Variable name
:ANDROID_HOME
Variable value
:C:\Users\<your_username>\AppData\Local\Android\Sdk
Note that
C:\Users\<your_username>\AppData\Local\Android\Sdk
is the path where yousdk
is located.
- Open
Powershell
and type the following command:
Get-ChildItem -Path Env:\
Then if we see our
ANDROID_HOME
environmental variable we are happy.
- Navigate to
platform-tools
which is located onC:\Users\<your_username>\AppData\Local\Android\Sdk\platform-tools
we want to add it in our Environmental Variables again. Locate theSystem variables
and inside that we will locate thePath
and click theEdit
button. ClickNew
button and add the following path:
`C:\Users\<your_username>\AppData\Local\Android\Sdk\platform-tools`
- If you have installed
react-native
CLI you are recommended to uninstall by running the following command:
npm uninstall -g react-native-cli @react-native-community/cli
- Open
Android Studio
and go toVirtual Device Manager
click onCreate Device
and you select the device that you want.
All done, now you can start android Emulator from the command line using commands like:
npm start android
# OR
yarn start android
These commands run when you have a react-native project that you want to run on an emulator.
You can start the emulator by navigating to:
cd C:\Users\%USERNME%\AppData\Local\Android\Sdk\emulator
Check the list of emulators that you have by running the following command:
emulator -list-avds
Then
emulator -avd <your amulator name>
# eg
emulator -avd Pixel_7_Pro