How do you adb to bluestacks 4?

后端 未结 3 1867
名媛妹妹
名媛妹妹 2020-12-17 16:37

I\'d like to connect to android emulator on bluestacks 4 with adb. but I\'ve got an error with adb.exe -s emulator-5554 shell

checking devices.

<
相关标签:
3条回答
  • 2020-12-17 17:17

    And I have test bluestack 4 in windows 10 and enable the adb permission in bluestacks 4 settings. It works for me.

    0 讨论(0)
  • 2020-12-17 17:26

    First, in Bluestacks, go to Settings -> Preferences -> Enable Android Debug Bridge (ADB). Like this:

    At this point, Bluestacks enables its adb functionality and exposes itself to the localhost at port 5555 (the default port)

    So, in your command line, type adb connect localhost:5555 and you should be good to go.

    0 讨论(0)
  • 2020-12-17 17:36

    I did exactly as the chosen approved answer but i still could not connect my android studio to Bluestack 4. Hence i think the problem both of us are encountering could be due to bluestack device ip has changed. (Even if you had detect the device using adb devices command earlier on). Each time i open up my bluestack emulator, i notice that its ip is always different. Hence that could be one of the reason why you could not add adb to bluestack4.

    The following step works for me. I am using windows 10, Android Studio 4.0.1, Bluestacks 4.200.

    1. find your android studio sdk platform tool folder. For me its is custom installed in my D drive. for example-> D:\AppData\Local\Android\Sdk\platform-tools
    2. right click on adb.exe and run as administrator. (click on yes if a pop up ask if you would like to make changes to your devices. After that you would only see another pop up that suddenly disappear.)
    3. open Bluestacks. Run your selected emulator (samsung/pixel etc). Ensure that you have enable "Enable Android Debug Bridge (ADB) in the emulator preferences.
    4. open command prompt. cd to your platform tools folder path.
    5. enter the following command->adb connect xxxxxxxxxxx where xxxxxx is your device localhost ip. (see attach pic. My device ip is 127.0.0.1:xxxxx hence my command is ->adb connect 127.0.0.1:xxxxx
    6. continue with the following command->adb devices
      you would see your bluestack emulator device. same ip listed.
    7. open your andriod studio. you would be able to see your bluestack emulator

    [enter bluestack adb preferences1

    0 讨论(0)
提交回复
热议问题