Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ADB Bluestacks - Connect 2 PC

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.

like image 873
theapache64 Avatar asked Jun 21 '15 08:06

theapache64


People also ask

Can you use ADB with BlueStacks?

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.

What is Android Debug Bridge BlueStacks?

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.

How do I disable USB debugging on BlueStacks?

In BlueStacks, at the top right, click the Gear, Settings, Preferences, and enable "USB Debugging".

How can I use BlueStacks as an emulator in Visual Studio code?

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.


1 Answers

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 :)

like image 77
Pedro Lobito Avatar answered Sep 24 '22 13:09

Pedro Lobito