User Tools

Site Tools


android:start

Android - CyanogenMod

Unlocking the device

  • Enable USB debugging on the device.
  • Connect the device to the computer through USB.
  • From a terminal on a computer, type the following to boot the device into fastboot mode:
$ adb reboot bootloader 
  • Once the device is in fastboot mode, verify your PC sees the device by typing fastboot devices
    • If you don't see your device serial number, and instead see “<waiting for device>”, fastboot is not configured properly on your machine. See fastboot documentation for more info.
    • If you see “no permissions fastboot”, try running fastboot as root.
  • From the same terminal, type the following command to unlock the bootloader (under Linux, you must be root):
$ fastboot oem unlock 
  • A disclaimer will display on the device that must be accepted. Use the volume keys to cycle through the options. Pressing the power button should confirm your selection.
  • If the device doesn't automatically reboot, reboot it from the menu. It should now be unlocked. You can confirm this is the case if you see an unlocked icon at the bottom of the Google boot screen during reboots.
  • Since the device resets completely you need to re-enable USB debugging.

Installing recovery using fastboot

Installing Team Win Recovery Project on the Nexus 4

  • Connect the Nexus 4 to the computer via USB.
  • Make sure the fastboot binary is in your PATH or that you place the downloaded image in the same directory as fastboot.
  • Open a terminal on your PC and reboot the device into fastboot mode by typing:
$ adb reboot bootloader 

or by using the hardware key combination.

  • Once the device is in fastboot mode, verify your PC sees the device by typing:
$ fastboot devices
  • If you don't see your device serial number, and instead see “<waiting for device>”, fastboot is not configured properly on your machine. See fastboot documentation for more info.
  • If you see “no permissions fastboot”, try running fastboot as root.
  • Flash TWRP Recovery onto your device by entering the following command:
$ fastboot flash recovery <your_recovery_image.img> 

where <your_recovery_image.img> is the name of the file you downloaded.

  • Once the flash completes successfully, reboot the device into recovery to verify the installation. This can be done by typing:
fastboot boot <your_recovery_image.img>

:!: Note: Some ROMs overwrite recovery at boot time so if you do not plan to immediately boot into recovery to install CyanogenMod, please be aware that this may overwrite your custom recovery with the stock one.

Installing CyanogenMod from recovery

Sideload

In case you have no OS pre-installed, the only way to install CyanogenMod is to use a sideload option.

  • Check you can see the device:
$ adb devices
  • If everything is OK, then you can sideload your <build.zip>:
$ adb sideload <build.zip>

Option 1

  • Download the prebuilt release of CyanogenMod you wish to install. (Or if you've built CM yourself, look in the $OUT directory for the .zip.)
  • Optional: Download any supplemental 3rd-party applications packages for the device you wish to use.
  • Place the CyanogenMod rom .zip file on the root of the SD card using adb:
$ adb push YOURROMZIP.zip /sdcard/
  • If you boot directly to recovery and have an internal sdcard, you may need to run adb shell mount /sdcard or mount data through the recovery menu before transferring.
    • If you see “error: device not found” there is likely a driver issue on the PC.
    • If you see “error: insufficient permissions for device”, try “adb kill-server” and then run “adb devices” to see if the device is attached.
    • On some devices, the zip file can be copied to the device using standard USB Mass Storage or MTP support. Boot the device normally and transfer the file to it.
  • Place any supplemental packages (e.g. Google Apps or kernel) .zip file(s) on the root of the SD card.
  • Boot to recovery mode on the device by holding Vol Down & Power.
  • Once the device boots into the ClockworkMod Recovery, use the physical volume buttons to move up and down. On most devices, the power button is used to confirm your selection, although for some devices the power button is used as a “back” button to go up one level, in which case the home button is used to confirm the selection.

Option 2

  • Select backup and restore to create a backup of the current installation on the device.
  • Select the option to wipe data/factory reset.
  • Select install zip from sdcard.
  • Select choose zip from sdcard.
  • Select the CyanogenMod file you placed on the sdcard. You will then need to then confirm that you do wish to flash this file.
  • Install any additional packages you wish using the same method.

Once the installation has finished, return back to the main menu, and select the reboot system now option. The device should now boot into CyanogenMod.

Troubleshooting

  • insufficient permissions for device
adb kill-server
sudo adb start-server
adb devices

Links

android/start.txt · Last modified: 2016/03/31 02:39 by abadonna