gpt4 book ai didi

android - 如何在android中使用adb恢复出厂设置?

转载 作者:IT王子 更新时间:2023-10-29 00:07:38 28 4
gpt4 key购买 nike

如何使用 ADB 命令在 android 中恢复出厂设置?我曾使用 adb reboot recovery 命令进行重置。但是第三方应用程序无法清除。使用ADB实现的正确方法是什么?

实际上,我想通过 java 代码对 android 设备进行出厂重置。这里有什么解决办法?

最佳答案

您可以在 adb 中发送 Intent MASTER_CLEAR:

adb shell am broadcast -a android.intent.action.MASTER_CLEAR

或以 root 身份

adb shell  "su -c 'am broadcast -a android.intent.action.MASTER_CLEAR'"

Android 8.0 及以上版本,从 shell 获得 root 权限

am broadcast -p "android" --receiver-foreground -a android.intent.action.FACTORY_RESET

关于android - 如何在android中使用adb恢复出厂设置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14685721/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com