由于我重新安装了Eclipse(简单地删除并重新下载),我无法在三星Galaxy i9001(使用CyanogenMod - Android 4.4.2)上调试我的应用程序。在重新安装之前,它工作正常。

拔下/插头,取消/检查“调试已启用”,adb kill-server/adb start-server,重启电话/电脑对我不起作用。在设备上授权对话框从未出现(但我记得该对话框出现在重新安装之前)。我不知道如何强制显示这个授权对话框。没有abd_key。.android目录下的Pub文件。 当我试图读取cpu信息DDMS说:

[2014-04-15 12:47:06 - DDMS] device unauthorized. Please check the confirmation dialog on your device.

什么好主意吗?是否可以在没有确认对话框的情况下手动生成密钥?

USB连接

无线连接


当前回答

简单地,关闭设备上的开发人员选项,然后再次打开,将USB与设备和工作系统连接,并打开USB调试。

其他回答

由于某种原因,设备可能不再在ADB上获得授权。

1. 检查是否授权:

<ANDROID_SDK_HOME>\platform-tools>adb devices
List of devices attached
4df798d76f98cf6d        unauthorized

2. 取消USB调试电话

如果设备显示为未授权,请转到手机上的开发人员选项,然后单击“撤销USB调试授权”(用JellyBean和Samsung GalaxyIII测试)。

3.重启ADB服务器:

然后重启adb服务器

adb kill-server
adb start-server

4. 重新连接设备

设备将询问您是否同意连接计算机id。 你需要确认一下。

5. 现在检查设备

现在已被授权!

adb devices
<ANDROID_SDK_HOME>\platform-tools>adb devices
List of devices attached
4df798d76f98cf6d        device

尝试强制ADB创建新密钥。

在Linux / OSX: $ mv ~/。android / adbkey ~ / .android / adbkey.old $ mv ~/.android/adbkey。酒吧~ / .android / adbkey.pub.old $ adb kill-server $ adb启动服务器 在Windows 10上(谢谢,Pau Coma Ramirez, Naveen和d4c0d312!): 进入%HOMEPATH%\Android\.android\ 查找名为adbkey或adbkey.pub的文件。 删除这些文件。或者,为了安全起见,可以将它们移动到另一个目录。 在%USERPROFILE%\.android\中重复上述步骤 再试一次

在这之后,我甚至不需要拔掉我的手机:授权提示已经在那里了。

“设备未经授权”时,试图屏幕镜像华为

当我试图将一台老旧的华为Elite S6手机屏幕镜像到一台Windows 10 PC上时,我从sccpy的常见问题解答中被重新引导到这个问题。

手机开启USB调试,没有弹出授权调试窗口,strcpy在终端输出以下错误:

ERROR: Device is unauthorized:
ERROR:     -->   (usb)      AKTBBCB731702690      unauthorized
ERROR: A popup should open on the device to request authorization.
ERROR: Check the FAQ: <https://github.com/Genymobile/scrcpy/blob/master/FAQ.md>
ERROR: Server connection failed

解决方案主要涉及华为对Android的非标准修改:

Connect the phone to the PC with a USB cable. Drag down the notifications list from the top of the screen on the phone. An icon titled "USB Connected" should appear in the list Press "Photos" amongst the modes presented. This answer suggested selecting "Camera" as the connection type. Although Huawei doesn't use the same wording or menu structure, choosing "Photos" solved issues that the "Files" option doesn't support adb authentication, the "USB drive" option (which appeared to work initially) prevents or stops phone apps accessing files on the sd card if this connection option is chosen. Enable USB debugging if a popup appears.

在此阶段重新运行scopy可以正常工作,将鼠标和PC键盘输入到手机上的应用程序。在安装过程中不需要重新启动手机或PC -如果出现问题,请检查下面的提示。

scrcpy技巧

勾选设置中开发者选项下的“保持清醒”,以防止镜像手机时关闭屏幕,镜像完成时再次关闭屏幕。两者都可以在PC上执行。 关闭sccpy GUI窗口以自动终止Windows上的adb进程:不要只是关闭或中止运行sccpy .exe的终端窗口。

当我改变开发设备时,同样的问题开始出现,它被解决为:

$ mv ~/.android/adbkey ~/.android/adbkey.old
$ mv ~/.android/adbkey.pub ~/.android/adbkey.pub.old
$ adb kill-server
$ adb start-server

我在nexus7上也遇到了同样的问题。

以下工作解决了这个问题。

打开设备上“设置”菜单中的“开发人员”选项。 关闭屏幕右上方的按钮。 从菜单列表中删除所有调试权限。 打开屏幕右上角的按钮。

现在重新连接你的设备到你的电脑,一切都应该是好的。

对不起,我的英语很差,有些菜单(按钮)的名字用你们的语言可能不正确,因为我的是日语。