React-Native run-android on specific device

后端 未结 5 442
时光说笑
时光说笑 2021-02-01 14:13

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

5条回答
  •  说谎
    说谎 (楼主)
    2021-02-01 15:06

    In our experience:

    To list AVDs:

    $ANDROID_HOME/tools/emulator -list-avds

    To run a specific emulator: use the -avd flag

    $ANDROID_HOME/tools/emulator -avd Pixel_API_28_AOSP

    To run React Native in the currently-running emulator:

    react-native run-android

    To choose between multiple running emulators: (per this answer)

    adb devices
    react-native run-android --deviceId=DEVICE_ID
    

提交回复
热议问题