gpt4 book ai didi

在特定设备上 React-Native run-android

转载 作者:行者123 更新时间:2023-12-03 11:32:24 25 4
gpt4 key购买 nike

是否可以使用 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

如果您真的需要这个,您可能希望将第一个片段包装到一个脚本中,您可以使用手机的标识符对其进行参数化。

关于在特定设备上 React-Native run-android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40725219/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com