8

I've read through the thread below and come across 2 solutions for connecting a device with ADB.

https://stackoverflow.com/questions/4893953/android-run-install-debug-applications-over-wifi/19940301#19940301

The first is to use USB, and this isn't an option because the USB port is busted on my Droid Razr Maxx. The second is via wifi but using root permissions.. and I don't really want to root my phone.

Can't I use strict WiFi without root to set up ADB?

5
  • I don't believe you can. However, you can install applications from email attachments, websites which serve with the correct mime type, etc Jan 31, 2014 at 5:53
  • @bughi The USB port is busted and it could have been fixed if under warranty, and then you don't want to root. Is there a reason for not rooting the device?
    – Firelord
    Jul 22, 2015 at 12:35
  • @Firelord some devices Can't be rooted coughverizoncough.
    – Michael
    May 13, 2020 at 3:05
  • @ChrisStratton There are many reasons for using ADB besides installing applications
    – Michael
    May 13, 2020 at 3:06
  • @Michael of course there are other lesser reasons. But the literal name is "Android Debug Bridge" implying the primary use of installing and getting debug messages from apps being developed. A device with broken data connectivity on the USB port still retains the possibility of installing fresh builds of apps being developed by the other means of sideloading supported when "unkown sources" is enabled in settings. May 13, 2020 at 20:57

3 Answers 3

10
+50

I have not tried this myself, but there's an app named ADB Wireless (no root) which, as the name suggests, claims to make this possible without involving root:

This app is for developers wanting adb access over WiFi without rooting your phone.

*** NO ROOT REQUIRED ***

Usage instructions can be found on the app's playstore page – looks pretty easy and straight. And the permissions look phantastic: nothing that's not necessary or explainable. In fact, just a single one to view WiFi connections. So no ads or spyware to be expected ;)


Same to be said for an app called ADB Wireless (no-root) (yes, same name – different dev), which seems no longer maintained though (last release was 6/2013):

the first android application in the Google Play store to provide a wireless ADB connection without root.

Asks a few more permissions (a.o. full network), though.


Note however that all those non-root solutions seem to require a (USB) cable connection for initial setup – so there's probably nothing for your special case.


Conclusion:

No app for that if your USB port is busted. So unless you get your busted port repaired or root your device, I see no way to get ADB running wirelessly. As initialization requires more permission as any "standard user" on Android gets, there are no command-line tricks either unless you already have root access: the initialization via USB makes use of the ADB daemons elevated permissions, which are only accessible that way.

For other readers:

Initial phrasing of my answer omitted that fact, as the OP's USB port is broken/unusable: If your USB port is in working order, and you can use an USB cable to connect to it, you won't need any of those fancy enabler apps (see here for more) just to be able to use ADB wirelessly (though some might come in handy if they e.g. offer a plugin, so you could enable wireless ADB in your home network automatically and turn it off when you leave it). As Firelord pointed out in his commend, and Lucky linked to a post on SO, steps to enable wireless ADB are easy then:

  1. enable on your device
  2. connect your device to your computer via USB cable
  3. run adb tcpip <IP address>:<PORT> (e.g. adb tcpip 192.168.1.50:5555 – find the correct IP address in the wireless properties of your Android device) on your computer
  4. still on your computer, run adb connect <PORT> (e.g. adb connect 5555)
  5. unplug your USB cable, it no longer needs to be attached – ADB now runs via WiFi
8
  • 1
    +1 to that, but I think adb tcpip <PORT> -> adb connect IP:PORT -> adb shell can also be added. In fact, those non-root apps probably be doing the same thing.
    – Firelord
    Jul 22, 2015 at 14:38
  • @Firelord That might well be. But they cannot do so unless executing it with "elevated privileges" – either via root, or via the ADB daemon. So without root, that's a "chicken-and-egg" issue: you need ADB access to run those commands to get ADB access. IOW: in this specific situation, the answer is "no, not possible". Unless I've missed something – which I won't say is impossible, but at least unlikely.
    – Izzy
    Jul 22, 2015 at 14:43
  • @Izzy I just installed the first app and works fine as instructed in the Playstore description. I couldn't understand what this app used for. I know that we can run adb commands over wifi. In non-rooted phones it only works if we are connected via a usb-cable. Then how does this app named wireless? It will only make sense only if all the devices which are connected to this wifi can send adb commands via wifi to this device. Is this possible at all - just for clarification? ;)
    – Lucky
    Jul 22, 2015 at 15:06
  • And for developers the above apps uses the same concept mentioned in this answer from SO.
    – Lucky
    Jul 22, 2015 at 15:10
  • 1
    @Lucky that's what those apps are for (see here for more): Enabling the device to listen for ADB commands via WiFi. All devices connected to the same network then could issue an adb connect command followed by adb shell, adb install, or other ADB commands. Those apps are for nothing but starting the TCP/IP interface for ADB, which is disabled by default. So if your USB connection is working, you don't need any such app – but could simply use the commands from your linked SO post, correct.
    – Izzy
    Jul 22, 2015 at 15:10
1

If you've never connected your phone to the computer before, you may be out of luck. Since the later versions of 4.X, (I think at least JB 4.3), you must authorize the host computer to connect via ADB, which will popup the first time you connect with USB.

When using Wifi, this authorization MUST already be established, or it will not accept the ADB over Wifi connection.

1

This is now possible for devices running Android 11 or higher.

There's Wireless debugging menu under Developer options. The pairing is done using a 6-digit pairing code, or a QR code.

To use the pairing code:

  1. get the IP address, port and Wi-Fi pairing code from Developer options/Wireless debugging/Pair device with pairing code,
  2. Using a terminal, pair the device:
    adb pair IP:port pairing-code
    

You're now ready to connect. Get your port number from the Wireless debugging screen on your phone (beware, the connection port will most likely differ from the pairing one) and connect from the terminal:

adb connect IP:port

The menu options may be named slightly differently on your Android build. The ones above are from Android 11, running on Mi 9T with MIUI 12.1.1.0 installed.

If you prefer, you can also use the pairing interface from Android Studio. The instructions are here.

You will need platform-tools 32 or higher, for both options. At present it can be downloaded here.

You must log in to answer this question.