0

Is there any way to connect adb over wifi with my android phone. I don't have any USB cable, as there is way to do this like here:- link

But for doing this i need to connect my phone to pc with USB first but my mobile has some problem it was not connecting to my pc with USB so any way to do it without using usb.

Mukesh Gupta
  • 1,373
  • 3
  • 17
  • 42
  • Possible duplicate of [How can I connect to Android with ADB over TCP?](http://stackoverflow.com/questions/2604727/how-can-i-connect-to-android-with-adb-over-tcp) – Alex P. Aug 03 '16 at 14:45
  • There is no particular correct answer, i already tried there. – Mukesh Gupta Aug 03 '16 at 15:42

4 Answers4

1

you either need to have a device connected or a running emulator for using following command:

adb tcpip 5555

what if you don't have usb cable for some reason? what to do? here's a solution. If you run an android emulator, above command will work but draw back is , it take too much time (few minutes to be specific).

So what's the fastest solution,

Well, install AnBox. Its also an emulator which opens much faster, within few seconds. now, you can run above command:

adb tcpip 5555 

to start adb in tcpip mode

use below command to connect to your android phone over wifi

adb connect <ip address of android phone>:5555 

if you want to control it over wifi from laptop use scrcpy

scrcpy -s <ip address of android phone>:5555
1

With the launch of Android Studio Bumblebee (2021.1.1), a new feature ADB over Wi-Fi is included, to simplify flow to connect to your Android 11 and higher devices over Wi-Fi for deployment and debugging using ADB. After you enable debugging over Wi-Fi on your device, select the Pair using Wi-Fi action in the Physical tab of the new Device Manager to open the pairing wizard. Then follow the steps provided to pair to a device connected over the same network. To learn more.

lbarqueira
  • 1,101
  • 1
  • 10
  • 28
0

Yes you can. But to do this you need a rooted android device. After that simply download Wifi adb from google play store. Link given below

https://play.google.com/store/apps/details?id=com.ttxapps.wifiadb&hl=en

Then go to your sdk folder/platform tools in the command prompt. Then type adb connect 192.168.xx.xx:xxxx , where xx is the no. shown in the Wifi ADB app. That's it. We also use it as Most of the times USB cables get worn after some usage.

Nick Asher
  • 726
  • 5
  • 19
0

make sure you have installing your device driver and adb service and

1- is activated USB debugging in android device

setting -> (system)-> developer options -> USB debugging and must be could to see your device when you connected by USB port ( by this command : adb devices)

so when you connected by USB follow this Commands :

2- in some android versions need to select Transfer File option in the Use USB To from Connected devices

1-stay connect via USB
2-connect to your WIFI network (computer and mobile device both)
3-ping DeviceIP (must be have ping to your device)

4 - adb kill-server
5 - adb usb
6 - adb tcpip 5556 (if you are using docker container it may need different port number like 5037)
7 - adb connect "yourDeviceIP:5556"
8 - devices (must be see two device names , one of them is by deviceIP:5556)
9-unplug USB cable

then it's Done! and you could to test your app

ref: JDev answer

Vahab
  • 307
  • 4
  • 7
  • some examples to ping DeviceIP in linux: https://linuxhint.com/ping_command_ubuntu_20-04/ – Vahab Nov 02 '21 at 12:24