这已经解决了几次,但我需要重新打开这个问题,因为没有一个答案可以工作或解释什么是错误的。我的手机是根植于 LGl45c,API 10,android 2.3.4。插入计算机后,logcat 中会出现“ADB 拒绝 shell 命令 (getprop):已关闭”。设备调试已开启,它接受未知来源,USB 线是新的,应用程序中正确的 minSDK 为 8,maxSDK 为 17,DDMS 版本 21.1,ADT 版本 21.1。亚行似乎无法访问我手机的属性,因此在尝试调试两周前可以运行的应用程序时;
Android Launch!
[2013-05-05 07:53:45 - SurfaceViewAnimation] adb is running normally.
[2013-05-05 07:53:45 - SurfaceViewAnimation] Performing com.example.surfaceviewanimation.MainActivity activity launch
[2013-05-05 07:53:45 - SurfaceViewAnimation] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2013-05-05 07:53:52 - SurfaceViewAnimation] WARNING: Unknown device API version!
[2013-05-05 07:53:52 - SurfaceViewAnimation] Uploading SurfaceViewAnimation.apk onto device 'A00000318350B9'
[2013-05-05 07:53:52 - SurfaceViewAnimation] Installing SurfaceViewAnimation.apk...
[2013-05-05 07:53:52 - SurfaceViewAnimation] Failed to install SurfaceViewAnimation.apk on device 'A00000318350B9!
[2013-05-05 07:53:52 - SurfaceViewAnimation] closed
[2013-05-05 07:53:52 - SurfaceViewAnimation] Failed to install SurfaceViewAnimation.apk on device 'A00000318350B9': closed
[2013-05-05 07:53:52 - SurfaceViewAnimation] com.android.ddmlib.InstallException: closed
[2013-05-05 07:53:52 - SurfaceViewAnimation] Launch canceled!
打开终端后,adb 在路径中:
pete-mint14@petemint14-Latitude-D810 ~ $ adb devices
adb server is out of date. killing...
* daemon started successfully *
List of devices attached
A00000318350B9 device
在“调试:启用,接受未知来源:真”中拔下/重新插入手机会导致:
[2013-05-05 08:00:50 - ddms] ADB rejected shell command (pm install -r "/data/local/tmp/SurfaceViewAnimation.apk"): closed
[2013-05-05 08:00:50 - ddms] ADB rejected shell command (rm /data/local/tmp/SurfaceViewAnimation.apk): closed
[2013-05-05 08:01:04 - ddms] ADB rejected shell command (getprop): closed
因此,没有“在设备窗口中重新启动 adb”、“kill-server、restart-server”等。Eclipse 可以识别我的设备,但无法访问设备兼容性。由于 getprop、rm 和 pm 是 shell 命令,因此尝试在终端中以 root (su) 身份访问 shell:
petemint14-Latitude-D810 pete-mint14 # adb shell
error: closed
Eclipse 以 root 身份打开。所有应用程序在两周前运行,没有错误。我唯一能想到的是将自定义ROM下载到手机时出错。但是重新刷新到库存 ROM 显示相同的错误,并且它没有回答以下问题:ADB 试图访问什么(build.init ??),为什么终端工具“关闭”?
感谢您再次查看问题,我知道这很烦人,但是“拔下/插件”、重置 adb、重新启动计算机等的旧响应不起作用。我需要知道'...:关闭'是什么意思...