Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save willtejeda/790f6ec75fda83b6a90f9fccbc0a9236 to your computer and use it in GitHub Desktop.

Select an option

Save willtejeda/790f6ec75fda83b6a90f9fccbc0a9236 to your computer and use it in GitHub Desktop.

Revisions

  1. @MacKentoch MacKentoch revised this gist May 30, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion android-adb-fastboot-must-know.md
    Original 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 <FILEN_NAME>.tar.gz.asc
    gpg --verify <FILE_NAME>.tar.gz.asc
    ```

    ### check sha256
  2. @MacKentoch MacKentoch revised this gist May 30, 2017. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion android-adb-fastboot-must-know.md
    Original 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:
    ### 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>
  3. @MacKentoch MacKentoch revised this gist May 30, 2017. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions android-adb-fastboot-must-know.md
    Original 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>
    ```
  4. @MacKentoch MacKentoch revised this gist May 6, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion android-adb-fastboot-must-know.md
    Original file line number Diff line number Diff line change
    @@ -42,7 +42,7 @@ fastboot reboot bootloader
    adb reboot recovery
    ```

    ## Unlock / erase / flash
    ## Unlock / erase / flash / sideload

    ### unlock bootloader
    ```bash
  5. @MacKentoch MacKentoch revised this gist May 6, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion android-adb-fastboot-must-know.md
    Original 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 explantation from [TWRP website](https://twrp.me/faq/ADBSideload.html)*
    *More complete explanation from [TWRP website](https://twrp.me/faq/ADBSideload.html)*

    1. reboot in recovery:
    ```bash
  6. @MacKentoch MacKentoch revised this gist May 6, 2017. 1 changed file with 34 additions and 0 deletions.
    34 changes: 34 additions & 0 deletions android-adb-fastboot-must-know.md
    Original 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
  7. @MacKentoch MacKentoch revised this gist May 5, 2017. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions android-adb-fastboot-must-know.md
    Original file line number Diff line number Diff line change
    @@ -60,14 +60,12 @@ fastboot oem lock
    ```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!
    > INFO: Unlocks the device. Allows flashing any partition except bootloader-related partitions
    ### 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
  8. @MacKentoch MacKentoch revised this gist May 5, 2017. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions android-adb-fastboot-must-know.md
    Original 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
  9. @MacKentoch MacKentoch revised this gist May 3, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion android-adb-fastboot-must-know.md
    Original file line number Diff line number Diff line change
    @@ -34,7 +34,7 @@ adb reboot bootloader
    ```

    ```bash
    fastboot reboot-bootloader
    fastboot reboot bootloader
    ```

    ### recovery reboot
  10. @MacKentoch MacKentoch revised this gist May 3, 2017. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions android-adb-fastboot-must-know.md
    Original 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
  11. @MacKentoch MacKentoch revised this gist May 3, 2017. 1 changed file with 14 additions and 1 deletion.
    15 changes: 14 additions & 1 deletion android-adb-fastboot-must-know.md
    Original 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 for exmaple: `bootloader`, `recovery`...).
    Erase partition xxx.
    Partition could be:
    - `boot`,
    - `cache`,
    - `recovery`
    - `system`,
    - `radio`,
    - `userdata`,
    - `bootloader`


    ### flash
    ```bash
  12. @MacKentoch MacKentoch revised this gist May 2, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions android-adb-fastboot-must-know.md
    Original 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

  13. @MacKentoch MacKentoch revised this gist May 2, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions android-adb-fastboot-must-know.md
    Original 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
  14. @MacKentoch MacKentoch revised this gist May 2, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions android-adb-fastboot-must-know.md
    Original 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 destination_directory\backup.ab
    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 destination_directory\backup.ab`
    - `-f computer_destination_directory\backup.ab`
    - define a directory

    ### restore
    ```bash
    adb retore source_directory\backup.ab
    adb retore computer_source_directory\backup.ab
    ```

  15. @MacKentoch MacKentoch revised this gist May 2, 2017. 1 changed file with 7 additions and 5 deletions.
    12 changes: 7 additions & 5 deletions android-adb-fastboot-must-know.md
    Original 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 apk | won't include apk
    - include or not apk
    - `-shared` OR `-noshared`:
    - include or not files from `sdcard`
    - `-f destination_directory\backup.ab`
    - define a directory

    ### restore
    ```bash
    adb install fileName.apk
    ```
    ```bash
    adb install fileName.apk
    adb retore source_directory\backup.ab
    ```

  16. @MacKentoch MacKentoch revised this gist May 2, 2017. 1 changed file with 42 additions and 3 deletions.
    45 changes: 42 additions & 3 deletions android-adb-fastboot-must-know.md
    Original 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 newBootloader.img
    fastboot flash bootloader new_bootloader.img
    ```
    - flash radio with a new radio image:
    ```bash
    fastboot flash radio newRadio.img
    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 /someComputerDirectory
    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
    ```
  17. @MacKentoch MacKentoch revised this gist May 2, 2017. 1 changed file with 33 additions and 3 deletions.
    36 changes: 33 additions & 3 deletions android-adb-fastboot-must-know.md
    Original file line number Diff line number Diff line change
    @@ -61,8 +61,38 @@ fastboot flash xxx yyy
    ```

    Flash partition xxx with new yyy.
    For exmaple:

    - ```bash
    fastboot flash xxx 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

  18. @MacKentoch MacKentoch revised this gist May 2, 2017. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion android-adb-fastboot-must-know.md
    Original file line number Diff line number Diff line change
    @@ -53,7 +53,16 @@ fastboot oem lock
    fastboot erase xxx
    ```

    Erase partition 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
    ```
  19. @MacKentoch MacKentoch revised this gist May 2, 2017. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions android-adb-fastboot-must-know.md
    Original file line number Diff line number Diff line change
    @@ -40,19 +40,20 @@ adb reboot recovery
    ```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!
    > 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
    > 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
    fastboot erase xxx
    ```

    Erase partition xxx
    ### flash


  20. @MacKentoch MacKentoch revised this gist May 2, 2017. 1 changed file with 23 additions and 0 deletions.
    23 changes: 23 additions & 0 deletions android-adb-fastboot-must-know.md
    Original 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


  21. @MacKentoch MacKentoch revised this gist May 2, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion android-adb-fastboot-must-know.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    # adb and fastboot must know

    Install android SDK.
    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*).

  22. @MacKentoch MacKentoch renamed this gist May 2, 2017. 1 changed file with 15 additions and 1 deletion.
    Original file line number Diff line number Diff line change
    @@ -16,5 +16,19 @@ adb devices
    fastboot devices
    ```

    ## reboot
    ## Reboot

    ### normal reboot
    ```bash
    adb reboot
    ```

    ### bootloader reboot
    ```bash
    adb reboot bootloader
    ```

    ### recovery reboot
    ```bash
    adb reboot recovery
    ```
  23. @MacKentoch MacKentoch created this gist May 2, 2017.
    20 changes: 20 additions & 0 deletions android-adb-fastboot-umust-know.md
    Original 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