The React Native simulator is easy to configure
Something to install
node.js
The node version should be larger than 12. Official website nodejs.org/zh-cn/ No brain the next step is
Example Modify the mirror source of NPM
npm config set registry https://registry.npm.taobao.org
Copy the code
yran
Tools that replace NPM and are faster than NPM
npm install -g yarn
Copy the code
The React – native scaffold
npm install -g react-native-cli
Copy the code
JDK
The address www.oracle.com/java/techno…
1.8 must be installed. 1.9 or later is not supported.
Download need to register, registration is good, too trouble to find another network disk resources
Configure environment variables – find another article
Android Studio
Address developer. The android. Google. Cn/studio /
Download, install brainless next step
Go to Android 10(Q) and check the boxes below
-
Android SDK Platform29
-
Intel x86 Atom_64 System Image
The second is the official emulator image file, not using the emulator or official emulator can not select
Move on…
Configuring environment Variables
Find the SDK location here by default
C:\Users\ user name \AppData\Local\Android\SdkCopy the code
Add four to the system variable Path
%ANDROID_HOME%\platform-tools
%ANDROID_HOME%\emulator
%ANDROID_HOME%\tools
%ANDROID_HOME%\tools\bin
Copy the code
The simulator
Add equipment
Select a device
next
Download the first one, I’ve already downloaded it on my side…
Double-click to run the emulator
There should be a phone on the screen
If adb is not a command, the simulator is not enabled. If ADB is not a command, the SDK environment variable is configured incorrectly
Create the React Native project
NPX React-native Init Project nameCopy the code
You can use vscode to open the directory
run
Yarn Android or YARN React-native run-AndroidCopy the code
Open the emulator – the following screen is displayed
To this end
Summary: Android SDK and Android Studio installation and emulator configuration is relatively complex, it is recommended to take time, as well as the configuration of environment variables, do not rush