web-dev-qa-db-fra.com

Comment puis-je réinitialiser l'usine à l'aide d'Adb dans Android?

Comment puis-je réinitialiser les paramètres d'usine dans Android à l'aide de la commande ADB? J'avais utilisé la commande adb reboot recovery pour être réinitialisé. Mais les applications tierces ne pouvaient pas être effacées d'une manière ou d'une autre. en utilisant la BAD?

En fait, je veux faire une réinitialisation d'usine Android appareils via Java code.Quelle solution peut-elle être trouvée ici?

37
Prashant

Vous pouvez envoyer une intention MASTER_CLEAR dans adb:

adb Shell am broadcast -a Android.intent.action.MASTER_CLEAR

ou en tant que racine

adb Shell  "su -c 'am broadcast -a Android.intent.action.MASTER_CLEAR'"
74
0x8BADF00D

Essayez:

adb Shell
recovery --wipe_data

Et voici la liste de arguments :

* The arguments which may be supplied in the recovery.command file:
 *   --send_intent=anystring - write the text out to recovery.intent
 *   --update_package=path - verify install an OTA package file
 *   --wipe_data - erase user data (and cache), then reboot
 *   --wipe_cache - wipe cache (but not user data), then reboot
 *   --set_encrypted_filesystem=on|off - enables / diasables encrypted fs
21
EvZ

Attention

De @sidharth: "a fait que mon lave-iris alfa est entré dans un bootloop :("


Pour mon Motorola Nexus 6 sous Android Marshmallow 6.0.1, j’ai fait:

adb devices       # Check the phone is running
adb reboot bootloader
# Wait a few seconds
fastboot devices  # Check the phone is in bootloader
fastboot -w       # Wipe user data
14
Robin Winslow

Je l'ai fait à partir du mode fastboot (Phone - Xiaomi Mi5 Android 6.0.1)

Voici les étapes:

# check if device available
fastboot devices
# remove user data
fastboot erase userdata
# remove cache
fastboot erase cache 
# reboot device
fastboot reboot
10
Kison