How to upgrade to the Developer Preview on Android M without Loosing data

Pin It

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!


Pre Requisites

  • 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.

Step 1

Install your extractor programme.

Step 2

If you haven’t already, grab the latest build of Android M from the download link above.

Step 3

Once you’ve downloaded the .tgz file, extract it using the unzipping prgramme we downloaded earlier.


Step 4

Inside the extracted .tgz file there will be a .zip file titled something like “” (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)

Step 5

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.

Step 6

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!

Step 7

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!

Subscribe To Get Latest Rooting Guides

Subscribe us to get all latest rooting guides and custom ROMs directly in your inbox.

Android VPN

Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge