Android on Google Nexus Devices

Description

This document will explain how to install Android 6.0 or install / update to Android 6.0.1. Other topics covered are custom recovery images and rooting the device.

Software Tools Needed

These things will be needed at various stages to facilitate the install process. In this document we’re using a Google Nexus 5 by LG, codename “Hammerhead”.

Android Developer
http://developer.android.com/about/versions/marshmallow/index.html

Android Studio & SDK (Software Development Kit)
http://developer.android.com/sdk/index.html
http://developer.android.com/sdk/index.html#Other

Alternatively, adb_tools_treiber.zip (Recommended)
https://drive.google.com/file/d/0BwY1hTQPtoEQSU9aZ19kUEgwYUU/view?pref=2&pli=1

Google Nexus Factory Android Images
https://developers.google.com/android/nexus/images?hl=en

Google USB Driver
http://developer.android.com/sdk/win-usb.html

ADB (Android Debug Bridge) Commands & Help
http://developer.android.com/tools/help/adb.html

ADB (Android Debug Bridge) Driver
http://adbdriver.com/downloads/

TWRP Recovery
https://twrp.me/Devices/


Screenshots


Installing Android 6.0

Here we’ll be installing Android 6.0. Since we’re coming from a pre-6.0 version of Android we’ll wipe all previous data. Make sure you’ve backed up your apps and data before proceeding.

  1. Extract the Android factory image you downloaded and locate the following files:
    • bootloader-hammerhead-hhz12k.img
    • radio-hammerhead-m8974a-2.0.50.2.27.img
    • boot.img
    • system.img
    • cache.img
    • userdata.img
    • recovery.img
  2. Move these files to the following directory
  3. /adb-tools_treiber/adb-tools/

  4. Boot your phone into the recovery mode (see screenshots)
  5. Depending on the recovery image you have installed, locate and delete/wipe the following:
    • Cache partition
    • Dalvik Cache
    • Factory Reset data
  6. Reboot your phone into the bootloader mode (see screenshots)
  7. Navigate on the command line to the following directory where you unzipped adb-tools_treiber on your computer
  8. /adb-tools_treiber/adb-tools/

  9. From the command line in the above directory, give the following commands after letting each previous command complete:
  10. Install Android Bootloader
  11. fastboot flash bootloader bootloader-hammerhead-hhz12k.img
    fastboot reboot-bootloader

  12. Install Device Radio Firmware
  13. fastboot flash radio radio-hammerhead-m8974a-2.0.50.2.27.img
    fastboot reboot-bootloader

  14. Install Android Boot Partition
  15. fastboot flash boot boot.img

  16. Install Android System
  17. fastboot flash system system.img

  18. Install Android System Cache Partition
  19. fastboot flash cache cache.img

  20. Install Android Userdata
  21. fastboot flash userdata userdata.img

  22. Install Android Recovery (see optional recovery)
  23. fastboot flash recovery recovery.img

Updating a currently running Android 6.0 system to 6.0.1

Here we’ll update Android 6.0 to 6.0.1 and preserve the apps and data. As always, Make sure you’ve backed up your apps and data before proceeding

  1. Download the Android 6.0.1 full image for your Nexus device.
  2. https://developers.google.com/android/nexus/images?hl=en

  3. Extract the files and locate the following 3 files:
  4. Move these files to the following directory
  5. /adb-tools_treiber/adb-tools/

  6. Boot your phone into the bootloader mode (see screenshots)
  7. Navigate on the command line to the following directory where you unzipped adb-tools_treiber.zip on your computer
  8. /adb-tools_treiber/adb-tools/

  9. From the command line in the above directory:
  10. Install Device Radio Firmware
  11. fastboot flash radio radio-hammerhead-m8974a-2.0.50.2.28.img
    fastboot reboot-bootloader

  12. Install Android Bootloader
  13. fastboot flash boot boot.img

  14. Install Android System
  15. fastboot flash system system.img







Optional Steps: Alternate TWRP Recovery Image

Installing the alternate TWRP recovery image on your device for added features and benefits. This is safe to do and will not damage your phone. There are several alternative recovery images and system managers beside TWRP such as ClockworkMod. Read more about recovery mods / images at CyanogenMod.

  1. Download the TWRP recovery image for your Nexus device.
  2. https://twrp.me/Devices/

  3. Move these files to the following directory
  4. /adb-tools_treiber/adb-tools/

  5. Boot your phone into the bootloader mode
  6. Navigate to the following directory where you unzipped adb-tools_treiber.zip on your computer
  7. /adb-tools_treiber/adb-tools/

  8. From the command line in the above directory, give the following command:
  9. fastboot flash recovery twrp-2.8.7.1-hammerhead.img


Optional Steps: Device Rooting

Using TWRP Recovery image we’ll boot the system into recovery mode and install the .zip files below to gain root access to the system.

WARNING: Security Note: Rooting your phone will make it less secure by default but give you more control over certain aspects of the system. Developers will want this for testing or otherwise exploring the device unhindered. For standard users that do not understand the implications of these steps, stop and do not proceed.

  1. Install TWRP Recovery image (see above)
  2. fastboot flash recovery twrp-2.8.7.1-hammerhead.img

    Download the following files using your phone’s web browser, the reboot your phone into TWRP and install the zips from your phone’s Downloads folder in order below: first ElementalX, then SuperSU.

  3. Install ElementalX Kernel
  4. N5-ElementalX-6.0.zip (Android 6.0.x)

  5. Install SuperSU (Android 6.0.x)
  6. BETA-SuperSU-v2.52.zip

Note: If you have a problem with the battery displaying as4,012%” or similar, download WugFresh Nexus Root Toolkit v2.1.0 – NRT_v2.1.0.sfx.exe

nrt_main_210
Follow these steps if you have the above battery problem after rooting:

  1. Re-flash system.img and boot.img (will not destroy data or user info)
  2. Reboot and verify the battery indicator is back to normal and reading correctly
  3. Reboot into TWRP recovery and install SuperSU-v2.64.zip or higher
  4. Clear / delete the Dalvik Cache and Cache
  5. Reboot the system, *declining* the message from TWRP that your device is not rooted,

After doing this your phone should be rooted and the battery indicator fixed.

Note: After doing this, every time you boot into TWRP recovery (until an update fixes it), it will always ask on exit / reboot if you want to root your device. It’s important you say “no” to this every time or the battery issues will start again.


Optional Steps: Linux Distro on Android

Install your distro of Linux on your Android device.

http://linuxonandroid.org/

Last Modified: 20 Apr, 2020 at 22:02:46