Forked from MacKentoch/android-adb-fastboot-must-know.md
Created
April 29, 2020 09:01
-
-
Save willtejeda/790f6ec75fda83b6a90f9fccbc0a9236 to your computer and use it in GitHub Desktop.
Revisions
-
MacKentoch revised this gist
May 30, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -215,7 +215,7 @@ $ md5 <FILE_NAME> Note: you need [GnuPG](https://www.gnupg.org/) ```bash gpg --verify <FILE_NAME>.tar.gz.asc ``` ### check sha256 -
MacKentoch revised this gist
May 30, 2017 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -206,11 +206,18 @@ adb retore computer_source_directory\backup.ab ## Bonus: check signature of a downloaded file ### check MD5 (*LineageOS for exmaple uses md5 signature*): ```bash $ md5 <FILE_NAME> ``` ### check GPG Note: you need [GnuPG](https://www.gnupg.org/) ```bash gpg --verify <FILEN_NAME>.tar.gz.asc ``` ### check sha256 ```bash shasum -a 256 <FILE_NAME> -
MacKentoch revised this gist
May 30, 2017 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -204,3 +204,14 @@ Parameters: adb retore computer_source_directory\backup.ab ``` ## Bonus: check signature of a downloaded file ### check MD5: ```bash $ md5 <FILE_NAME> ``` ### check sha256 ```bash shasum -a 256 <FILE_NAME> ``` -
MacKentoch revised this gist
May 6, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,7 +42,7 @@ fastboot reboot bootloader adb reboot recovery ``` ## Unlock / erase / flash / sideload ### unlock bootloader ```bash -
MacKentoch revised this gist
May 6, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -75,7 +75,7 @@ But in some *rare* weird cases you may have accidently erased system partition d > `adb sideload` will help you then to flash from your TWRP recovery with ROM from your computer. *More complete explanation from [TWRP website](https://twrp.me/faq/ADBSideload.html)* 1. reboot in recovery: ```bash -
MacKentoch revised this gist
May 6, 2017 . 1 changed file with 34 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -67,6 +67,40 @@ fastboot flashing unlock fastboot flashing lock ``` ### sideload Most of the time when flashing ROMS or MODS you will *first download* it into the device first then you will enter *TWRP recovery* for *flashing it from there*. But in some *rare* weird cases you may have accidently erased system partition don't have access to sdcards or you forgot to download your image / zip. > `adb sideload` will help you then to flash from your TWRP recovery with ROM from your computer. *More complete explantation from [TWRP website](https://twrp.me/faq/ADBSideload.html)* 1. reboot in recovery: ```bash adb reboot recovery ``` 2. in TWRP go menus: - `advanced` - `ADB sideload` *Note : better check wipe caches before swiping from there* 3. from your computer terminal: check your see your devices: ```bash adb devices ``` sideload ( = push + flash): ```bash adb sideload YOUR_ROM.zip ``` ### erase ```bash -
MacKentoch revised this gist
May 5, 2017 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -60,14 +60,12 @@ fastboot oem lock ```bash fastboot flashing unlock ``` > INFO: Unlocks the device. Allows flashing any partition except bootloader-related partitions ### lock flashing ```bash fastboot flashing lock ``` ### erase -
MacKentoch revised this gist
May 5, 2017 . 1 changed file with 14 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -56,6 +56,20 @@ fastboot oem lock ``` > WARNING: If you lock back the bootloader, next time you need to unlock data will still behave like a factory reset ### unlock flashing ```bash fastboot flashing unlock ``` > WARING: If you if you unlock the bootloader it will behave like a factory reset. So backup all your data before! ### lock flashing ```bash fastboot flashing lock ``` > WARNING: If you lock back the bootloader, next time you need to unlock data will still behave like a factory reset ### erase ```bash fastboot erase xxx -
MacKentoch revised this gist
May 3, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -34,7 +34,7 @@ adb reboot bootloader ``` ```bash fastboot reboot bootloader ``` ### recovery reboot -
MacKentoch revised this gist
May 3, 2017 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,6 +24,10 @@ fastboot devices adb reboot ``` ```bash fastboot reboot ``` ### bootloader reboot ```bash adb reboot bootloader -
MacKentoch revised this gist
May 3, 2017 . 1 changed file with 14 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,6 +29,10 @@ adb reboot adb reboot bootloader ``` ```bash fastboot reboot-bootloader ``` ### recovery reboot ```bash adb reboot recovery @@ -53,7 +57,16 @@ fastboot oem lock fastboot erase xxx ``` Erase partition xxx. Partition could be: - `boot`, - `cache`, - `recovery` - `system`, - `radio`, - `userdata`, - `bootloader` ### flash ```bash -
MacKentoch revised this gist
May 2, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -131,6 +131,8 @@ Parameters: - include or not apk - `-shared` OR `-noshared`: - include or not files from `sdcard` - `-all` - Save system files and applications files (wihtout apk files) - `-f computer_destination_directory\backup.ab` - define a directory -
MacKentoch revised this gist
May 2, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -119,6 +119,8 @@ When you launch a backup command a `password` for this backup will be asked. adb backup -all ``` Note: backup `backup.ab` is placed inside `platform-tools` by default. #### backup parametized (*less simple but accurate*) ```bash -
MacKentoch revised this gist
May 2, 2017 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -122,18 +122,18 @@ adb backup -all #### backup parametized (*less simple but accurate*) ```bash adb backup -apk -shared -all -f computer_destination_directory\backup.ab ``` Parameters: - `-apk` OR `_noapk`: - include or not apk - `-shared` OR `-noshared`: - include or not files from `sdcard` - `-f computer_destination_directory\backup.ab` - define a directory ### restore ```bash adb retore computer_source_directory\backup.ab ``` -
MacKentoch revised this gist
May 2, 2017 . 1 changed file with 7 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -111,6 +111,8 @@ adb install file_name.apk ### backup When you launch a backup command a `password` for this backup will be asked. #### backup all (*simple*) ```bash @@ -124,14 +126,14 @@ adb backup -apk -shared -all -f destination_directory\backup.ab ``` Parameters: - `-apk` OR `_noapk`: - include or not apk - `-shared` OR `-noshared`: - include or not files from `sdcard` - `-f destination_directory\backup.ab` - define a directory ### restore ```bash adb retore source_directory\backup.ab ``` -
MacKentoch revised this gist
May 2, 2017 . 1 changed file with 42 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -66,11 +66,11 @@ For example: - flash bootloader with a new bootloaler image: ```bash fastboot flash bootloader new_bootloader.img ``` - flash radio with a new radio image: ```bash fastboot flash radio new_radio.img ``` ## File explorer @@ -92,7 +92,46 @@ Copy a file `FILE` to device's sdcard. ### copy files from device to computer ```bash adb pull FILE /some_computer_directory ``` Copy a file `FILE` to computer's directory ### remount ```bash adb remount ``` ### install apk ```bash adb install file_name.apk ``` ## Backup and Restore (NO ROOT NEEDED) ### backup #### backup all (*simple*) ```bash adb backup -all ``` #### backup parametized (*less simple but accurate*) ```bash adb backup -apk -shared -all -f destination_directory\backup.ab ``` Parameters: - `-apk` OR `_noapk`: - include apk | won't include apk - `-shared` OR `-noshared`: - include or not files from `sdcard` ### restore ```bash adb install fileName.apk ``` ```bash adb install fileName.apk ``` -
MacKentoch revised this gist
May 2, 2017 . 1 changed file with 33 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -61,8 +61,38 @@ fastboot flash xxx yyy ``` Flash partition xxx with new yyy. For example: - flash bootloader with a new bootloaler image: ```bash fastboot flash bootloader newBootloader.img ``` - flash radio with a new radio image: ```bash fastboot flash radio newRadio.img ``` ## File explorer ### Explore files (use linux commands) ```bash adb shell ``` ### copy files from computer to device ```bash adb push FILE /sdcard ``` Copy a file `FILE` to device's sdcard. ### copy files from device to computer ```bash adb pull FILE /someComputerDirectory ``` Copy a file `FILE` to computer's directory -
MacKentoch revised this gist
May 2, 2017 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -53,7 +53,16 @@ fastboot oem lock fastboot erase xxx ``` Erase partition xxx (partition could be for exmaple: `bootloader`, `recovery`...). ### flash ```bash fastboot flash xxx yyy ``` Flash partition xxx with new yyy. For exmaple: - ```bash fastboot flash xxx yyy ``` -
MacKentoch revised this gist
May 2, 2017 . 1 changed file with 4 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,19 +40,20 @@ adb reboot recovery ```bash fastboot oem unlock ``` > WARING: If you if you unlock the bootloader it will behave like a factory reset. So backup all your data before! ### lock bootloader ```bash fastboot oem lock ``` > WARNING: If you lock back the bootloader, next time you need to unlock data will still behave like a factory reset ### erase ```bash fastboot erase xxx ``` Erase partition xxx ### flash -
MacKentoch revised this gist
May 2, 2017 . 1 changed file with 23 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -33,3 +33,26 @@ adb reboot bootloader ```bash adb reboot recovery ``` ## Unlock / erase / flash ### unlock bootloader ```bash fastboot oem unlock ``` > Warning: If you if you unlock the bootloader it will behave like a factory reset. So backup all your data before! ### lock bootloader ```bash fastboot oem lock ``` > Warning: If you lock back the bootloader, next time you need to unlock data will still behave like a factory reset ### erase ```bash fastboot oem unlock ``` ### flash -
MacKentoch revised this gist
May 2, 2017 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ # adb and fastboot must know Install [android SDK](https://developer.android.com/studio/index.html) (bottom of the page) or full [android studio](https://developer.android.com/studio/index.html) if you need to develop on android. `fastboot` looks like `adb` but it is used when device is in `bootloader` (*or fastboot*). -
MacKentoch renamed this gist
May 2, 2017 . 1 changed file with 15 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,5 +16,19 @@ adb devices fastboot devices ``` ## Reboot ### normal reboot ```bash adb reboot ``` ### bootloader reboot ```bash adb reboot bootloader ``` ### recovery reboot ```bash adb reboot recovery ``` -
MacKentoch created this gist
May 2, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ # adb and fastboot must know Install android SDK. `fastboot` looks like `adb` but it is used when device is in `bootloader` (*or fastboot*). ## Check connected devices ### adb: ```bash adb devices ``` ### fastboot ```bash fastboot devices ``` ## reboot