最近我用adb隐藏了一堆旧手机包（verizon 2013 moto x）我打算用于开发。我隐藏了大多数与之相关的软件包，包括SIM工具包和电话服务，但现在一个对话框说，只要我尝试使用手机，就会连续显示"手机已停止" 。我试图取消隐藏我HID的大部分内容，但隐藏包不会出现在
pm list packages 的输出中。有没有办法查看所有这些包和/或取消隐藏它们？我宁愿不必出厂重置它。
Recently I used ADB to hide a bunch of packages on an old phone (Verizon 2013 Moto X) I intend to use for development. I hid most of the phone-related packages, including the SIM Toolkit and the telephony service, but now a dialog saying that "Phone has stopped" shows up continuously whenever I try to use the phone. I've tried to unhide most of the ones I hid, but hidden packages don't appear in the output of
pm list packages. Is there any way to see all of these packages and/or unhide them? I'd rather not have to factory reset it.
If you run
adb shell pm you would find many options and parameters for pm. One of the parameter is
-u to show uninstalled packages. (Hidden packages are treated as uninstalled packages.)
On an unrooted device, make a list of all the packages and then all the packages plus the hidden ones. Compare them and the uncommon entries in the second list would be the packages you are looking for.
adb shell pm list packages adb shell pm list packages -u
As for rooted devices, search the string
hidden="true" in the file at
/data/system/users/0/packages-restrictions.xml. You would see the corresponding package name.
Tested with Stock Android 6.0.1.