Device: Nexus 6P
ROM: AOSP android-8.1.0_r1 branch
I am having trouble connecting to adb due to error "device unauthorized" error. The device authorization works fine in "user-debug" angler build, but not "user" angler build.
I have tried "common" solutions outlined in stackoverflow[https://stackoverflow.com/questions/23081263/adb-android-device-unauthorized], none of which works for me.
None working solutions:
1. Switched usb connection mode to PTP or MIDI
2. Revoking USB Debugging on phone, no such option on the ROM in the debugging section
3. Restart adb server
4. Toggling usb debugging options
5. Regenerated adb keys (%HOME%/.android contains adbkey.pub and adbkey key pair file), adb-kill server, then try reconnecting
6. Delete adb keys, adb-kill server, then try reconnecting adb
Any tips?
bump?
2 characters
2 characters
Related
Have a Fujitsu T-01D phone, it's already set in USB debugging mode but when it's connected to the computer, the DDMS is not able to detect the phone. The list under name in DDMS is empty.
Checked device manager the USB mass storage device drivers of the phone and Android ADB interface driver all seem okay.
Already tried 2 different USB cables and ports but still not able to detect.
Also did adb -kill-server' and 'adb devices' command to reload the host server but still nothing changed.
Any way to get this resolved?
ADB over Wi-FiSome of us might like to connect the device over WiFi for debugging, instead of using the data cable. Here's the required tutorial to do so
Requirements
1. Android device (duh!!!)
2. ADB in the computer (again duh!!!)
3. Root privileges
4. Terminal emulator (download from here)
Let's begin thenOpen terminal emulator on your device. Enter the following code
Code:
su [color="red"]Grant superuser here[/color]
setprop service.adb.tcp.port 5555 [color="red"]Can be anything else[/color]
stop adbd
start adbd
Check it with this
Code:
getprop service.adb.tcp.port
It will return 5555 or the number you entered in the above code
Enter the following code on your computer in command prompt or shell
Code:
adb connect 192.168.0.151
Instead of 192.168.0.151, enter your device IP address
To make your device listen on USB again, just restart the device. And enter the code on your computer
Code:
adb usb
I would definitely use the USB cable to push large files or even small files that you really don't want to risk corrupting (partition images you plan on dding, etc).
Very importantly, keep in mind, when your phone is listening for adb via WiFi, it's wide open... anybody that has adb installed and knows your device's IP address can access it without a password. Again, a simple reboot will turn it off though.
Credits
JeepFreak for this post in the One X forum
Reserved
Reserved for app
I want to thank the OP, however belatedly, for writing these root instructions for users to connect their PC and phone via adb over Wi-Fi without USB cables being involved.
As the OP is well aware, non-rooted Android 10 and below allowed wireless adb connections AFTER a USB connection was first established (adb start-server && adb tcpip 5555 && adb connect [IP]:5555), but that changed (for the better) in Android 11 and above with the new new Developer options Wireless debugging random port assignments (adb connect [IP]:[PORT] or adb pair [IP]:[PORT] [PIN]) such that the adb wireless connection never needs USB cable ever again.
Given Android 11 allows Developer options Wireless debugging via a random port, and Android 12 new Developer options Wireless debugging allows that to be accessed even easier with a new Developer options Wireless debugging tile, the only thing missing is a way to get, after the fact, the random port assignment that Android uses for the adb wireless connection to your PC.
Some related threads for reference might be...
[adb,scrcpy,vysor] What ports does Android 12 randomly set when Wi-Fi connecting via Wireless debugging adb "pair" or "connect" commands?
(PSA) Using the new Android 12 TILE for 'Developer options' 'Wireless debugging' to establish adb connection over Wi-Fi without USB
What's the difference between Windows/Android adb "connect" versus adb "pair" when mirroring Android 12 over Wi-Fi onto a Windows PC?
The only question that's missing an answer preventing a perfect completely Wi-Fi automatic solution is...
Does anyone know how to obtain that random Android port address from the PC?
I currently have 5.1.1 installed on my honor 5x and am able to use adb automatically without accepting an RSA prompt (have installed twrp, rooted, etc.) but when I dload a MM stock rom and use usb debugging it is unauthorized and I get no RSA prompt I've even gone as far as to delete /data/misc/adb from my device and adbkey.pub from my desktop but there is still no pop up authorization in MM
Developer options -> Revoke authorisation (something like that), replug. If that doesn't help, change connection mode to file transfer and try again.
ShadySquirrel said:
Developer options -> Revoke authorisation (something like that), replug. If that doesn't help, change connection mode to file transfer and try again.
Click to expand...
Click to collapse
I actually don't have a "revoke authorization" button below usb debugging, odd I know but I've tried all those options to no avail
Tsunetoma said:
I actually don't have a "revoke authorization" button below usb debugging, odd I know but I've tried all those options to no avail
Click to expand...
Click to collapse
Tried toggling the debugging switch? I had issues like these on one of my previous devices, but usually these were fixed with a simple port change or debug off/on switch, if revoke->replug didn't work.
Have you checked drivers, or if dmesg says something about the device, if you're on Linux? Sometimes even running multiple adb instances (like one from terminal and one from Android Studio, for example) can cause this behviour.
Enable rsa key authentication
I installed a Substratum overlay which screwed up my phone and now every time I boot into system the screen remains black. I'm on RROS 6.0.0 (Android 8.1) so I was only able to install a TWRP without decryption thus I can't access system/data in order to delete the overlays there. The only way to access it now would be over ADB while the phone is booted to system. The problem is, although I've enabled USB debugging I'd have to enable USB file transfer (default set to charge only) in order to be able to access my phone via USB. Right now I always get the output:
Code:
[email protected]:~$ sudo adb devices
List of devices attached
???????????? no permissions
Is there any way to enable USB file transfer or just generally access /system/data without any inputs while being in system? I know, I could just do a factory reset but I'd rather avoid that... Any help would be appreciated!
(Many will consider this question a duplicate of similar questions but I don't think this question should be marked as duplicate because the answer requested here is different than others.)
I am searching for the solutions since many years and read a lot of pages on internet and StackOverflow but hasn't found any solution.
Once an non-rooted Android phone is authorized over USB using ADB then how to connect it over Wi-Fi every time without ever connecting the phone over USB?
I know that executing
Code:
adb start-server
then
Code:
adb tcpip 5555
and then
Code:
adb connect <IP.address.of.phone>
will connect the phone over Wi-Fi IF it is connected using USB when issuing these commands.
According to the answers/forums, there are 2 ways to connect Android phone over Wi-Fi:
The user has to first connect to USB even though the device is already authorized.
The phone needs to be rooted.
But I think, what I want to achieve, as per the question, must be possible because if ADB can connect over USB and then Wi-Fi, then there must be some way to accomplish with directly connecting over Wi-Fi if computer is already authenticated. The missing thing is to know what exactly ADB is doing when switching from USB to Wi-Fi. I think, it could be getting authorization again. But what if we store the authorization information (finger print? or encryption key?) once and use it every time to connect over Wi-Fi? (Please note that when first time authenticating the computer over USB, its finger print is showed in the Android phone, and it never asks again until the authorization is revoked/invalidated somehow. So, I think the requirement here is to revalidate the computer.)
I viewed the ADB repository and read the text files mentioning how ADB works. In one txt file I read that
Code:
adbd
(ADB Daemon) is started on port 5555 on the Android phone/emulator when
Code:
adb connect ___
command is executed. Is there anyway to manually start the daemon through a terminal app on the installed on phone? I tried 'adb', 'adbd' and 'setprop' commands in the Termux app but these commands doesn't exist. According to the txt files of the repository, the ADB on computer is sending the commands to the Android device/emulator and can start 'adbd' or set/open the port 5555 using
Code:
setprop service.adb.tcp.port 5555
command. Is there a way to do this on Android phone using a terminal app on a non-rooter phone?
Somebody who has knowledge of networking, Android and C/C++ language may be able to answer. One can look in the GitHub repo of ADB source code if they want to know what is happening during the connection process.
I'm a little late to answer your question at the time you asked it, but if it still helps the OP, non-rooted Android 10 and below allowed wireless adb connections AFTER a USB connection was first established (adb start-server && adb tcpip 5555 && adb connect [IP]:5555), but that changed (for the better) in Android 11 and above with the new new Developer options Wireless debugging random port assignments (adb connect [IP]:[PORT] or adb pair [IP]:[PORT] [PIN]) such that the adb wireless connection never needs USB cable ever again.
Given Android 11 allows Developer options Wireless debugging via a random port, and Android 12 new Developer options Wireless debugging allows that to be accessed even easier with a new Developer options Wireless debugging tile, the only thing missing is a way to get, after the fact, the random port assignment that Android uses for the adb wireless connection to your PC.
Here are some related posts about that subject which may help the OP.
[adb,scrcpy,vysor] What ports does Android 12 randomly set when Wi-Fi connecting via Wireless debugging adb "pair" or "connect" commands?
(PSA) Using the new Android 12 TILE for 'Developer options' 'Wireless debugging' to establish adb connection over Wi-Fi without USB
What's the difference between Windows/Android adb "connect" versus adb "pair" when mirroring Android 12 over Wi-Fi onto a Windows PC?
The only question that's missing an answer preventing a perfect solution is...
Does anyone know how to obtain that random Android port address from the PC?