How to connect to adb over wifi
Back to the overviewIn some cases it might be required to get adb access to your phone without plugging in a cable:
- Charging port is in bad shape
- The data cable is broken
- The cable is in another room and you are a couch-potato
- …
Important: Make sure no device is connected to your computer via cable,
otherwise any command used after connection won’t get through to the correct device
For your phone running LineageOS 18.1
On your phone
- Go to the developer settings
- Press
Enable Wireless debugging
- Select
Pair device with pairing code
You will see a dialog showing you IP address, port and a code.
On your computer
- Open a command line window
- Type
adb pair <ip>:<port>
and replace<ip>
andport
with the data seen on the phone - You will be asked for the pairing code. Type it in and hit
Enter - You will now see an output similar to
Successfully paired to <ip>:<port>
Additionally you will get a notification on your device.
Note: This method is supported natively since Android 11.
For your phone running LineageOS 17.1 or lower
On your phone
- Pull down the status bar menu (full expansion)
- Press the small pencil-icon to edit your QS tile
- Find the “Adb over Network” tile and drag it to the area on top
- Connect to the same wifi network as your computer
- Activate the tile by pressing it once
You will now see the device’s IP adress below the tile which you’ll need for the next step
On your computer
- Open a command line window
- Type
adb connect <ip>:5555
and replace<ip>
with the one you see on the QS tile - You will get an output similar to
connected to <ip>:5555
To disconnect, you simply type adb disconnect
.
Please note that after a command that might interrupt the connection, like adb root
you need
to disconnect and reconnect using the commands above before you can successfully communicate with
the device again.