由于我重新安装了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连接

无线连接


当前回答

如果你在ubuntu上,试着以root用户运行服务器:

sudo adb kill-server

sudo adb start-server

其他回答

对我有用的步骤: 1. 断开手机usb线 2. 取消USB调试电话 3.重启设备 4. 重新连接设备 最重要的部分是重新启动设备。没有它就不行。

解决方案是复制你的文件~/.android/adbkey。pub(在GNU/Linux上,或%USERPROFILE%\.android\adbkey。将其放在/data/misc/adb/adb_keys目录下。您需要root权限才能做到这一点。

你可以用任何你喜欢(或能够)的方式传输文件,无论是USB、电子邮件还是临时文件上传服务。在我的情况下,因为它是一个新的Android-x86安装在虚拟机,没有可用的web浏览器,网络/TCP adb不能工作,我不得不实际输入715个字符。

至少它起作用了。

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

当我试图将一台老旧的华为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的终端窗口。

c:\users\_user_name \.android\adbkey

安装Android studio后,我对文件夹“~/”的权限不正确。Android”(只能对root用户进行读写访问)。所以我改变了它,从Android工作室运行项目(设备仍然被标记为“未经授权”)。

Android studio显示错误“安装apk错误”,但在文件夹“~/”。Android”被创建文件“adbkey”,“adbkey”。酒吧”、“debug.keystore”。

之后,我重新启动adb(运行命令adb kill-server和adb start-server),授权对话框出现在我的设备上。

希望有人能解决这个问题。