adb卸载失败 [英] adb uninstall failed

查看:922
本文介绍了adb卸载失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一些示例应用程序。

调试这些应用程序后,在设备的应用程序管理中看不到卸载按钮。

当我执行adb卸载时,它总是说失败而无故。

在DDMS中,我看到我的apk存储在 / data / app / com中.k2g.leaveDemo-1.apk

我不确定我缺少什么。

我总是必须重置设备才能摆脱掉这些应用程序:(

I am writing some sample apps.
After I debug these apps, I don't see an uninstall button in my device's application management.
When I do adb uninstall, it always says Failure without any reason.
In DDMS I saw that my apk is stored in /data/app/com.k2g.leaveDemo-1.apk.
I am not sure what am I missing.
I always have to reset my device to get rid of these apps :(

我需要签名吗?

我需要在调试模式下做什么吗?

还是取决于版本?

Do I need to do sign something?
Do I need to do something in debug mode?
Or does it depend on the version?

我正在使用Samsung S2。

I am using Samsung S2.

推荐答案

是的,移动设备管理会带来自己的问题,但我敢打赌失败是一个dos2unix问题,在我的Linux机器上,adb附加了一个DOS换行符,这会导致失败,因为卸载认为CR字符是包名称的一部分。还要从包1.apk文件名的末尾删除 -1.apk。

Yes, mobile device management would bring its own problems, but i bet 'Failure' is a dos2unix problem. On my Linux machines, adb is appending a DOS newline which causes 'Failure' because uninstall thinks the CR character is part of the package name. Also remove '-1.apk' from the end of the package-1.apk filename.

adb root
adb shell
pm list packages
pm uninstall com.android.chrome

在我的情况下,我的手机处于永久安全模式,因此只有/ system / app /下的应用程序才能运行。因此,我安装了它们以复制.apk文件,然后批量卸载并复制到/ system / app /,擦除/ cache并重新启动。

In my case, i have a phone that is in permanent 'Safe mode' so only apps under /system/app/ have a chance of running. So i install them to get the .apk files copied off, then uninstall in bulk and copy to /system/app/, wipe the /cache and reboot. Now i have more apps running even though in safe mdoe.

# adb root
# pm list packages -3 > /root/bulkuninstall.txt
# vi /root/bulkuninstall.txt  and check ^M characters at end of each line.   
   If ^M, then must run dos2unix /root/bulkuninstall.txt.  
   Remove '-1.apk' using vi search and replace:  
        :%s/-1\.apk//g 
   Or sed...

# cp /data/app/* /storage/sdcard1/APKs/
# for f in `cat /root/bulkuninstall.txt`; do echo $f; pm uninstall $f; done;
# 
# echo Now remount system and copy the APK files to /system/app/
# mount | grep system
# mount -o remount,rw /dev/block/(use block device from previous step)  /system 
# cp /storage/sdcard1/APKs/* /system/app/
# reboot

清除缓存
的电源。

wipe cache power on.

这篇关于adb卸载失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆