11

I've read quite a few posts already on adb and tcpip mode and I can create a wireless adb connection, but only when USB debugging is on.

The way I'm using it is like so:

  1. USB debugging is enabled
  2. call adb tcpip on the computer (switches from usb to tcpip mode with default port 5555)
  3. call adb connect PHONE_IP and a connection is made

The above works with or without the usb cable being connected, but only when the USB debugging option is ticked in Developer Options on the Android device. As soon as I untick the option, the tcp connection is lost and cannot be re-established until re-enabling the USB debugging option.

The problem is I'm getting started with a IOIO OTG device and I need to disable USB debugging to use the IOIO as an Accessory Device. It would be really useful if I can use the IOIO and debug with adb at the same time.

I'm using Android 4.1.2 (API 16) on the device. I can use two devices, both using the same OS version, one rooted, one un-rooted.

Is it possible to use adb in tcpip mode without USB debugging enabled ? If so, how ?

George Profenza
  • 50,687
  • 19
  • 144
  • 218

1 Answers1

6

On your rooted device, install a Terminal Emulator

enter "su" and then "start adbd" (source)

I have tried this on my rooted Android 4.0.4 device. I could connect normally without enabling USB debugging. A few more words:

  • "USB Debugging" is actually called "enable_adb" internally.
  • If you enable USB Debugging this usually happens(little device dependant):
  • a Settings.Secure value is stored (ADB_ENABLED)
  • (on some devices also a system property is set)
  • the adb deamon is started

If the UsbManager just checks for the Secure Setting, everything should work. If it checks for the actual running deamon you are out of luck.

Community
  • 1
  • 1
Robin Gawenda
  • 559
  • 5
  • 21
  • Thanks for the hints(+1). However I could do with a few more explanations. I'm using a rooted phone with Android 4.1.2 and have tried running `su` then `start adbd` and when I ran `adb tcpip` on the computer initially it started the service on port 14 (unusual), but couldn't connect to the ip (when I passed just the ip, adb connect defaulted to 5555). The problem is I couldn't establish an adb connection even after enabling USB debugging. I could not establish a connection either with USB or TCPIP and had to reboot the phone to get past this issue. Can you provide more detailed steps ? – George Profenza Nov 01 '13 at 20:25
  • try getprop | grep "adb" Is the tcp port configured to 5555? The value may reset on your phone when USB Debugging is turned off http://stackoverflow.com/a/3623727/1257591 – Robin Gawenda Nov 04 '13 at 11:29
  • 3
    To add to the existing answer, Ideally ```adbd``` would be restarted: ```setprop service.adb.tcp.port 5555``` then ```stop adbd && start adbd```. This can be set to run a reboot using a [build.prop editor](https://play.google.com/store/apps/details?id=com.jrummy.apps.build.prop.editor) – George Profenza Aug 28 '16 at 18:37