Skip to content

Instantly share code, notes, and snippets.

@crazed
Last active September 7, 2023 22:20
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save crazed/7670423 to your computer and use it in GitHub Desktop.
Save crazed/7670423 to your computer and use it in GitHub Desktop.
getting a moto x back to stock on mac os x
  1. grab the moto-fastboot version of fastboot here

  2. grab the appropriate stock firmware here (tip: you want the one that matches your android build number in settings -> about phone)

  3. unzip this file somewhere and make it easy to run the moto-fastboot-osx64 command from step 1

  4. get your phone into fastboot mode, google it if needed but just power the phone off, hold the down volume key and power button for 3 seconds then let go, should get you there

  5. verify you are ready for flashing:

     ./moto-fastboot-osx64 devices
     -- should list a device --
    
  6. most of the time you just need to flash system and recovery images, so from your unzipped stock firmware files do this:

     ./moto-fastboot-osx64 flash recovery recovery.img
     ./moto-fastboot-osx64 flash system system.img
    

If you take a look at the XML file that came with the SBF package, you can get a good idea for what needs to happen to do a full stock restore. If you follow above, you won't lose any of your data and will be able to flash any OTAs without much difficulty. This also mostly applies to people that haven't flashed any custom ROMs and rather just rooted and may have tweaked a couple things.

@crzapata
Copy link

crzapata commented Dec 6, 2013

Lifesaver, or better yet, brick saver! Thanks for this!

@fakiesk8r333
Copy link

Oh thank you so much, i have a bootcamp partition i was using for restoring my x (plus gaming) and having this makes it so much easier to do. Now if only i could get safestrap to work.

@eexit
Copy link

eexit commented May 29, 2014

Thank you man!

@patdoyle1
Copy link

ERROR: Could not get pipe properties.

This was right after i called ./moto-fastboot-osx64 devices this device is plugged in and on. Currently running newest version of 4.1.2 trying to upgrade to kitkat

@dzg
Copy link

dzg commented Aug 25, 2014

Thanks for this; worked like a charm.
(I also flashed boot.img)

@mshevcov
Copy link

Hey there! And what needs to be done, that would remove the warning about an open boot loader?

Copy link

ghost commented Apr 22, 2015

I have the big problem that the side http://sbf.droid-developers.org/ghost_rcica/list.php seems to be down. Does anybody know an alternative side? Or knows where you can download stock images for the moto x xt1052?

@tcesenthil
Copy link

i ran the first command 'flash recovery' and this was the output in my mac Terminal
sending 'recovery' (10280 KB)... OKAY [ 0.339s]
writing 'recovery'... OKAY [ 1.812s]

and here was the messages in my Moto E (1st Gen)
USB Connecte
cmd: download: 00a0a000
cmd: flash:recovery

when i tried running the second command 'flash system' , i could not find a system.img . Instead am seeing system.img_sparsechunk.0 , system.img_sparsechunk.1 and system.img_sparsechunk.2

I tried running the following command in the Mac Termnial and it is still giving errors

./moto-fastboot-osx64 flash system ./MotoEFirmware.xml/system.img_sparsechunk.0
sending 'system' (243147 KB)... OKAY [ 7.840s]
writing 'system'... INFOInvalid signed image
INFOPreflash validation failed
FAILED (remote failure)

corresponding results in my Moto E is 'version downgraded for system' 'Invalid PIV signed system image'

what should i do next ?

@fabiobfava
Copy link

I can't get moto-fastboot to work on my macOS Mojave. I've made a copy of it into /usr/bin/ and reboot, but it always give mes this error --> ERROR: Couldn't create a device interface iterator: (e00002bd)

I also always have signature failure so fastboot doesn't flash the .img original files I've downloaded from Motorola website. This is why I would like to try moto-fastboot instead.

Any clue of what I can do to have it working? Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment