Android Studio - ADB Error - “…device unauthorized

2020-01-27 10:21发布

So I started getting errors in my ADB logs which, I think, are causing my device to now display any logcat output for my app. I am getting all the logcat output except the one from the app itself.

PropertyFetcher: AdbCommandRejectedException getting properties for device 04799057970ed1fc: device offline
PropertyFetcher: AdbCommandRejectedException getting properties for device 03799467970ed5fg: device unauthorized. Please check the confirmation dialog on your device.

17条回答
姐就是有狂的资本
2楼-- · 2020-01-27 11:16

Remove the Debug permissions on the Device, with the cell phone connected, then put them back, and ask if you want to allow the PC to have debug, accept and ready permissions: D

查看更多
地球回转人心会变
3楼-- · 2020-01-27 11:16

I get this error very often for some reason when doing "ionic cordova run android" and running on an emulator. What works for me is to end the "adb.exe" process and re-run. Sometimes that also doesn't work and what I do is exit the emulator and in android studio do a "Cold Boot" on the emulator.

查看更多
做自己的国王
4楼-- · 2020-01-27 11:17

In my case the problem was about permissions. I use Ubuntu 19.04 When running Android Studio in root user it would prompt my phone about permission requirements. But with normal user it won't do this.

So the problem was about adb not having enough permission. I made my user owner of Android folder on home directory.

sudo chown -R orkhan ~/Android

查看更多
做自己的国王
5楼-- · 2020-01-27 11:19

Below are the commands for Ubuntu user to authorise devices once developer option is ON.

sudo ~/Android/Sdk/platform-tools/adb kill-server

sudo ~/Android/Sdk/platform-tools/adb start-server

On Device:

  • Developer option activated
  • USB debugging checked

Connect your device now and you must only accept request, on your phone.

查看更多
6楼-- · 2020-01-27 11:20

The solution to this was just to change the USB cable, having enabled ADB Integration via

Tools > Android > Enable ADB Integration.

查看更多
登录 后发表回答