I downloaded the latest platform-tools for windows, then I enabled developer mode on my phone and turned on adb over wifi. However after I enter the command adb pair ipaddr:port I get the error "Failed: Unable to start pairing client" (after entering the code).
adb is working fine over the cable, and wifi adb is working with my watch. Any ideas?
I tried all possible way. Then I click on forget wifi and then again connect to wifi then entered the pair and code again then it starts working
Had the same problem. Turns out the port used for adb pairing changes each time you ask for a pairing code. I didn't update mine, so it didn't work. When I realized that, and typed in the pairing code, everything worked as expected.
In my case I was connected to a VPN on my workstation and that's why I got this message. Disconnecting from the VPN fixed it.
Try pinging the device 2-3 times and then pair. Only this solution worked for me.
For me, it worked after I restarted Android Studio (or the command line).
One solution that worked for me is to try and establish a tcp connection first to the pairing target.
nc -vz <ip_addr>:<pairing_port>
Once this is successful in establishing a connection, proceed with adb pair. I'm not sure why, but this is the only thing that worked for me. Rest all failed.
If you've recently enabled developer mode on your phone, try restarting it. I was receiving the error, "Failed: Unable to start pairing client", then I rebooted my phone and after that I was able to pair.
In my device the IP address given in Wireless debugging screen is 10.1.10.1 which I know is not my local router's IP address. My router uses 192.168.0.xxx addresses. I found my device's IP address by going to advanced section of connected WiFi network and used that when connecting to adb keeping the port same.
so instead of
adb pair 10.1.10.1:<port>
I used
adb pair 192.168.0.xxx:<port>
I was on a guest wifi network that blocked inter device communication. Switching to my main network solved it.
My issue was I had AFwall+ enabled, so some network connections where blocked which should not have been. I don't know which exactly, but disabling the firewall made it pair.
In my case "User Isolation" was enabled on my modem router which prohibited direct communication between connected devices, after I disable it everything worked as expected.
Both devices must be on same network. In my case I was connect to two different networks.
First make sure the computer isn't paired with the device already in Wireless debugging options under "Paired devices". If it is, forget the pairing. Next restart the device. Afterwards when the device boots back up again, re-enable "Wireless debugging". Sometimes (I think) the computer fingerprint expires on the device and adb pair starts failing. The device at this point may re-prompt you asking to allow the computer's fingerprint. After that adb pair should start working again. Finally once it pairs you may need to run adb connect again with the ip and port listed under "IP address & Port" in Wireless debugging options.
for me , I try all way ,close wifi or restart computer or restart phone, failed ,they all failed .
Until I shut down my VPN , it automatically connected, after that, I connect my phone after close the vpn, The connection has never failed
Related
I'm new to android studio and have just made a new app, which uses position sensors.
All is well when the device is usb connected to the debugger. When I unplug the cable, the app runs fine and I can wave the device around, going to a different room etc. .
But when the app is restarted without that cable, it is "waiting for debugger", which is a little annoying at that point.
I have seen this https://developer.android.com/studio/run#changing-variant but that way I need to sign the app, and I fail on that.
Is there a way to run the app without signing it, and without that debugger cable?
To be more precise in view of the two answers that suggested wi-fi connections (which I can't verify at the moment because the box running AS doesn't have wf-fi connection).
I want to test the app even without debugging, and test it by changing location, too. So I would have to set up a wi-fi connection that would connect to AS over really long distances.
Instead I just want to tell the app (or the device): forget about the debugger.
This: https://stackoverflow.com/a/56541740/4142984 solved my problem.
For the first time you must need to connect device to the android adb and after that you can remove it and still get connection to the android adb.
you should install Android Wifi ADB
you need to connect first time your device with cable in usb debug mode and by using this plugin you can connect your device on the wifi after that you can remove the cable from the system and you will get connected your device to the Android Studio
Note : make sure your system and mobile device must be connected with the same wifi network.
1.Download android-sdk-platform-tools
2. Add the path to environment variables
3. Connect your phone to usb cable
4. Connect your phone and computer in same network(WiFi)\
Now in cmd
5.adb tcpip 5555
6. adb connect *your_phone_ip*:5555
Now you can unplug the usb cable.
I've got an android device that was previously connecting over tcp, and later on when I tried to connect adb devices said it was offline. Is there a way I can fix this issue without connecting over usb?
I found that if I disconnect/reconnect from wifi, the error goes away! I did this by moving the phone out of range of the router, and back in.
I followed steps in this post and tried to connect to my Motorola X Gen 2 for Wifi debugging, on OS X El Cap.
I connected my phone to the laptop with usb cable,
I killed and started server, the server was started successfully, and then in:
./adb devices
I got
List of devices attached
TA44909GA0 device
Then I did
./adb tcpip 5555
And I tried
./adb connect <IP addr of my phone>:5555
both with usb cable connected and disconnected, none of them worked. Both returned error message saying:
unable to connect to ***.***.***.***:5555: Operation timed out
I cannot figure out what is happening here, I tried the Android Studio plugin ADB WIFI, which returned the same message, operation timed out. I restarted everything, tried connecting with a different cable and all, nothing worked.
Does anyone know what's happening here?
Make sure your computer and the android device are using the same wifi network. I had the same issue and fixed it after changing to the same wifi.
So after a huge number of trials, I think the problem is somehow wifi related, I think this feature does not work well with WPA2 (or any kind of?) Enterprise encryption, because I was using my school Wifi, and it turned out to be okay, up and running, for the hotspot I set up with another laptop.
What solved this for me:
disconnect the phone from USB cable
restart the phone
reconnect the phone by USB cable
(meanwhile):
adb kill-server
adb start-server
Then follow the "standard" procedure.
If you are connected on same network and still can't connect then check your IP twice . Sometimes it get changed.
check your IP = phone settings -> About phone -> Status -> IP address
Try increasing the timeout in Android Device Monitor.
From Android Studio: Tools->Android->Android Device Monitor
In Android Device Monitor:
Window->Preferences, Android->DDMS.
In the DDMS window, increase the "ADB Connection Timeout (ms)". It defaults to 5000ms. If your app is particularly large/takes a long time to load, it may go longer than this timeout, so increasing may fix it.
If you are using Mac OS.
Check by clicking on the wifi icon in the toolbar. If there is any warning.
In my case there was a warning saying the wifi is using WPA protocol and its not secure.
I went to my router settings and changes the protocol to WPA2/WPA3 auto.
After that the warning went away and the wireless debugging started working.
Essentially, my problem is that I tried connecting my device to adb over Wifi, got to adb connect xxx.xx.xx.xxx but then adb claims that it was unable to connect to xxx.xx.xx.xxx:5555.
Ok, but now I'm having trouble getting it back to listening over USB. adb usb tells me that there isn't a device attached and adb devices gives me an empty list.
I've tried killing the adb server and then restarting it, toggling the device's debugging mode and toggling the device's USB storage transfer but nothing seems to be working. This question seems very similar to my problem but I have no idea what the guy is doing in the solution.
I'm guessing the problem is that adb is still trying to listen through Wifi but since I can't connect to it over Wifi it can never go back to listening to it over USB. Idk...
For wifi, you may be able to get it to work if you first use the browser on the device to visit a webpage or something and so effectively wake up the wifi radio and its connection to the access point. You may need to keep doing this every once in a while.
(Maybe you should listen to internet radio while you work?)
Of course your access point will have to permit peer-to-peer traffic on the local subnet. In many cases that may be the norm, but I believe an access point can be configured not to support that, and some may default to such settings. There can also be issues between wired and wireless subnets sourced from the same box.
Finally, restarting the device might get it back into USB mode.
I need network connection on my Android device to test apps. My notebook WiFi adapter is broken, so after 2 hours I've set connection via USB. But! Eclipse doesn't see the device when I start "Wired Tether" on it to get connection and I can't debug my apps.
Does anybody know how to solve this issue? Use USB tethering to get internet connection on phone and debug apps at the same time?
I don't know of a way to simultaneously use USB debugging and tethering. Here are some workarounds, though:
Get a USB wireless adapter for your computer (see http://www.amazon.com/gp/bestsellers/electronics/13983791/ref=pd_zg_hrsr_e_2_4_last). I don't know if buying one of these is an option for you in India.
Send your apk to your phone wirelessly for app installation (see Developing on android-based device via wireless) and then view the logcat directly on the phone for debugging (aLogcat seems to be popular, and allows you to send log files via, for example, email, so that you can open them on your computer to view them on a bigger screen)
I know these solutions involve some cost, effort, or inconvenience, but hopefully one will work for you.
EDIT:
As noted in answers from #shkschneider and #CodeShane, Internet sharing via Bluetooth is possible. CodeShane's answer mentions PdaNet (which apparently also allows for simultaneous USB tethering and debugging), and includes a link. Another solution is OpenGarden. These solutions provide access to the Internet for the computer via the phone. If the reverse is desired (and this is not entirely clear from the question), reverse tethering seems to be the answer (see the answer from #NickL).
Long story short: you can't. Android simply does not supports it (that is more because of the USB standard and tethering action than AOSP's fault).
So to go around the problem, you should either:
Get internet form another source
Maybe you could have ethernet connection?
Tether internet from your phone to your netbook in another way
You can't use wireless tether since your wifi adapter is broken, but maybe you could tether using bluetooth?
Debug your phone in another way
Maybe you could use an android application like aLogCat or similar?
But in the hand, sorry, you can't tether usb from phone to netbook while usb debugging from the netbook. Your success will depend on your ability to find an alternative solution.
I would like to point out that I am using PDANet for USB-tethered internet to type this reply while I am also debugging an android application on the same phone via Eclipse Juno. Not sure which side fixed this, but it is awesome!
As for why Eclipse isn't seeing your device, standard troubleshooting tips apply .. make sure to enable USB debugging and unknown sources/3rd party apps, try restarting, check usb drivers, update drivers/eclipse..
Device not detected in Eclipse when connected with USB cable
http://developer.android.com/tools/device.html
Eclipse not finding phone
PdaNet 3.5
Eclipse Juno Service Release 1; Build id: 20120920-0800
You can use bluetooth tethering to get internet connection and debug using USB.
Step 1. Turn off USB tethering
Step 2. Turn on Wireless USB Debugging
Connect to your device via USB
Enter "adb tcpip 5555"
Unplug your device
Look up your device's IP in the system settings
Enter "adb connect [ip address]:5555"
Step 3. Turn on USB tethering
Now you can use internet via USB cable and debug app in wireless mode
That's it!
Yes, its possible. There's a hack available at below links !
Source: HowToGeek , StackOverFlow
You can actually connect the adb to the phone via TCP. You may need a rooted phone for this to work, though
If I understand your question correctly, you want to tether your phone to the PC via USB, and use the (internet)connection of your PC + still get logcat output?
Then yes, this certainly is possible.Tethering is when your PC uses the internet of your phone, the other way around is called reverse tethering. Your device has to be rooted, then you can use this application for reverse tethering.
When you connect your phone to the computer via USB, you press 'connect' in the application. It then installs an app on your phone, which handles the reverse tethering connection. It works, I sometimes have to press 'check DNS' while it is connecting to make it working.. but it works! Also debugging via USB works the usual way.
First you need to debug your device using USB cable then type adb tcpip 5555 it will allow debugging via TCP/IP protocol.
After that turn on your USB tethering, now your computer get internet connection but lost the USB debugging.
Now you must know your phone IP address so you can debug via TCP/IP. You can use command arp -a in terminal and look at the gateway address.
The last is connect to your phone using adb connect yourphoneip:5555 for example adb connect 192.168.42.129:5555
Now you get debug and tether at the same time
You can use
WiFi Tethering - For Internet connection
Connect USB for adb.