121

I'm able to connect to my phone using adb connect, and I can adb shell also.

But when I go to Run->Device Chooser, there are no devices there.

What should I do to connect my (connected) adb Android Studio?

When I plug it in through USB, it shows up on the list

manfcas
  • 1,933
  • 7
  • 28
  • 47
John
  • 2,015
  • 5
  • 23
  • 37
  • What is listed when you do adb devices in the console? – Nitro Nov 18 '15 at 20:54
  • 192.168.2.4:5555 device – John Nov 18 '15 at 22:07
  • It works with Android studio 1.5 RC here, so not sure whats wrong. Only thing that I could suggest it try to it once more with setting up. 1) adb kill-server 2) Then do the steps to connect again.. If not it also exist a plugin which I have not tried that might help https://github.com/pedrovgs/AndroidWiFiADB/issues – Nitro Nov 18 '15 at 22:35
  • @John is this device have some specific usb driver?If yes then, just try to re-install driver and kill adb may be it will help you! – Bhavin Chauhan Nov 24 '15 at 04:10
  • please Read this page [link](http://stackoverflow.com/questions/4893953/run-install-debug-android-applications-over-wi-fi#) Described Run/install/debug Android applications over Wi-Fi – M.Ganji Oct 16 '16 at 18:18
  • Possible duplicate of [How can I connect to Android with ADB over TCP?](https://stackoverflow.com/questions/2604727/how-can-i-connect-to-android-with-adb-over-tcp) – Zoe Jun 09 '17 at 14:16
  • Does this answer your question? [Run/install/debug Android applications over Wi-Fi?](https://stackoverflow.com/questions/4893953/run-install-debug-android-applications-over-wi-fi) – Top-Master Aug 09 '23 at 18:22

21 Answers21

137

You can find the adb tool in /platform-tools/

cd Library/Android/sdk/platform-tools/

You can check your devices using:

./adb devices

My result:

List of devices attached
XXXXXXXXX   device

Set a TCP port:

./adb shell setprop service.adb.tcp.port 4444

./adb tcpip 4444

Result message:

restarting in TCP mode port: 4444

To init a wifi connection you have to check your device IP and execute:

./adb connect 192.168.0.155:4444
starball
  • 20,030
  • 7
  • 43
  • 238
anthorlop
  • 1,771
  • 1
  • 11
  • 11
  • 6
    *I'm able to connect to my phone using adb connect, and I can adb shell also.* I got this far. Android Studio just doesn't pick it up – John Nov 24 '15 at 19:22
  • Adb connection Error:EOF – Ruchir Baronia Nov 11 '16 at 22:54
  • 1
    +1, got it working, thanks! But wow, now I know I'll go back to the cable. Debugging (from Visual Studio) over WiFi was abominably slow to deploy, slow to run, and slow to shut down. :) – JMD Mar 17 '17 at 20:58
  • @john try connecting to your android device using adb ip:port and you'll see it on android studio device picker – M at Oct 05 '17 at 19:42
  • unable to connect to 192.168.3.110:4444: cannot connect to 192.168.3.110:4444: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060) – Nirav Joshi Mar 23 '18 at 06:26
  • google documentation for this: https://developer.android.com/guide/topics/connectivity/usb/#debug-considerations – MoralCode May 03 '21 at 02:52
70

If your Android phone OS version 11 or above

Try this

https://developer.android.com/studio/command-line/adb#connect-to-a-device-over-wi-fi-android-11+

Android 10 and below phones

Step 1: Goto your Android sdk folder -> platform tools and copy the whole path

For example: C:\Program Files (x86)\Android\android-sdk\platform-tools

Step 2: Goto command prompt or Android studio terminal

windows users cd C:\Program Files (x86)\Android\android-sdk\platform-tools

Mac Users /Users/<username>/Library/Android/sdk/platform-tools

and press enter

Step 3: Connect your device & system with same wifi.

Step 4: Type adb tcpip 5555 and press Enter.

Step 5: Type adb connect x.x.x.x:5555, replacing the x.x.x.x with your phone IP address.

find out phone IP address

Settings -> About phone -> Status (some phones may be vary)

Note: In case that you connect more than one device, disconnect other phones except the one you need to connect.

Command prompt screen shot: enter image description here

For mac users -> if you face "adb command not found error" try this link

https://stackoverflow.com/a/50017193/3879847

Ranjithkumar
  • 16,071
  • 12
  • 120
  • 159
60

Try below android studio plugin

Android WiFi ADB

HOW TO

  1. Connect your device to your computer using a USB cable.
  2. Then press the button picture of a button to be pressed on the toolbar and disconnect your USB once the plugin connects your device over WiFi.
  3. You can now deploy, run and debug your device using your WiFi connection.

Github Link: https://github.com/pedrovgs/AndroidWiFiADB

NOTE: Remember that your device and your computer have to be in the same WiFi connection.

Sergiy Belozorov
  • 5,856
  • 7
  • 40
  • 73
pRaNaY
  • 24,642
  • 24
  • 96
  • 146
  • 1
    It works nice, but its a little bit slower, plus not logging logs from the package. Its that normal? – oreofeolurin Jun 11 '17 at 22:16
  • 1
    is it that I have to connect by usb everytime ? or there's a permanent solution – ruben Feb 25 '18 at 20:53
  • 1
    Great tool. I have just used it. It works great. My computer is not on Wi-Fi, but it is on the same LAN as the Android device. – Hong Feb 16 '19 at 16:26
  • 2
    Why android studio throw error Plugin "ADB WIFI Debug LAN / WAN network" is incompatible (supported only in IntelliJ IDEA). – Ram Feb 12 '21 at 11:45
  • 2
    It appears as though this plugin is archived and no longer being maintaned – MoralCode May 03 '21 at 02:55
  • Plugin error: Plugin 'Android WiFi ADB' is compatible with IntelliJ IDEA only because it doesn't define any explicit module dependencies – Davoud Nov 09 '22 at 12:15
15

I used the following steps to successfully debug over wifi connection. I recommend this solution to everybody experiencing problems using integrated solutions like Android WiFi ADB plugin. In my case it failed to keep the Wifi connection to my device after unplugging USB. The following solution overcomes this problem.

1. Connecting device

a. Connecting device using local wlan

If you have a local wlan you can connect your android device and your pc to this wlan. Then identify the IP address of the android device by looking into its wlan settings.

b. Connecting device directly using a hotspot

I prefer to connect with a hotspot on the device. This is more private and does not open your debugging connection to the (public) wlan.

  1. Create a Wifi hotspot on the Android device
  2. Connect PC to hotspot
  3. On PC look into network connection status of this hotspot connection to find the IPADDRESS of your device.
    My system showed IPADDRESS 192.168.43.1

2. Create debugging connection

  1. Connect your device to USB.
  2. Issue command adb tcpip 5555 to open a port on the device for adb connection.
  3. Create wireless debugging connection adb connect IPADDRESS.
    In my case the command looked like adb connect 192.168.43.1

The command adb devices -l should now display two devices if everything is ok. For example:

List of devices attached
ZY2244N2ZZ             device product:athene model:Moto_G__4_ device:athene
192.168.43.1:5555      device product:athene model:Moto_G__4_ device:athene

3. Keeping debugging connection

The tricky part comes when unplugging the USB connection. In my case both connections are closed immediately! This may not be the case for all users. For me this was the reason that I could not use Android WiFi ADB plugin for android studio. I solved the problem by manually reconnecting the Wifi after unplugging usb by

adb connect 192.168.43.1

After that adb devices -lshows a single wifi connected device. This devices shows also up in android studio and can then be selected for debugging. When the connection is unstable you may need to repeat the above command from time to time to reactivate the connection.

Georg W.
  • 1,292
  • 10
  • 27
13

Try to run:

adb tcpip 5555
adb connect 192.168.2.4

http://developer.android.com/tools/help/adb.html#wireless

Rocket
  • 1,030
  • 5
  • 24
7

Android wifi ADB was earlier working on my IDE but after Updating Android Studio (my current is Android Studio 3.3) it is not working and always prompt as "Unable to connect to device......Same network"

After spending much time i was unbale to resolve the issue.

Then i tried - WIFI ADB ULTIMATE by

https://github.com/huazhouwang/WIFIADB/tree/master/WIFIADBIntelliJPlugin

It worked for me.

Edit: Now I am using ADB Wi-Fi, which is the simplest and easy-to-use plugin in Android Studio.

ADB Wi-Fi Android Studio plugin

Zafar Imam
  • 319
  • 3
  • 11
6

You can find information relating to setting up a device over WiFi over by the Android ADB Docs.

For devices running Android 11+ see instructions.

For devices running Android 10- see instructions

Chad Mx
  • 1,266
  • 14
  • 17
  • My Android device provides the WiFi hotspot and when I try to turn on "Wireless debugging" I get toast "Please connect to WiFi nerwork"! – Juha Jan 30 '22 at 07:08
4

You may need to restart your adb via Android Studio (do it twice for good measure).

resetting adb

Marka A
  • 258
  • 5
  • 15
4

0pen android studio and follow this path

Go to -> settings -> plugins -> Click on Browser repositories

after that search for WIFI ADB ULTIMATE then click on install.

First time you have to connect it using USB.

You can check its working on github. For more details kindly refer WIFI ADB ULTIMATE

Ajay Thakur
  • 153
  • 6
2

If you are using a rooted phone then try this application WiFi ADB.
Probably this is the most simplest way to debug on wifi.
I am using this application from many days and it works flawlessly.

lazykiller
  • 31
  • 6
2

Here are simple steps to implement Android App debugging using ADB over wifi:

Required: You need to connect android device and computer to the same router via wifi. You can use Android Wifi tethering also.

Step 1: Connect Android device via USB (with developer mode enabled), and check its connection via adb devices.

Step 2: Open cmd/terminal and the path of your ../sdk/platform-tools.

Step 3: Execute command adb devices.

Step 4: Execute command adb -d shell (for device) OR adb -e shell (for emulator). Here you will get the shell access to the device.

Step 5: Execute command ipconfig (Windows command) or ifconfig (Linux command) and check the ip-address of it.

Step 6: Not disconnect/remove device USB and execute command adb tcpip 5000, to open tcpip socket port 5000 for adb debugging. You can open it on any port which is not currently occupied.

Step 7: Now execute command adb connect <ip-address>:<port>. eg: adb connect 192.168.1.90:5000 (where ip-address is device's wifi address and port which you have opened).

Now, run adb device and check the debugging device is now connected wirelessly via wifi.

Happy Coding...!

Rahul Raina
  • 3,322
  • 25
  • 30
2

I'm using AS 3.2.1, and was about to try some of the plugins, but was hesitant realizing the plugins are able to monitor any data..

It's actually really simple doing it via the Terminal tab in AS:

  1. Turn on debugging over WiFi in your phone
    • Go to developer options and turn on "ADB over network"
    • You'll see the exact address and port to use when connecting
  2. Go to the Terminal tab in Android Studio
  3. Type adb tcpip 5555
  4. Type your ip address as seen in developer options i.e. adb connect 192.168.1.101
  5. Now you'll see your device in AS "Select deployment target" dialog
deepGrave
  • 320
  • 3
  • 11
2

Got this error? enter image description here Most of you are here because you didn't do the first thing that is: 1.Connect our Phone with the PC 2.Keep both PC and device connected to the same WiFi Then follow all the mentioned steps above.

M.A.K. Ripon
  • 2,070
  • 3
  • 29
  • 47
2

I successfully debug app through WiFi by following the official site's guide.

Note,

  • WiFi debugging in Android 11+ is different from Android 10 and lower.
  • Please update your adb, i.e. Android SDK Platform-tools to the latest version, otherwise you may miss some adb commands like adb pair.
Jeff T.
  • 2,193
  • 27
  • 32
2

if adb command not found.

-----------------------------

Install homebrew

 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Install adb

brew install android-platform-tools

---------------------------

Connect the device now.

  • Enable USB debugging in the Android device
  • Enable Allow ADB debugging in charge only mode
  • Connect the device to the computer via a USB port.

Start using adb

adb devices

List of devices attached
DUM0219A21000314 device

the first item is device id.

adb -s <device id> tcpip 5555

adb -s DUM0219A21000314 tcpip 5555

restarting in TCP mode port: 5555

Find the local IP address of your Android device. You can find this information in the quick settings drop-down menu by pressing / long pressing the WiFi icon and then clicking on the WiFi network you are connected to.

adb connect <IP address>:5555
adb connect 192.168.2.2:5555

connected to 192.168.2.2:5555

Don't forget! Allow ADB debugging in charge only mode enabled before connecting the device

Samet ÖZTOPRAK
  • 3,112
  • 3
  • 32
  • 33
1

In Android Studio 3.0.1 > Goto > (Short cut key (Alt+Cltr+S)) Settings > Goto Plugins > Click on Browser repositories... > Search "ADB WIFI" and install the plugin. After the installation restart your android studio.

enter image description here

Click the icon enter image description here and connect your device.

Andre Hofmeister
  • 3,185
  • 11
  • 51
  • 74
Rahul Patil
  • 129
  • 1
  • 5
1

All of the answers so far, is missing one VERY important step, otherwise you will get "connection refused" when trying to connect.

Step 1: First enable Developer Options menu on your device, by navigating to the About menu on your device, then tapping the Build menu 5 times.

Step 2: Then go to the now visible Developer Options menu and enable USB debugging. Yes its a bit odd that you need this for Wifi debuging, but trust me, this is required.

Step 3:

adb connect [your devices ip address]

It should say that you're now connected

RogerW
  • 476
  • 7
  • 9
1

Easy Way is with Plugin Android WiFi ADB:

For Android Studio Artic Fox|2020.3.1 Patch 2

  • Open Android Studio. Go to File/Setting/Plugins and Click on the MarketPlace. Search for Android Wifi ADB and install it.
  • The plugin(AndroidWiFiADB) would be installed at path -> C:\Users\PCUserName\AppData\Roaming\Google\AndroidStudio\Plugins.
  • Cut the Android Wifi ADB Folder.
  • Now Paste That AndroidWiFiADB Folder at path -> C:\Program Files\Android\Android Studio\plugins
  • Restart Android Studio And Icon Appears on The Right Side of The IDE .

enter image description here

waheed shah
  • 494
  • 7
  • 19
0

On Windows, save the following lines as xyz.bat

@echo off
adb tcpip 5555
set /p IP="IP Address: "
adb connect %IP%
EXIT /B 0

Run the script, put device IP and you're done!

Izan Majeed
  • 49
  • 10
0

There is an option in newer version of AndroidStudio which allows you to test app on physical device over WiFi.

Please follow this official post: https://developer.android.com/studio/run/device#wireless

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Hemant Sankhla
  • 923
  • 12
  • 23
-1

just open settings / plugins / search " Android wifi adb and download it and connect your mobile using usb cabble once and its done