Windows 10 & React Native & Android
Windows 10 & React Native & Android
https://facebook.github.io/react-native/docs/getting-started
https://reactnative.cn/docs/getting-started.html
ANDROID_HOME
env
Android Virtual Device (AVD)
https://developer.android.com/studio/run/managing-avds.html
not running an AVD bug
solution
OK
H:\Android-SDK
sdk.dir = H:\Android-SDK
- Go to the
android/
directory of your react-native project - Create a file called
local.properties
with this line:
# macOS / Linux
sdk.dir = /Users/USERNAME/Library/Android/sdk
# Windows
sdk.dir = C:\\Users\\USERNAME\\AppData\\Local\\Android\\sdk
adb bug
PATH env bug
solutions
abd
# PATH
'adb' is not recognized as an internal or external command,
H:\Android-SDK\platform-tools
# global
setx PATH "%PATH%;C:\Program Files\android-sdk-windows\platform-tools"
# session
set PATH=%PATH%;C:\Program Files\android-sdk-windows\platform-tools
set PATH=%PATH%;H:\Android-SDK\platform-tools
Android
https://facebook.github.io/react-native/docs/getting-started
https://chocolatey.org/
https://github.com/chocolatey
https://www.python.org/downloads/release/python-2716/
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
# Node, Python2, JDK
$ choco install -y nodejs.install python2 jdk8
# ANDROID_HOME
# c:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk
$ H:\Android-SDK\platform-tools
Android 9 (Pie)
relaod
⌘ + M
& Ctrl+M
-
manually reload
-
auto reload
-
hot reload
https://facebook.github.io/react-native/docs/debugging#reloading-javascript
https://facebook.github.io/react-native/docs/debugging#enabling-keyboard-shortcuts
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/10757612.html
未经授权禁止转载,违者必究!