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.
Step 1 :- Enable Android Debug Bridge (ADB) in BlueStacks :- Go to Settings / Preferences and Scroll Down to last and you find the ADB option. Just Enable it.
In BlueStacks, at the top right, click the Gear, Settings, Preferences, and enable "USB Debugging".
Open a command window in the folder by holding shift and right-clicking in an empty spot in the folder and selecting "Open command prompt/PowerShell here" in the menu. Then you can start using ADB — connect your phone and try . ADB devices to see if it's working. A list with attached devices should show up.
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.
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.
[
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With