How to connect ADB over wifi network without usb cable? - android

I want to connect my adb to real-time android, not to emulator but it gives an error: "cannot connect to 192.168.10.4:5555: No connection could be made because the target machine actively refused it. (10061)"
I tried this command: adb connect

It is possible starting with Android 11. On the phone click Pair device with pairing code, then on the dev machine do the following:
cd myandroidsdk/platform-tools
adb pair ipaddr:port
Take ipaddr and port from your phone. The terminal will then prompt you to put in the pairing code.
https://developer.android.com/studio/command-line/adb#connect-to-a-device-over-wi-fi-android-11+

In latest updates of Android Studio, you can easily pair your device wirelessly
Go to Device Manager > Physical > Pair using Wi-Fi
Then go to your phone's settings Developer options > Wireless debugging > Pair using QR code
Your phone will be connected to Android Studio after scanning the QR code
Note: this feature works on Android 11+ devices
Old Devices
Make sure your phone and laptop are connected to the same router
connect your phone to your laptop with usb cable
open a terminal window
adb devices
shell response should be something like this:
List of devices attached E1MGAP2810904770 device
adb tcpip 5556
adb connect 192.168.1.47:5556
shell response should be something like this:
connected to 192.168.1.47:5556
change the 192.168.1.47 with your local IP address.
you can find your phone's IP Address in Settings -> Status ...

Please follow the below link to get the detailed answer :
https://developer.android.com/studio/run/device
And one more think , don't connect your mobile with charger while connecting the android studio to mobile without usb cable.

Connect to DNS Server IPv4 address instead of just IPv4 address. Check in your wireless properties.

Related

Debugging over wifi an app that is connected to a specific USB controller

I am currently developping an app that will connect to a specific USB controller for Xiaomi Mi box S.
The problem is, the Mi box have only one USB port so I am using adb over wifi to debug it and still have my USB port available for my custom USB thingy. I am able to connect to my Mi box through adb over wifi when I enable USB debbuging but then, the USB port does not behave like a host anymore and it does not detect anymore my USB controller.
How can I get my Mi box to accept adb over wifi with my USB port behaving as usual ?
I believe I have the answe for you but also have a question
Answer
1) connect the device via USB
2) type: adb tcpip 5555
3) get the devioce IP address. you can get this in the device settings / about phone/status
4) type: adb connect [IP address]:5555
you will the be able to connect via WIFI in android studio.
My question is.
I was able to do this in Windows 10. but rather develop in Linux/Ubuntu. I cannot get the system to see the MI Box s device. I have done this sucessfully with phones and other TV boxes but not with the MI box
Thanks

Unpluging usb cable also disconnects wireless adb connection [duplicate]

I develop on my tablet using android studio.
The tablet is connected to the computer by wifi using
adb connect <ip_andress>:5555
My application contains listeners for USB devices attached/detached.
But unfourtunately, when I connect/disconnect usb device to/from the tablet, the adb connection is getting killed, and I can no longer see the device under "adb devices".
It is not a adb-connection-by-wifi what gets killed. It is just that USB enumerations affect the sys.usb.* system properties which on many devices is causing restart of adbd regardless whether it's being used over USB or tcpip.
Do grep "stop adbd" /init*rc to see what I mean.
You could either comment out those stop adbd lines or just disconnect the USB cable before running your adb connect command.
I was never able to connect my cellphone with my computar through wi-fi.
I had already given up. I followed all the instructions and tips, and nothing worked.
Finally, I did what no one said to do.
I've connected the phone to the WiFi network provided by the cable modem itself and not to some (not all) additional networks that are included in the router.
At home I use one of these networks, because I use a Deco Tp-Link router, which propagates the signal to my entire house, but this network is NOT compatible with ADB. It does not identify it as belonging to the same network.
After this, I use the normal procedure described here.
a) Connect cellphone with a USB cable
b) Find the IP_Phone depends on system in the cell phone. Here I use Settings, About Phone, Status and IP address.
c) Run the following adb commands in Command Prompt (Windows) or Terminal (Linux), where IP_Phone is the IP above mentioned. Normally adb.exe is an executable stored in computer path. adb is already included in Android Studio package.
adb tcpip 5555
adb connect IP_Phone
d) Now disconnect USB cable and it's ready. The cellphone model continues to appear in the status line in the top of Android Studio.
-/-
The best wifi is that defined in Cable Modem. It, unlike an any account defined in my router, answers to a ping command.
ping IP_Phone
Disconnect the usb cable just before running adb connect <*ip_address_of_your_phone*>

How to get adb logs via bluetooth?

How to get adb logs via bluetooth?
need to connect an android device to my laptop to get the adb logs, but through usb cable its not working.
Dude, you don't need Bluetooth to do so, you can get ADB logs via Wi-Fi.
The steps:
Connect your device to your laptop via USB (yes, you've read right, if your USB cable is not working, you can use an alternative USB cable temporarily or borrow one from your friends).
Type adb tcpip 5555 in the terminal
Type adb connect XXX.XXX.X.X (the X's represent the local IP address of your mobile device, if you don't know your device's IP, go to Settings > Wi-Fi > Advanced).
You can disconnect your device from your laptop and now you can debug your apps wirelessly.
If you really need Bluetooth to use ADB. Bad news! That's not even possible.

How to use adb using bluetooth?

I am currently using an API 18 (Jelly Bean) device, and it does not support ADB over Bluetooth by default (No option available in developers option for wireless debugging) I have to connect my device with my Laptop using Bluetooth Personal Area Network which is Bluetooth tethering of my phone. Can anyone help me with starting a TCP open port my phone so that I can connect ADB using the adb tcpip "open_port_no" and adb connect <phone_ip_address>:open_port_no commands?
I have already tried some apps from playstore to do so but they all failed.
You need to enable the TCP port first by connecting a USB cable to your phone and setting it from the console on your PC/Mac:
adb tcpip 4455
Now turn on the Bluetooth on your phone and enable tethering.
You need to use the IP address of your phone. It will most likely be 192.168.44.1 since this is the default. If not:
You can get this using a few methods depending on your computer type:
ifconfig
ipconfig /all
route | grep default
Then connect to your phone from your computer using:
adb connect 192.168.44.1:4455
You should get a response:
connected to 192.168.44.1:5555
This works perfectly for me. Sorry for the late response :) I was just looking for the same thing and happened upon the solution. Sharing is caring.

How to use adb over Mobile AP (Portable wifi hotspot)

First : I know about abdWireless app. But my problem is different.
I am using my Android mobile as Mobile AP (Portable WiFi hotspot) for using internet on my computer. I want to use adb in wireless mode but the problem is - when i enable Mobile AP on my android mobile WiFi gets turned off and i am unable to use abdWireless app.
I want to use both wireless ADB and Mobile AP at the same time.
Is there any way to do it ???
Developers have created apps for this:
https://play.google.com/store/apps/details?id=com.ttxapps.wifiadb
Once you start this app, you can connect to your phone like this:
adb connect ip_address_of_the_device
However, your phone must be rooted!
Please let me know if this helps!
On mac:
You need to run: ifconfig
Followed by run: arp -a
In my case, the first listed IP is router IP, ie. IP of your android device with hotspot(let it be: ip_address_of_the_hotspot_device).
Then run either: adb connect ip_address_of_the_hotspot_device or adb connect ip_address_of_the_hotspot_device:5555

Categories

Resources