How-to -- Flash the 4.3 factory images to your Nexus

Jerry Hildenbrand

Space Cowboy
Staff member
Oct 11, 2009
5,576
2,815
113
Visit site
nexus_3.jpg


Waiting is never fun, and this time Google made sure folks with a Nexus 10, Nexus 7, Nexus 4 and GSM Galaxy Nexus don't have to. Once you've done this, you're left with a clean, factory-style device -- this means everything is erased and all your pictures, music and everything else is gone. Back that all up before you start!

[WARN]Make sure your bootloader is unlocked. Check your device section for more help. You can't continue with a locked bootloader![/WARN]

The process is actually pretty simple, and setting up your Windows computer is the hardest part. Let's dig in.

I. - Set up adb and fastboot on your computer

This isn't really hard, but it's often device specific (Windows drivers and all that) so if you need any help, check the hacking sub-forum for your device. The gist of it is:


  • Install adb and fastboot drivers in you're using Windows
  • Install the adb and fastboot binaries from the Android SDK for your platform (Win, Mac and Linux are supported)
  • adjust your PATH parameter or keep track of where you've installed adb and fastboot.

Once that's done, you've finished half the battle.

II. Download the factory image for your device

You can find them all here: Factory Images for Nexus Devices. Once you've downloaded it, you need to unpack the tar file. On Windows, use a program like 7-zip. On a Mac or a Linux computer, the included archive tool will extract them.

Once extracted, place the content of the folder in the same directory you have the fastboot binary installed. Keep the same file names.

III. Boot to the bootloader, and flash the images

Connect your Nexus to your computer via the USB port. Make sure you have USB debugging enabled. See here for more information about that.
Once connected, open the terminal or command prompt on your computer. Make sure you're in the folder where you have the fastboot binary and the files from the factory image download. While your phone is connected, run the following command:

Windows:
Code:
adb devices

Mac and Linux:
Code:
./adb devices

Look at the screen on your Nexus. You will have to authorize the USB connection if this is the first time you've connected your phone to your computer with debugging enabled. Choose YES to authorize it.

Your command line should return a serial number telling you everything is connected and communicating. If it doesn't, ask for assistance in your device section -- there are plenty of folks there who can help. If it does show you the serial number, proceed to the next step.

At the command line, enter the following command to boot into the bootloader:

Windows:
Code:
adb reboot-bootloader

Mac and Linux:
Code:
./adb reboot-bootloader

Don't unplug anything. Your Nexus should reboot into the bootloader, and you'll see the green robot and colorful text on a black screen. This is what you want.

Next, try this command to see if fastboot is set up correctly.

Windows:
Code:
fastboot devices

Mac and Linux:
Code:
./fastboot devices

As before, you're looking for the device serial number. If you don't see it, hit your device section. This is always the trickiest part when using Windows. If you see the serial number, carry on.

Look at the files you extracted from the image download. You're looking for the following: flash-all.bat (Windows) or flash-all.sh (Mac and Linux). These are the scripts that will flash the new boot image, system image, radio, or whatever other image files are needed for your device. Once you start them, never unplug your phone or interrupt the process in the command line!

If you're using Windows, enter the following in your terminal:
Code:
flash-all.bat

If you're using a Mac or Linux, use this command:
Code:
./flash-all.sh

You'll see all sorts of scrolling text, and your Nexus will restart at least once. You'll know when it's done because your command line will tell you it's finished and return you to the prompt.

[TIP]Protip: If you open the flash-all scripts with a text editor, you can see the individual commands they carry out. If you're familiar with scripting for your platform, you can modify these a little. Often folks will change the -w switch in the last command to keep their device from getting wiped clean. Do this sort of thing at your own risk, especially on the Nexus 7. You'll see it's flashing script is a little different than the others and it requires a bit more wiping and erasing your partitions. Per personal conversation with JBQ, this should be done every time you reinstall the factory images to your N7.[/TIP]

As usual, all the warnings about bricking devices and taking responsibility for your actions apply. Don't attempt this if you don't understand these instructions -- it's not worth bricking your Nexus because you were impatient.

Have fun, and good luck!
 
Last edited:

andr0idralphie

Well-known member
Oct 31, 2012
355
0
0
Visit site
Waiting? Wait? Like... not getting it now?
ಠ_ಠ






Side note: I had SERIOUS Wi-Fi problems after the 4.3 update, it turned out a firmware update to my router had everything running like butter again! ASUS RT-N66U
 

Paul627g

AC Moderator All-Star
Moderator
Nov 25, 2010
15,958
2,752
0
Visit site
Thanks for this Jerry. This should save a few repetitive questions on the subject.

Android 4.3 woo!

Sent from my Galaxy Nexus using AC Forums mobile app
 

cjshino

Active member
Sep 13, 2012
29
0
0
Visit site
i cant get cmd to recognize my nexus 4. i get this message 'not recognized as a internal or external command, operable program or batch file'
also on windows 8
 

cjshino

Active member
Sep 13, 2012
29
0
0
Visit site
At what point of the flash are you? What procedure are you following?

I downloaded the factory image of 4.3. So then I go to bootloader on my N4 plug it in my laptop then go to cmd and type abd devices but it wont go through
also I put the factory images in the SDK , platform tools folder. when i plug my N4 in my laptop and I go to device manager i see it as Google Nexus 4 device and i try to update the drivers but its up to date.
 

2defmouze

Well-known member
Jul 9, 2011
3,945
1,552
0
Visit site
i cant get cmd to recognize my nexus 4. i get this message 'not recognized as a internal or external command, operable program or batch file'
also on windows 8

I downloaded the factory image of 4.3. So then I go to bootloader on my N4 plug it in my laptop then go to cmd and type abd devices but it wont go through
also I put the factory images in the SDK , platform tools folder. when i plug my N4 in my laptop and I go to device manager i see it as Google Nexus 4 device and i try to update the drivers but its up to date.

Sounds like your command prompt is not IN the folder it needs to be. Hold shift and right-click in the platform-tools folder, and I believe you should see an option to Open command prompt here (I'm rusty with Windows so I'm going from memory here...). The first line of the command prompt should indicate that it is open in the correct, or incorrect, directory. Then proceed with the commands...
adb devices

etc

:)
 

cjshino

Active member
Sep 13, 2012
29
0
0
Visit site
Sounds like your command prompt is not IN the folder it needs to be. Hold shift and right-click in the platform-tools folder, and I believe you should see an option to Open command prompt here (I'm rusty with Windows so I'm going from memory here...). The first line of the command prompt should indicate that it is open in the correct, or incorrect, directory. Then proceed with the commands...
adb devices

etc

:)

Thanks for the help but I still get the same message
 

cjshino

Active member
Sep 13, 2012
29
0
0
Visit site
Thanks for the help but I still get the same message

Im guessing its my abd drivers? When I rooted I used Wugfresh to get automatically get my drivers. Since im one Windows 8 maybe I should uninstall those drivers and download Koushs universal drivers? or maybe its the windows 8 driver sign problem.
 

2defmouze

Well-known member
Jul 9, 2011
3,945
1,552
0
Visit site
Im guessing its my abd drivers? When I rooted I used Wugfresh to get automatically get my drivers. Since im one Windows 8 maybe I should uninstall those drivers and download Koushs universal drivers? or maybe its the windows 8 driver sign problem.

Could be driver issues.. Those are pesky and I don't use my Windows system for these kind of things for that reason. I have some info in the Unlock and Root thread dealing with drivers and Windows 8 but it's just what I've culled from others' experiences as I haven't had to deal with it myself. See if that info helps and either way let us know any progress you make as I'd like to be able to steer people in the right direction..

Sent from my Nexus 4 using Tapatalk 2
 

cjshino

Active member
Sep 13, 2012
29
0
0
Visit site
Could be driver issues.. Those are pesky and I don't use my Windows system for these kind of things for that reason. I have some info in the Unlock and Root thread dealing with drivers and Windows 8 but it's just what I've culled from others' experiences as I haven't had to deal with it myself. See if that info helps and either way let us know any progress you make as I'd like to be able to steer people in the right direction..

Sent from my Nexus 4 using Tapatalk 2

So i uninstalled my drivers then installed universal drivers by koush and cmd still doesnt recognize my nexus 4
 

jellymann

New member
Jul 27, 2013
1
0
0
Visit site
You actually need the adb.exe and fastboot.exe in your working directory when you use cmd. The error message you are getting is windows' way of telling you that it doesn't recognise the command "adb". It is NOT a driver issue.

To fix your problem, download the Mini-SDK from androidforums.
 

cjshino

Active member
Sep 13, 2012
29
0
0
Visit site
You actually need the adb.exe and fastboot.exe in your working directory when you use cmd. The error message you are getting is windows' way of telling you that it doesn't recognise the command "adb". It is NOT a driver issue.

To fix your problem, download the Mini-SDK from androidforums.

i already had abd.exe and fastboot.exe in the directory and still doesnt work
 

PhoenixMike

Well-known member
Sep 22, 2010
280
5
0
Visit site
It seems like I've been getting excessive bad luck with trying to get 4.3. OTA and manual downloads kept giving me an error and now no longer get push notifications of any kind. I now try to download the factory images and they stop downloading at around 30 MB. EVERY TIME. I tried both on my phone and PC. :'(

EDIT:
After flashing stock 4.2.2 image (no data wipe occurred) I was able to pull and successfully download the OTA.
 

andr0idralphie

Well-known member
Oct 31, 2012
355
0
0
Visit site
It stops at 30MB on your comp and phone? Weird. Tried resetting the router? At this point I still don't think everyone is getting the OTA 4.3 update but if you're impatient as I am you might want to weigh the risk of flashing the 4.3 image.
 

PhoenixMike

Well-known member
Sep 22, 2010
280
5
0
Visit site
It stops at 30MB on your comp and phone? Weird. Tried resetting the router? At this point I still don't think everyone is getting the OTA 4.3 update but if you're impatient as I am you might want to weigh the risk of flashing the 4.3 image.

Yep, reset didn't help. I already installed the OTA and everything is fine except that I still can't get any notifications... I feel like something went wrong when the update failed the first time.

Sent from my Nexus 4 using AC Forums mobile app
 

andr0idralphie

Well-known member
Oct 31, 2012
355
0
0
Visit site
I know some people erase some file to force the OTA to be available to them, if you happened to have done that the only fix for the wonkiness that might ensue, from what I've read, is to remove and re-add your Google account.
 

Trending Posts

Forum statistics

Threads
948,062
Messages
6,937,338
Members
3,160,948
Latest member
wggdest