是否可以仅对一个特定设备使用run-android
命令?
例如,如果我连接了三个设备(或模拟器),并且只想在其中一个设备上使用run-android
?
大概adb install -s DEVICE_NUMBER
块吧?
提前谢谢
是否可以仅对一个特定设备使用run-android
命令?
例如,如果我连接了三个设备(或模拟器),并且只想在其中一个设备上使用run-android
?
大概adb install -s DEVICE_NUMBER
块吧?
提前谢谢
详细说明@alexander的答案,您可以使用以下工作流:
cd android
./gradlew assembleDebug # assembleRelease for release builds
adb install -s <yourdevice> app/build/outputs/apk/yourapk.apk # You can check the identifier for your device with adb devices
adb reverse tcp:8081 tcp:8081 Will forward the phone's 8081 port to the computer's 8081, where the packager listens. If you are deploying over Wi-Fi, have a look at: https://facebook.github.io/react-native/docs/running-on-device-android.html#configure-your-app-to-connect-to-the-local-dev-server-via-wi-fi
在另一个屏幕中,运行:
npm start # Will run the packager
如果你真的需要这个,你可能想把第一个片段包装成一个脚本,你可以用你手机的标识符参数化.