Created
October 24, 2015 11:04
-
-
Save djhworld/fc6f6409f385b9cbc085 to your computer and use it in GitHub Desktop.
flash nexus 5 to newer android version
This file contains 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 characters
function prompt { | |
echo $1 | |
read -p "Ready? " -n 1 -r | |
echo # (optional) move to a new line | |
if [[ $REPLY =~ ^[Yy]$ ]] | |
then | |
echo | |
else | |
echo "Quitting" | |
exit | |
fi | |
} | |
FOLDER=$1 | |
echo "FOLDER = $FOLDER" | |
prompt "Boot into bootloader mode" | |
./adb reboot bootloader | |
sleep 10 | |
./fastboot devices | |
prompt "Going to flash recovery image, system image and boot image" | |
./fastboot flash recovery $FOLDER/recovery.img | |
./fastboot flash system $FOLDER/system.img | |
./fastboot flash boot $FOLDER/boot.img | |
prompt "When the last flash is confirmed, use the volume rockers to choose 'Recovery mode' and confirm with the power button. | |
When you see the little Android lying with the red triangle warning sign on it, hold the power then press the volume up button to get to the recovery options. | |
When you got to the recovery options, select 'apply update from ADB' using the volume rockers again and press the power button to choose it." | |
./adb sideload $FOLDER/update.zip | |
prompt "When OTA update successfully installed, select 'reboot bootloader' from the recovery options again using the volume rockers and press the power button." | |
./fastboot flash recovery $FOLDER/twrp-2.8.7.1-hammerhead.img | |
prompt "When the flash is confirmed, use the volume rockers to choose 'Recovery mode' and confirm with the power button. | |
Now in the TWRP recovery menu, choose 'Advanced' > 'adb sideload'. Check both option, clear 'Dalvik-Cache' and 'Clear Cache' and swipe the bar to start sideload mode. Wait for device to say it's awaiting commands..." | |
./adb sideload $FOLDER/UPDATE-SuperSU-v2.40.zip | |
echo "Finished!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: you need to adapt the instructions here. Be careful, this script could brick your phone....
https://gist.github.com/eyecatchup/ec0a852428c19705380e
Download all the necessary files, then run the above script, with the first argument being the folder where you downloaded the files too