【整理】ADT中调试app心得:有时候不能调试,需要卸载旧的app,然后才能重新继续调试

【背景】

之前用ADT去调试某个android的app时,出现问题:

无法调试了。

console中log是:

[2013-11-26 15:58:49 - xxxxxx] Android Launch!
[2013-11-26 15:58:49 - xxxxxx] adb is running normally.
[2013-11-26 15:58:49 - xxxxxx] Performing com.yyy.xxxxxx.activities.MainActivity activity launch
[2013-11-26 15:58:49 - xxxxxx] Refreshing resource folders.
[2013-11-26 15:58:49 - xxxxxx] Starting incremental Pre Compiler: Checking resource changes.
[2013-11-26 15:58:49 - xxxxxx] Nothing to pre compile!
[2013-11-26 15:58:49 - xxxxxx] Starting incremental Package build: Checking resource changes.
[2013-11-26 15:58:49 - xxxxxx] Skipping over Post Compiler.
[2013-11-26 15:58:49 - OpenFile] Refreshing resource folders.
[2013-11-26 15:58:49 - USBDemoTest] Refreshing resource folders.
[2013-11-26 15:58:49 - USBDemoTest] Starting incremental Pre Compiler: Checking resource changes.
[2013-11-26 15:58:49 - USBDemoTest] Nothing to pre compile!
[2013-11-26 15:58:49 - UsbSerialExamples] Refreshing resource folders.
[2013-11-26 15:58:49 - UsbSerialExamples] Starting incremental Pre Compiler: Checking resource changes.
[2013-11-26 15:58:49 - UsbSerialExamples] Nothing to pre compile!
[2013-11-26 15:59:05 - xxxxxx] Uploading xxxxxx.apk onto device 'c080846d3761911'
[2013-11-26 15:59:05 - xxxxxx] Installing xxxxxx.apk...
[2013-11-26 15:59:08 - xxxxxx] Re-installation failed due to different application signatures.
[2013-11-26 15:59:08 - xxxxxx] You must perform a full uninstall of the application. WARNING: This will remove the application data!
[2013-11-26 15:59:08 - xxxxxx] Please execute 'adb uninstall com.yyy.xxxxxx' in a shell.
[2013-11-26 15:59:08 - xxxxxx] Launch canceled!

如图:

Re-installation failed due to different application signatures you must

对应的原因是:

之前android的pad上面的此app是之前的某个版本,和当前新编译的版本不匹配。

所以需要去:

到android的pad中卸载此app

然后重新调试,就可以了:

[2013-11-26 16:01:44 - xxxxxx] Android Launch!
[2013-11-26 16:01:44 - xxxxxx] adb is running normally.
[2013-11-26 16:01:44 - xxxxxx] Performing com.yyy.xxxxxx.activities.MainActivity activity launch
[2013-11-26 16:01:47 - xxxxxx] Uploading xxxxxx.apk onto device 'c080846d3761911'
[2013-11-26 16:01:47 - xxxxxx] Installing xxxxxx.apk...
[2013-11-26 16:01:55 - xxxxxx] Success!
[2013-11-26 16:01:55 - xxxxxx] Starting activity com.yyy.xxxxxx.activities.MainActivity on device c080846d3761911
[2013-11-26 16:01:56 - xxxxxx] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.yyy.xxxxxx/.activities.MainActivity }
[2013-11-26 16:01:56 - xxxxxx] Attempting to connect debugger to 'com.yyy.xxxxxx' on port 8600

如图:

can continue to debug app using adt

所以:

如果以后遇到类似的,无法调试,看看是不是由于signature不匹配,如果是,则卸载旧的,重新调试(会自动安装新的),就可以正常调试了。



发表评论

电子邮件地址不会被公开。 必填项已用*标注

无觅相关文章插件,快速提升流量