本文介绍了通过adb shell pm删除域包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有一条命令可以减轻管理Android手机软件包的痛苦,
There is a command to ease the pain of managing packages for Android phone,
adb shell pm uninstall org.kde.necessitas.example.one
adb shell pm uninstall org.kde.necessitas.example.two
但是我有很多电话,只想删除它们上特定域中的所有软件包。
But I have many phones and just want to delete all packages from a particular domain on them.
这是不行的
adb shell pm uninstall org.kde.necessitas.example.*
您的建议是什么?
推荐答案
您可以在批处理文件中使用以下内容:(我假设
You can use the following in a batch file: (I am assuming Windows though)
adb shell pm list packages org.kde.necessitas.example > packages.txt
for /F "tokens=2 delims=:" %%a in (packages.txt) do adb shell pm uninstall %%a
您可以更进一步,并将搜索文本作为参数:
You could take it a step further and make the search text a parameter:
adb shell pm list packages %1 > packages.txt
for /F "tokens=2 delims=:" %%a in (packages.txt) do adb shell pm uninstall %%a
这会将 pm列表包的输出通过管道传输到文本文件中,然后循环遍历每个文件文本文件的一行。对于行中的每个第二个令牌,本例中为软件包名称,调用
adb shell pm卸载
。
这篇关于通过adb shell pm删除域包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!