I've two PCs, say PC1 and PC2. I've Bluestacks installed in PC1 and I've Android Studio Installed in PC2. So my question is : "Is it possible to connect to the Bluestacks emulator through the ADB installed in PC2 ?" So that I can install the application from PC1 to PC2's bluestacks.
NOTE: PC1 and PC2 are on the same network.
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.
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.
In BlueStacks, at the top right, click the Gear, Settings, Preferences, and enable "USB Debugging".
Just open bluestacks and go to settings. Then go to preferences and tick the checkbox just beside the option enable Android Debug Bridge(ADB). Then if you open Visual Studio Code and search for devices you will find bluestacks android emulator in the list of devices. Save this answer.
To connect an adb
hosted on a remote computer to a Bluestacks
running on the local computer, you can try.:
The problem:
Bluestacks listens on the localhost interface only (localhost
, 127.0.0.1
), it doesn't listen on ex: 192.168.1.4
. Based on this, and at first, you cannot connect remotely to Bluestacks using ADB
.
The solution:
Internal Port forwarding
How to:
1 - Download trivial_portforward.zip | mirror
2 - On the computer running Bluestacks, run:
trivial_portforward.exe 9999 127.0.0.1 5555
//usage: portforward [port to listen on] [ip of host to connect to] [port to connect to].
3 - On the computer running Eclipse or Android Studio, run:
adb connect 192.168.1.4:9999
//Connected to 192.168.1.4 9999
(change to the ip of the computer running Bluestacks)
That's it.
Notes:
Make sure the firewall isn't blocking outgoing/incoming connections on both computers.
I've tested deploying an application and it works :)
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