How do you adb to bluestacks 4?

半腔热情 提交于 2019-12-07 06:24:27

问题


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.

$ adb.exe devices
List of devices attached
BH901...      device
CB512...      unauthorized





emulator-5554   device

once I shutdown bluestacks window, the emulator-5554 will be hidden from above command's result. thus I think emulator-5554 means bluestacks.

then commnad as below to use adb.

$ adb.exe -s emulator-5554 shell
error: closed

but as you know, an error occured.


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/54317727/how-do-you-adb-to-bluestacks-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!