7

I would like to know is it possible to connect Android Studio Debugger through the network. Currently I generate an APK on the computer 1, I push on the network and I use adb to install it.

Now I would like to use the debugger on my Android Studio, so I would like is it possible to connect Android Studio on an ADB installed on an another computer? If yes, do you have a tutorial?

I created a schema for a better understanding :

(I don't want use ADB on my Computer 1)

Shema of my situation

Thanks

1 Answer 1

21

IMHO, I think of course you can do remote ADB and remote debugging, but you have to have ADB installed. (if you have Android Studio installed on Computer 1, I guess you also have Android SDK there, then ADB is there as well: $ANDROID_SDK/platform-tools/adb)

You can forget about Computer 2.

Precondition:

  • Computer 1 has Android Studio and Android SDK
  • Android Device has enabled Developer options -> USB debugging (no root required)

Steps:

  1. Connect device to computer via USB

  2. Run adb tcpip 5555 (you'll see restarting in TCP mode port: 5555)

  3. Find your device's IP address (assume it's 192.168.1.101), then run adb connect 192.168.1.101:5555 (it should say connected to 192.168.1.101:5555)

  4. Disconnect device from USB (so now it's remote connected via tcpip)

5
  • Thanks for your reply, in fact, I need the second computer because this computer communicates with the tablet automaticly. For exemple, the computer listens someone said something and it interacts via ADB (with intent etc..). I can't remove tablet from computer. In fact, isn't really a computer, but a machine.
    – Ben44
    Commented Oct 15, 2015 at 13:32
  • ADB on the "second computer" works fine, and I would like "to connect" my Android Studio Debugger at this ADB (from my computer 1)
    – Ben44
    Commented Oct 15, 2015 at 13:37
  • 1
    You're welcome. I totally understand that everybody has his own reason. But if you want to debug remotely, you have to setup the adb connection between the debug computer and the device (later on you can connect the device to whatever computer via USB). If you connect the device to your computer 2 via adb, you can still ssh from computer 1 to computer 2 to grab adb outputs of device, but you won't make remote debugging with Android Studio work out of the box.
    – Jing Li
    Commented Oct 15, 2015 at 13:48
  • Okay, this is reasonable for the given question but what if I have a VPN in the mix? I am trying to run Android Studio on my PC at home and connect to it with my laptop using Windows Remote Access. The Laptop is in a VPN with the PC, the PC is running AS and the laptop has the debugging device attached. The tcpip solution sadly doesn't work if the phone is in the VPN so I need an alternative solution to this.
    – Emil S.
    Commented Nov 6, 2018 at 17:27
  • Thanks for the explanation. Just wanted to add that you should execute $ adb usb to disable ADB over the network. Commented Jun 4, 2019 at 18:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.