Issue
Is it possible to use the run-android
command for one specific device only?
For example, if I have three devices (or emulators) connected and I want to use run-android
on only one of them?
Maybe something like adb install -s DEVICE_NUMBER
?
Thanks in advance
Solution
Elaborating on @alexander 's answer, you can use the following workflow:
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
In a different screen, run:
npm start # Will run the packager
If you really need this, you might want to wrap the first snippet into a script that you can parametrize with your phone's identifier.
Answered By - martinarroyo
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.