Flash Android Phone with PC – Step‑by‑Step Guide
In this article
Yes, you can flash an Android phone from a PC by using the official fastboot and ADB utilities to install a new firmware image, recovery, or factory reset package.
What You’ll Need
- A Windows, macOS, or Linux PC with internet access
- USB‑C or micro‑USB cable that can transfer data (not just charge)
- The correct firmware (stock ROM, custom ROM, or recovery) for your exact device model
- Android SDK Platform‑Tools (contains ADB and fastboot)
- Device drivers (Windows) or proper udev rules (Linux) for your phone
- Battery level above 50 % and a backup of any important data
Step‑by‑Step
- Enable Developer Options and USB Debugging. Open Settings > About phone, tap "Build number" seven times until a toast confirms developer mode. Return to Settings > System > Advanced > Developer options and toggle "USB debugging" on. The wording may differ slightly by Android version.
- Unlock the bootloader (if required). Most flashing operations need an unlocked bootloader. Connect the phone to the PC, open a command prompt (Windows) or terminal (macOS/Linux), and run
adb reboot bootloader. When the bootloader screen appears, typefastboot oem unlock(orfastboot flashing unlockon newer devices). Confirm the unlock on the phone using the volume and power buttons. Note: unlocking wipes all user data. - Download and extract the firmware. Obtain the exact ROM package from the manufacturer’s website or a trusted source. Extract the zip so that the individual
.imgfiles (system.img, boot.img, etc.) are accessible. - Install Platform‑Tools. Download the Android SDK Platform‑Tools archive for your OS, unzip it to a convenient folder, and add that folder to your system PATH or keep the command prompt inside the folder.
- Verify the connection. With the phone still in fastboot mode, run
fastboot devices. The device’s serial number should be listed; if not, reinstall drivers (Windows) or add a udev rule (Linux). - Flash the images. The exact order depends on the ROM, but a common sequence is:
fastboot flash boot boot.img fastboot flash recovery recovery.img fastboot flash system system.img fastboot flash vendor vendor.img
Replace file names with those in your package. If the ROM includes aflash-all.sh(Linux/macOS) orflash-all.bat(Windows) script, you can run it instead of flashing each partition manually. - Re‑lock the bootloader (optional). After a successful flash, you may relock to improve security:
fastboot oem lockorfastboot flashing lock. This step also wipes data on many devices. - Reboot the device. Execute
fastboot reboot. The phone should boot into the newly installed system. The first boot can take several minutes.
Common Mistakes
- Using the wrong firmware for your exact model or region. Always double‑check the model number (e.g., SM‑G991U) and carrier variant.
- Skipping the bootloader unlock step, which causes fastboot commands to be rejected.
- Interrupting the flash process by disconnecting the USB cable or powering off the phone.
- Flashing only part of a ROM package; missing a required partition can lead to boot loops.
- Neglecting to back up data before unlocking, resulting in accidental loss.
Tips
- Keep a copy of the original stock firmware on your PC; you can revert if a custom ROM misbehaves.
- Use a high‑quality cable and a USB 2.0 port for the most reliable connection.
- Run
adb reboot bootloaderinstead of manually powering off and on; it ensures the device enters fastboot mode cleanly. - If the script provided by the ROM fails, fall back to manual
fastboot flashcommands for each image. - On Windows, install the Google USB Driver via Android Studio or the standalone package to avoid generic driver issues.
Troubleshooting
Device not listed after fastboot devices
- Restart both PC and phone, then reconnect the cable.
- Reinstall or update the USB driver (Windows) or add the following udev rule (Linux):
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev" - Try a different USB port or a different cable.
Fastboot says "command not allowed"
- Make sure the bootloader is unlocked; run
fastboot oem unlockagain. - Some OEMs require an unlock token; obtain it from the manufacturer’s developer portal.
Phone gets stuck in a boot loop after flashing
- Re‑enter fastboot mode and flash the
boot.imgagain; a corrupted boot image is a common cause. - If the problem persists, flash the complete stock firmware package, which restores all partitions to a known good state.
Fastboot reports "cannot write partition"
- Check that you are using the correct image for the target partition (e.g., do not flash a system image to the vendor partition).
- Some newer devices require the
fastboot flashing unlock_criticalcommand before flashing vendor or modem partitions.
If none of the above resolves the issue, consult the device‑specific XDA Developers forum or the manufacturer’s support page for exact flashing instructions.
Frequently Asked Questions
Do I need to root my phone before flashing?
No. Flashing a new ROM or recovery works with an unlocked bootloader, but rooting is a separate process that typically occurs after a successful flash.
Can I flash a phone that is still under warranty?
Unlocking the bootloader usually voids the manufacturer's warranty. Check the warranty terms for your specific brand before proceeding.
What if my phone is bricked after a failed flash?
Most Android devices have a recovery mode (often accessed with Power + Volume Down). From there you can re‑enter fastboot and flash the stock firmware again. If the device does not enter any mode, contact the manufacturer’s service center.
Is it safe to flash using a Mac?
Yes. The Platform‑Tools package works on macOS, and the fastboot commands are identical. Ensure you have the correct driver support for USB devices, which macOS provides natively for most Android phones.
Do I need a special PC for flashing large firmware files?
No special hardware is required. A standard laptop or desktop with at least 2 GB of free RAM and a stable internet connection is sufficient.
Will flashing delete all my apps and data?
Unlocking the bootloader wipes user data, and flashing a full ROM replaces the system partition. Back up contacts, photos, and apps beforehand using Google Backup or a local copy.