Android M has been released the past week at Google I/O 2015 and along with several new features, a host of Nexus devices have got access to the developer previews. However as this is a manual flash intended only for developers, the device internal storage gets flashed when you flash the images normally through ADB. However we have a workaround to save your app data and we are going to show you just that today!
- You must one of the few Nexus devices that Google has released factory images for the M Developer preview
- You must have the device boot loader unlocked. You can know how to do that from here. Be warned though, unlocking the boot loader deleted all user data, thus making this process redundant if you’re doing it for the first time.
- A text editor on your PC so that you can edit the flash script.
- A fair bit of preliminary coding knowledge and ADB installed.
- You will need to download all the factory images from here.
- You will also need an unzipping programme like Winrar.
Install your extractor programme.
If you haven’t already, grab the latest build of Android M from the download link above.
Once you’ve downloaded the .tgz file, extract it using the unzipping prgramme we downloaded earlier.
Inside the extracted .tgz file there will be a .zip file titled something like “image-volantis-MPZ44Q.zip” (Nexus 9), and after you extract that file, you’ll find the boot loader, OS image, vendor image, and a radio image (depending on the fact if your device has a cellular radio or not)
The “flash-all” script contains all of the commands necessary to flash the factory image onto your device. Before running it from the command line, we want to remove the flag that wipes your data.
In the file you extracted you’ll find two flash-all scripts as mentioned above. The flash-all script with the .bat extension works with the Windows command line while the .sh extension works with the Unix command line (OSX, Linux, etc).According to whichever OS you might be running, open up the proper script file using your preferred text editor and remove the “-w” from the file. “-w” is an ADB flag which wipes all of the user data which is the stuff that we want to save!
Once you’ve made the change, save your file, and open up a command line program and continue with the normal way of installing Android images from Google.
If you’re unsure of how to do that, do check out the guide on how to install Android M on Nexus devices from this article here!