HTC Wildfire (buzz)

Cyanogenmod ROM HTC Wildfire (Buzz)

Cyanogenmod ROM HTC Wildfire (buzz)

Quick Info

Download CyanogenMod

Download (nightly build)
CyanogenMod 7 (Android 2.3 (Gingerbread))

Note: Support Status

This device does not support the latest official release of CyanogenMod. This may be due to hardware limitations or simply because development is ongoing. The most recent version supported is based on the gingerbread branch of CyanogenMod.

Special boot modes

  • Recovery: Vol Down & Power then select recovery. Use trackball for select.

Source code

Device http://www.github.com/cyanogenmod/android_device_htc_buzz
Wildfire Specifications
Codename: buzz
Vendor: HTC
Manufacturer: HTC
Release date: 2010 May (USA)
Type: phone
GSM freq: 850 900 1800 1900 MHz GSM/GPRS/EDGE
900 2100 MHz UMTS/HSPA (EUR)
850 1900 MHz UMTS/HSPA (ASIA)
Platform: Qualcomm MSM7225
CPU: 528 MHz single-core Qualcomm
RAM: 384MB
Weight: 118 g (4.2 oz)
Dimensions: 107 mm (4.2 in) (h)
60 mm (2.4 in) (w)
12 mm (0.48 in) (d)
Screen size: 81 mm (3.2 in)
Resolution: 320×240
Screen density: 125 ppi
Screen type: TFT LCD
Internal storage: 512MB
SD Card: up to 32GB
Bluetooth: 2.1+EDR
Wi-Fi: 802.11b/g
Main camera: 5MP w/ LED flash
Power: 1300 mAh internal, rechargeable, removable lithium-ion battery
Peripherals: micro-USB, A-GPS, capacitive touchscreen, digital compass, proximity and ambient light sensors, 3-axis accelerometer
CM supported: 7
Latest CM version: gingerbread

How to Install CyanogenMod on the HTC Wildfire (buzz)

Note: DISCLAIMER

Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.

Obtaining S-OFF and installing a custom recovery on the Wildfire

Certain HTC devices can be exploited via a tool called Revolutionary to obtain S-OFF. The status of your device’s support can be checked at their site. Pay close attention to the HBOOT revision as newer updates break the tool’s ability to work properly. The Revolutionary tool will also install ClockworkMod Recovery.

Supported version(s) of HBOOT for the Wildfire: 1.01.0001.

  1. Windows Only: Download and install HTC USB drivers v3.0.0.007
    md5: f60771a86c4ad69c8c9c1d158e60e850
  2. Disable Fast Boot on the Wildfire (not to be confused with fastboot):
    Settings » Power » Fast Boot
    (or)
    Settings » Applications » Fast Boot
  3. Enable USB debugging:
    Settings » Applications » Development » USB debugging
  4. Connect the Wildfire to the computer via USB
  5. Find your device’s HBOOT version:
    From a command prompt or terminal, type: adb reboot bootloader
    If your HBOOT version is NOT 1.01.0001, you will need to downgrade. To downgrade your Wildfire from Gingerbread (Including HBOOT 2.18) to Froyo, so you can root with unrEVOked v3.32 and gain RADIO S-OFF, follow this guide: [[1]]
  6. Write down the serial number of the device:
    If at the bootloader: fastboot devices
    If Android is booted: adb devices
    Alternatively, the serial number can usually be found under the battery
  7. Download Revolutionary 0.4pre4
  8. Fill out the form on the Revolutionary site to get a beta key.
  9. Once you have the beta key, launch the Revolutionary beta (you may need to launch it as root or administrator) and enter in the beta key minding that the key contains both upper- and lower-case letters.
  10. Revolutionary will now attempt to temp-root your device, set S-OFF, and install a custom recovery image. The device will reboot on its own and the entire process should only take a few minutes. If the process takes longer than 15 minutes, reboot the device and attempt again. Some users have had to attempt S-OFF multiple times before achieving success.

NOTE: If you are unable to S-OFF your device, and it is listed as supported by Revolutionary, join the Revolutionary IRC channel for further assistance.

Installing CyanogenMod from recovery

  1. Make sure your computer has working adb.
  2. Download the CyanogenMod build package for your device that you’d like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  3. Boot to recovery mode, and connect the phone to your computer through USB.
    • Vol Down & Power then select recovery. Use trackball for select.
  4. In ClockworkMod Recovery, use the physical volume buttons to move up and down. On most devices, the power button is used to confirm a menu selection, but for some devices a physical home key acts as a selector. Some devices have touch enabled ClockworkMod Recovery, in which case you may be able to swipe to, or touch, menu selections.
  5. Optional (Recommended): Select backup and restore to create a backup.
  6. Select wipe data/factory reset.
  7. You have two options for transferring and installing the installation packages. The sideload method is more universal across devices, whereas the push and install method is more commonly used:
    • Sideload method: select install zip > install zip from sideload. Follow the on-screen notices to install the package. The installer does not necessarily display an “Install complete.” message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Push and install method: Open a command prompt (or Terminal on Mac and Linux) and navigate to the directory holding the package(s) you would like to install. On the device, navigate to the mounts and storage menu. If you see /storage/sdcard0 or /sdcard as a mountable volume, go ahead and mount it. If you do not see one of these partitions, then instead mount the /data partition. Take note of which volume you mounted. Now, push the package(s) to your device (also, see tip below):
    – If you mounted /storage/sdcard0, then: adb push update.zip /storage/sdcard0/
    – If you mounted /sdcard or /data, then: adb push update.zip /sdcard/
    where update.zip should be replaced with the package filename. Go back to the main menu and select install zip. Choose to install from the same directory where you pushed the package(s). If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  8. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Helpful Tip – SD card folders

CyanogenMod 10.1 and newer have multi-user support (introduced in Android 4.2). If your device has storage on the /data partition, then Android actually looks in /data/media/0/ for the first user’s /sdcard/ storage. ClockworkMod recovery symlinks /sdcard/ to /data/media/ though. So, if you are pushing files to internal storage in recovery and want them to be visible in Android, you should push them to /sdcard/0/ or /data/media/0/. Here’s the most frequent scenarios:

  1. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10 or older: adb push update.zip /sdcard/
  2. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10.1 or newer: adb shell "mkdir /sdcard/0/" followed by adb push update.zip /sdcard/0/
  3. If you’re coming from a ROM with Android 4.2 or newer to CyanogenMod 10.1 or newer: adb push update.zip /sdcard/0/

Helpful Tip

See something wrong on this page? Click here: Report a Site Problem.

How To Build CyanogenMod For HTC Wildfire (buzz)

Introduction

These instructions will hopefully assist you to start with a stock Wildfire, unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A Wildfire
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the Wildfire (typically micro USB, but older devices may use mini USB or have a proprietary cable)
  • A decent internet connection & reliable electricity :)
  • Some familiarity with basic Android operation and terminology. It would help if you’ve installed custom roms on other devices and are familiar with recovery. It may also be useful to know some basic command line concepts such as cd for “change directory”, the concept of directory hierarchies, that in Linux they are separated by /, etc.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.

Note:

You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment

Note:

You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see http://source.android.com/source/initializing.html which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b gingerbread

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt Rom Manager

$ cd ~/android/system/vendor/cyanogen

then enter:

$ ./get-rommanager

You won’t see any confirmation- just another prompt. But this should cause the Rom Manager apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

After the source downloads, ensure you are in the root of the source code (cd ~/android/system), then type:
$ source build/envsetup.sh
$ lunch

You should see a list of devices, including something like cm_buzz-userdebug. Select it by typing its number. It is possible that lunch does not display your device. In that case try

$ lunch cm_buzz-userdebug

or

$ lunch full_buzz-userdebug

If all goes well, you should see that buzz-specific directories are downloaded automatically.

Helpful Tip

If you want to know more about what source build/envsetup.sh does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/envsetup.sh from ~/android/system.

Extract proprietary blobs

Now ensure that your Wildfire is connected to your computer via the USB cable and that you are in the ~/android/system/device/htc/buzz directory (you can cd ~/android/system/device/htc/buzz if necessary). Then run the extract-files.sh script:

$ ./extract-files.sh

You should see the proprietary files (aka “blobs”) get pulled from the device and moved to the ~/android/system/vendor/htc directory. If you see errors about adb being unable to pull the files, adb may not be in the path of execution. If this is the case, see the adb page for suggestions for dealing with “command not found” errors.

Note:

Your device should already be running a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly.

Note:

It’s important that these proprietary files are extracted to the ~/android/system/vendor/htc directory by using the extract-files.sh script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilt/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch buzz

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make buzz should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/buzz/cm_buzz-ota-eng.root.zip] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/common.py:

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2) cm-7-20161224-UNOFFICIAL-buzz.zip, which is the CyanogenMod installation package.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:

cm-7-20161224-UNOFFICIAL-buzz.zip

Note:

The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the cm...zip file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.

Categories HTC

HTC ONE XL (evita)

Cyanogenmod ROM HTC ONE XL (Evita)

Cyanogenmod ROM HTC ONE XL (evita)

Quick Info

Download CyanogenMod

Download (nightly build)
CyanogenMod 12.1 (Android 5.1 (Lollipop))

Notes

Note: Minimum supported recovery

The minimum version of recovery that can be used to install CyanogenMod on this device is: ClockworkMod 6.0.4.8 or TWRP 2.7.0.8. See this page for more information.

Note: Supported bootloaders

The versions of HBOOT supported by CyanogenMod are:

  • CM 10.1: HBOOT 2.14.0000
  • CM 10.2: HBOOT 2.14.0000, 2.15.0000
  • CM 11: HBOOT 2.14.0000, 2.15.0000, 2.16.0000, 2.17.0000, 2.18.0000

AT&T users are urged to update to firmware 5.18.502.1 (HBOOT 2.18); there are firmware update instructions on the installation page for evita. Non-AT&T users should update to the latest firmware via RUU or simply by installing stock and taking OTA(s).

Special boot modes

  • Recovery: With the device powered down, hold the Volume Down and Power buttons until HBOOT appears, then release the buttons. Navigate using the volume keys and select RECOVERY using the Power key.
  • Bootloader: With the device powered down, hold the Volume Down and Power buttons until HBOOT appears, then release the buttons.
  • Fastboot: With the device powered down, hold the Volume Down and Power buttons until HBOOT appears, then release the buttons. Navigate using the volume keys and select FASTBOOT using the Power key.

Source code

Device http://www.github.com/cyanogenmod/android_device_htc_evita
Kernel http://www.github.com/cyanogenmod/android_kernel_htc_msm8960
One XL Specifications
Codename: evita
Vendor: HTC
Release date: 2012 May 6 (US)
2012 April 20 (CAN)
Carrier: AT&T
Type: phone
GSM freq: Quad-band GSM/GPRS/EDGE 850 900 1800 1900 MHz
Quad-band UMTS/HSPA+ 850 900 1900 2100 MHz (INT)

Tri-band UMTS/HSPA+ 850 900 1900 2100 MHz (NORTH AMERICA)

LTE freq: Dual-band LTE 1800 2600 MHz (INT)
Tri-band LTE 700 1700 2100 MHz (NORTH AMERICA)
Platform: Qualcomm MSM8960
CPU: 1.5 GHz dual-core Qualcomm Snapdragon S4
RAM: 1GB
Weight: 130 g (4.6 oz)
Dimensions: 134 mm (5.3 in) (h)
70 mm (2.76 in) (w)
9 mm (0.354 in) (d)
Screen size: 119 mm (4.7 in)
Resolution: 1280×720
Screen density: 312 ppi
Screen type: Super IPS LCD2
Internal storage: 16/32GB
SD Card: No slot for SD Card
Bluetooth: 4.0 w/ apt-X
Wi-Fi: 802.11a/b/g/n
Main camera: 8MP w/ LED flash
Secondary camera: 1.3MP
Power: 1800 mAh internal, rechargeable, non-removable lithium-ion polymer battery
Peripherals: micro-USB, A-GPS, FM Radio, DNLA, NFC, capacitive touchscreen, proximity & ambient light sensors, volume controls, 3-axis accelerometer, gyrometer, digital compass
CM supported: 10, 10.1, 10.2, 11, 12, 12.1

How to Install CyanogenMod on the HTC One XL (evita)

Note: DISCLAIMER

Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.

Important Notes

Note: Minimum supported recovery

The minimum version of recovery that can be used to install CyanogenMod on this device is: ClockworkMod 6.0.4.8 or TWRP 2.7.0.8. See this page for more information.

Note: Supported bootloaders

The versions of HBOOT supported by CyanogenMod are:

  • CM 10.1: HBOOT 2.14.0000
  • CM 10.2: HBOOT 2.14.0000, 2.15.0000
  • CM 11: HBOOT 2.14.0000, 2.15.0000, 2.16.0000, 2.17.0000, 2.18.0000

AT&T users are urged to update to firmware 5.18.502.1 (HBOOT 2.18); there are firmware update instructions on the installation page for evita. Non-AT&T users should update to the latest firmware via RUU or simply by installing stock and taking OTA(s).

S-OFF, and Firmware Updates

S-OFF vs. Unlocked Bootloader

You must have an unlocked bootloader or be S-OFF. S-OFF is recommended so that you can easily update the firmware on your device as well as install ROMs through recovery without needing to manually fastboot flash the boot partition with every install. Unfortunately, AT&T does not allow HTC to include the One XL in its unlocked bootloader program, so S-OFF is your only option (not necessarily a bad thing).

The One XL is supported by rumrunner s-off.

Updating to firmware v5.18.502.1 for AT&T devices

You must be S-OFF to follow these instructions!

These instructions are only for users that are already running CyanogenMod and would like to update their device’s firmware without reinstalling the stock manufacturer ROM. You can check to see whether you are already on the latest firmware under Settings > About phone, comparing the baseband to 1.35a.32.45.27. If you already have this baseband version, you do not need to upgrade. If your baseband displays an older version, then you can follow the instructions below.

Before you begin, be sure that both ADB and fastboot are installed and working on your computer. With your phone booted and connected to your computer, you should be able to type adb devices to see your device’s serial number. Similarly, test fastboot by first rebooting your phone to the bootloader (adb reboot-bootloader) and then typing fastboot devices to see your serial number again. Only continue if you have working adb and fastboot!

  1. Download evita_firmware_5.18.502.1.zip
    md5: 78aa08f90d38c16f1b0a93f508bece8f
    It is imperative that you verify the md5sum before flashing!
  2. Reboot the device to HBOOT:
    adb reboot-bootloader
  3. Enter the OEM update mode:
    fastboot oem rebootRUU
  4. Flash the firmware package. cd to the directory containing evita_firmware_5.18.502.1.zip and run:
    fastboot flash zip evita_firmware_5.18.502.1.zip
  5. You will see a FAILED message: remote: 90 hboot pre-update! please flush image again immediately. Do not be alarmed. Wait a few seconds for the HTC logo to reappear on your device, then run the same command again: fastboot flash zip evita_firmware_5.18.502.1.zip
  6. Wait for the process to finish
  7. Reboot the phone:
    fastboot reboot

Installing a custom recovery using fastboot

See All About Recovery Images for more information about custom recoveries and their capabilities.

  1. Make sure your computer has working fastboot and adb.
  2. Download recovery — you can directly download a recovery image using the link below, or visit twrp.me to obtain the latest version of Team Win Recovery Project for your device.
    Recovery: Download
    md5: 51ff73ad15c779ac5ee24767d680c408
  3. Connect the One XL to the computer via USB.
  4. Make sure the fastboot binary is in your PATH or that you place the recovery image in the same directory as fastboot.
  5. 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 for your device while it is powered off.
  6. 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 permissionsfastboot”, make sure your UDEV rules are setup correctly.
  7. Flash recovery onto your device by entering the following command:
    fastboot flash recovery your_recovery_image.img
    where the latter part is the filename of the recovery image.
  8. Once the flash completes successfully, reboot the device into recovery to verify the installation. Boot to recovery instructions: With the device powered down, hold the Volume Down and Power buttons until HBOOT appears, then release the buttons. Navigate using the volume keys and select RECOVERY using the Power key.
    • 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

Note:

This device, if unlocked with HTCDev Unlock, must have its kernel flashed via fastboot. When you reach the end of the instructions below, do not restart your device to CyanogenMod yet. Instead, restart to the bootloader and put the phone in fastboot mode. Extract boot.img from the CyanogenMod .zip package you just installed and flash it via fastboot: cd to the directory containing boot.img and execute fastboot flash boot boot.img. This needs to be done EVERY time CyanogenMod is updated, thus it is recommended to not use the internal CM updater. The alternative to this burden is to S-OFF your device (recommended), then the boot partition will automatically be updated when CyanogenMod is installed or updated.

  1. Make sure your computer has working adb.
  2. Download the CyanogenMod build package for your device that you’d like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  3. Place the CyanogenMod .zip package, as well as any optional .zip packages, on the root of /sdcard:
    • Using adb: adb push filename.zip /sdcard/
    Note: You can copy the .zip packages to your device using any method you are familiar with. The adb method is used here because it is universal across all devices and works in both Android and recovery mode. If you are in recovery mode, you may need to ensure /sdcard (sometimes called Internal Storage) is mounted by checking its status in the Mounts menu. If you have booted regularly, USB debugging must be enabled.
  4. If you are not already in recovery, boot to recovery mode now.
    • With the device powered down, hold the Volume Down and Power buttons until HBOOT appears, then release the buttons. Navigate using the volume keys and select RECOVERY using the Power key.
  5. In Team Win Recovery Project, select menu choices by tapping on the appropriately labelled button.
  6. Optional (Recommended): Select the Backup button to create a backup.
  7. Select Wipe and then Factory Reset.
  8. Select Install.
  9. Navigate to /sdcard and select the CyanogenMod .zip package.
  10. Follow the on-screen notices to install the package.
  11. Optional: Install any additional packages you wish using the same method (if you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it).
  12. Once installation has finished, return to the main menu and select Reboot, then System. The device will now boot into CyanogenMod.

Helpful Tip

See something wrong on this page? Click here: Report a Site Problem.

How To Build CyanogenMod For HTC One XL (evita)

Introduction

These instructions will hopefully assist you to start with a stock One XL, unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A One XL
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the One XL (typically micro USB, but older devices may use mini USB or have a proprietary cable)
  • A decent internet connection & reliable electricity :)
  • Some familiarity with basic Android operation and terminology. It would help if you’ve installed custom roms on other devices and are familiar with recovery. It may also be useful to know some basic command line concepts such as cd for “change directory”, the concept of directory hierarchies, that in Linux they are separated by /, etc.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.

Note:

You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment

Note:

You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see http://source.android.com/source/initializing.html which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt apps (CM11 and below)

Next,

$ cd ~/android/system/vendor/cm

then enter:

$ ./get-prebuilts

You won’t see any confirmation- just another prompt. But this should cause some prebuilt apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

Helpful Tip – Errors during breakfast

Different maintainers setup their device inheritance rules differently. Some require a vendor directory to be populated before breakfast will even succeed. If you receive an error here about vendor makefiles, then jump down to the next section Extract proprietary blobs. The first portion of breakfast should have succeeded at pulling in the device tree and the extract blobs script should be available. After completing that section, you can rerun breakfast evita

After the source downloads, ensure you are in the root of the source code (cd ~/android/system), then type:

$ source build/envsetup.sh
$ breakfast evita

This will download the device specific configuration and kernel source for your device. An alternative to using the breakfast command is to build your own local manifest. To do this, you will need to locate your device on CyanogenMod’s GitHub and list all of the repositories defined in cm.dependencies in your local manifest.

Helpful Tip

If you want to know more about what source build/envsetup.sh does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/envsetup.sh from ~/android/system.

Extract proprietary blobs

Now ensure that your One XL is connected to your computer via the USB cable and that you are in the ~/android/system/device/htc/evita directory (you can cd ~/android/system/device/htc/evita if necessary). Then run the extract-files.sh script:

$ ./extract-files.sh

You should see the proprietary files (aka “blobs”) get pulled from the device and moved to the ~/android/system/vendor/htc directory. If you see errors about adb being unable to pull the files, adb may not be in the path of execution. If this is the case, see the adb page for suggestions for dealing with “command not found” errors.

Note:

Your device should already be running a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly.

Note:

It’s important that these proprietary files are extracted to the ~/android/system/vendor/htc directory by using the extract-files.sh script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilts/misc/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch evita

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make evita should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/evita/cm_evita-ota-eng.root.zip] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/common.py:

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2) cm-13.0-20161224-UNOFFICIAL-evita.zip, which is the CyanogenMod installation package.

Installing a custom recovery using fastboot

See All About Recovery Images for more information about custom recoveries and their capabilities.

  1. Make sure your computer has working fastboot and adb.
  1. Connect the One XL to the computer via USB.
  2. Make sure the fastboot binary is in your PATH or that you place the recovery image in the same directory as fastboot.
  3. 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 for your device while it is powered off.
  4. 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 permissionsfastboot”, make sure your UDEV rules are setup correctly.
  5. Flash recovery onto your device by entering the following command:
    fastboot flash recovery your_recovery_image.img
    where the latter part is the filename of the recovery image.
  6. Once the flash completes successfully, reboot the device into recovery to verify the installation.
    • 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.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:

cm-13.0-20161224-UNOFFICIAL-evita.zip

Note:

The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the cm...zip file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.

Categories HTC

HTC Legend (legend)

Cyanogenmod ROM HTC Legend (legend)

Cyanogenmod ROM HTC Legend (legend)

Quick Info

Download CyanogenMod

Download (nightly build)
CyanogenMod 7 (Android 2.3 (Gingerbread))

Note: Support Status

This device does not support the latest official release of CyanogenMod. This may be due to hardware limitations or simply because development is ongoing. The most recent version supported is based on the gingerbread branch of CyanogenMod.

Source code

Device http://www.github.com/cyanogenmod/android_device_htc_legend
Legend Specifications
Codename: legend
Vendor: HTC
Manufacturer: HTC
Release date: 2010 March 31 (USA)
Type: phone
GSM freq: 850 900 1800 1900 MHz GSM/GPRS/EDGE
900 2100 MHz UMTS/HSPA
Platform: Qualcomm MSM7227
CPU: 600 MHz single-core Qualcomm
RAM: 384MB
Weight: 126 g (4.4 oz)
Dimensions: 112 mm (4.4 in) (h)
56.3 mm (2.22 in) (w)
11.5 mm (0.45 in) (d)
Screen size: 81 mm (3.2 in)
Resolution: 480×320
Screen density: 180 ppi
Screen type: AMOLED
Internal storage: 512MB
SD Card: up to 32GB
Bluetooth: 2.1+EDR
Wi-Fi: 802.11b/g
Main camera: 5MP
Power: 1300 mAh internal, rechargeable, removable lithium-ion battery
Peripherals: micro-USB, A-GPS, capacitive touchscreen, proximity & ambient light sensors, optical joystick, volume controls, 3-axis accelerometer
CM supported: 7
Latest CM version: gingerbread

Note: DISCLAIMER

Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.

This guide will walk you through the process of taking the HTC Legend from stock to having the ability to flash a custom recovery image & the latest version of CyanogenMod.

Rooting the HTC Legend

Unlocking the HTC Legend on HBOOT 1.02

  1. Go to the HTCDev website and register/make an account.
  2. Once done, go to the Bootloader Unlock page and select the Legend from the drop down list and click Begin Unlock Bootloader.
  3. Follow all instructions in the bootloader unlock guide to the very end.

You should now have an unlocked HBOOT 1.02 ready for rooting.

Rooting HTC Legend with HBOOT 1.02

You are now ready to root your phone.

  1. Download HTC Super Tool v3 from the xda developers thread.
    • NOTE: HTC Super Tool may set off antivirus warnings. This is because it roots your phone and has the potential to do damage. In this case though, the program is safe. Also be sure to have the Legend USB drivers installed (should already be installed from unlocking) and USB Debugging enabled.
  2. Run the program and select option 1.
  3. After running option 1, select and run option 3.

After this step you should have root access.

Installing a Custom Recovery Image

  1. Download the latest version of the ClockworkMod Recovery:
    • ClockworkMod Recovery 5.0.2.0: Download
      md5: f309816309f92323e283e9fca67ab62b
  2. Move the ClockworkMod Recovery to the same folder as adb and fastboot (the /platform-tools folder within the Android SDK folder).
  3. Toggle on USB Debugging (Settings » Applications » Development).
  4. Connect the device to the computer.
  5. On the computer, open the terminal & navigate to the Android SDK Tools folder.
  6. Type in the following commands:
    adb reboot bootloader
    fastboot flash recovery recovery-clockwork-5.0.2.0-legend.img

The ClockworkMod Recovery should now be installed.

Installing CyanogenMod from recovery

  1. Make sure your computer has working adb.
  2. Download the CyanogenMod build package for your device that you’d like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  3. Boot to recovery mode, and connect the phone to your computer through USB.
    • down on the Trackball, hold Volume Down & the Power button until the device boots to the bootloader. Once in the bootloader, use Volume Down to select recovery
  4. In ClockworkMod Recovery, use the physical volume buttons to move up and down. On most devices, the power button is used to confirm a menu selection, but for some devices a physical home key acts as a selector. Some devices have touch enabled ClockworkMod Recovery, in which case you may be able to swipe to, or touch, menu selections.
  5. Optional (Recommended): Select backup and restore to create a backup.
  6. Select wipe data/factory reset.
  7. You have two options for transferring and installing the installation packages. The sideload method is more universal across devices, whereas the push and install method is more commonly used:
    • Sideload method: select install zip > install zip from sideload. Follow the on-screen notices to install the package. The installer does not necessarily display an “Install complete.” message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Push and install method: Open a command prompt (or Terminal on Mac and Linux) and navigate to the directory holding the package(s) you would like to install. On the device, navigate to the mounts and storage menu. If you see /storage/sdcard0 or /sdcard as a mountable volume, go ahead and mount it. If you do not see one of these partitions, then instead mount the /data partition. Take note of which volume you mounted. Now, push the package(s) to your device (also, see tip below):
    – If you mounted /storage/sdcard0, then: adb push update.zip /storage/sdcard0/
    – If you mounted /sdcard or /data, then: adb push update.zip /sdcard/
    where update.zip should be replaced with the package filename. Go back to the main menu and select install zip. Choose to install from the same directory where you pushed the package(s). If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  8. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Helpful Tip – SD card folders

CyanogenMod 10.1 and newer have multi-user support (introduced in Android 4.2). If your device has storage on the /data partition, then Android actually looks in /data/media/0/ for the first user’s /sdcard/ storage. ClockworkMod recovery symlinks /sdcard/ to /data/media/ though. So, if you are pushing files to internal storage in recovery and want them to be visible in Android, you should push them to /sdcard/0/ or /data/media/0/. Here’s the most frequent scenarios:

  1. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10 or older: adb push update.zip /sdcard/
  2. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10.1 or newer: adb shell "mkdir /sdcard/0/" followed by adb push update.zip /sdcard/0/
  3. If you’re coming from a ROM with Android 4.2 or newer to CyanogenMod 10.1 or newer: adb push update.zip /sdcard/0/

How To Build CyanogenMod For HTC Legend (legend)

Introduction

These instructions will hopefully assist you to start with a stock Legend, unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A Legend
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the Legend (typically micro USB, but older devices may use mini USB or have a proprietary cable)
  • A decent internet connection & reliable electricity :)
  • Some familiarity with basic Android operation and terminology. It would help if you’ve installed custom roms on other devices and are familiar with recovery. It may also be useful to know some basic command line concepts such as cd for “change directory”, the concept of directory hierarchies, that in Linux they are separated by /, etc.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.

Note:

You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment

Note:

You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see http://source.android.com/source/initializing.html which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b gingerbread

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt Rom Manager

$ cd ~/android/system/vendor/cyanogen

then enter:

$ ./get-rommanager

You won’t see any confirmation- just another prompt. But this should cause the Rom Manager apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

After the source downloads, ensure you are in the root of the source code (cd ~/android/system), then type:
$ source build/envsetup.sh
$ lunch

You should see a list of devices, including something like cm_legend-userdebug. Select it by typing its number. It is possible that lunch does not display your device. In that case try

$ lunch cm_legend-userdebug

or

$ lunch full_legend-userdebug

If all goes well, you should see that legend-specific directories are downloaded automatically.

Helpful Tip

If you want to know more about what source build/envsetup.sh does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/envsetup.sh from ~/android/system.

Extract proprietary blobs

Now ensure that your Legend is connected to your computer via the USB cable and that you are in the ~/android/system/device/htc/legend directory (you can cd ~/android/system/device/htc/legend if necessary). Then run the extract-files.sh script:

$ ./extract-files.sh

You should see the proprietary files (aka “blobs”) get pulled from the device and moved to the ~/android/system/vendor/htc directory. If you see errors about adb being unable to pull the files, adb may not be in the path of execution. If this is the case, see the adb page for suggestions for dealing with “command not found” errors.

Note:

Your device should already be running a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly.

Note:

It’s important that these proprietary files are extracted to the ~/android/system/vendor/htc directory by using the extract-files.sh script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilt/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch legend

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make legend should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/legend/cm_legend-ota-eng.root.zip] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/common.py:

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2) cm-7-20161224-UNOFFICIAL-legend.zip, which is the CyanogenMod installation package.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:

cm-7-20161224-UNOFFICIAL-legend.zip

Note:

The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the cm...zip file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.

Categories HTC

HTC EVO 4G LTE (jewel)

Cyanogenmod ROM HTC EVO 4G LTE (Jewel)

Cyanogenmod ROM HTC EVO 4G LTE (jewel)

Quick Info

Download CyanogenMod

Download (nightly build)
CyanogenMod 12 (Android 5.0 (Lollipop))

Notes

Note: Minimum supported recovery

The minimum version of recovery that can be used to install CyanogenMod on this device is: ClockworkMod 6.0.5.0 or TWRP 2.7.1.2. See this page for more information.

Note: Minimum supported bootloader

The minimum supported HBOOT version is 2.10.0000. This bootloader is included in firmware version 4.13.651.4. Information on upgrading your device’s firmware can be found at Jewel data/media transition.

Special boot modes

  • Recovery: With the device powered down, hold the Volume Down and Power buttons until HBOOT appears, then release the buttons. Navigate using the volume keys and select RECOVERY using the Power key.
  • Bootloader: With the device powered down, hold the Volume Down and Power buttons until HBOOT appears, then release the buttons.
  • Fastboot: With the device powered down, hold the Volume Down and Power buttons until HBOOT appears, then release the buttons. Navigate using the volume keys and select FASTBOOT using the Power key.

Source code

Device http://www.github.com/cyanogenmod/android_device_htc_jewel
Kernel http://www.github.com/cyanogenmod/android_kernel_htc_msm8960
EVO 4G LTE Specifications
Codename: jewel
Vendor: HTC
Release date: 2012 May 24 (USA)
Carrier: Sprint
Type: phone
CDMA freq: Tri-Band CDMA 800 800ESMR 1900 MHz EVDO Rev. A
LTE freq: 1900 MHz
Platform: Qualcomm MSM8960
CPU: 1.5 GHz dual-core Qualcomm Snapdragon S4
RAM: 1GB
Weight: 134g (4.7 oz)
Dimensions: 135 mm (5.3 in) (h)
69 mm (2.72 in) (w)
9 mm (0.354 in) (d)
Screen size: 119 mm (4.7 in)
Resolution: 1280×720
Screen density: 312 ppi
Screen type: S-LCD 2
Internal storage: 16GB
SD Card: up to 32GB
Bluetooth: 4.0 w/ apt-X
Wi-Fi: 802.11a/b/g/n
Main camera: 8MP w/ LED flash
Secondary camera: 1.3MP
Power: 2000 mAh internal, rechargeable, removable lithium-ion battery
Peripherals: micro-USB, A-GPS, FM Radio, DNLA, NFC, capacitive touchscreen, proximity & ambient light sensors, volume controls, 3-axis accelerometer, gyrometer, digital compass
CM supported: 10, 10.1, 10.2, 11, 12

How to Install CyanogenMod on the HTC EVO 4G LTE (jewel)

Note: DISCLAIMER

Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.

Important Notes

Note: Minimum supported recovery

The minimum version of recovery that can be used to install CyanogenMod on this device is: ClockworkMod 6.0.5.0 or TWRP 2.7.1.2. See this page for more information.

Note: Minimum supported bootloader

The minimum supported HBOOT version is 2.10.0000. This bootloader is included in firmware version 4.13.651.4. Information on upgrading your device’s firmware can be found at Jewel data/media transition.

S-OFF

You must have an unlocked bootloader or be S-OFF. S-OFF is recommended so that you can easily update the firmware on your device as well as install ROMs through recovery without needing to manually fastboot flash the boot partition with every install. You can obtain S-OFF using one of the following utilities:

If you opt to go S-OFF, you can skip the HTCDev Unlock instructions below. Also, once you have S-OFF, leave it be; there’s no reason to flip-flop back and forth between S-OFF and S-ON states.

Unlocking the bootloader

WARNING:

Unlocking the bootloader will automatically wipe all device data.

Note:

The EVO 4G LTE can be unlocked officially via the HTC Dev unlock program. This unlock method may have certain restrictions, such as not being able to flash a kernel via recovery (no longer applicable to 2013+ released HTC devices) or no USB access to sdcard in recovery. Some devices, however, have no other method to install custom firmware.

  1. Make sure your computer has working fastboot and adb.
  2. Enable USB debugging on the device.
  3. Enable OEM unlock in the Developer options settings on the device. (Note: Not all devices have this setting, so continue with next step if yours does not.)
  4. Connect the device to the computer through USB.
  5. From a terminal on a computer, type the following to boot the device into fastboot mode:
    adb reboot bootloader
  6. 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.
  7. From the same terminal, type the following command to obtain your bootloader unlock token:
    fastboot oem get_identifier_token
  8. Visit the HTCDev Bootloader Unlock website and follow the instructions there to obtain your unlock key and unlock your bootloader. If your device does not appear in the drop-down list, select All Other Supported Models.
  9. If the device doesn’t automatically reboot, reboot it from the menu. It should now be unlocked.
  10. Since the device resets completely, you will need to re-enable USB debugging on the device to continue.

Installing a custom recovery using fastboot

See All About Recovery Images for more information about custom recoveries and their capabilities.

  1. Make sure your computer has working fastboot and adb.
  2. Download recovery — you can directly download a recovery image using the link below, or visit twrp.me to obtain the latest version of Team Win Recovery Project for your device.
    Recovery: Download
    md5: 7d44b9a6f8f59e3c4357ac5cd9db60eb
  3. Connect the EVO 4G LTE to the computer via USB.
  4. Make sure the fastboot binary is in your PATH or that you place the recovery image in the same directory as fastboot.
  5. 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 for your device while it is powered off.
  6. 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 permissionsfastboot”, make sure your UDEV rules are setup correctly.
  7. Flash recovery onto your device by entering the following command:
    fastboot flash recovery your_recovery_image.img
    where the latter part is the filename of the recovery image.
  8. Once the flash completes successfully, reboot the device into recovery to verify the installation. Boot to recovery instructions: With the device powered down, hold the Volume Down and Power buttons until HBOOT appears, then release the buttons. Navigate using the volume keys and select RECOVERY using the Power key.
    • 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

Note:

This device, if unlocked with HTCDev Unlock, must have its kernel flashed via fastboot. When you reach the end of the instructions below, do not restart your device to CyanogenMod yet. Instead, restart to the bootloader and put the phone in fastboot mode. Extract boot.img from the CyanogenMod .zip package you just installed and flash it via fastboot: cd to the directory containing boot.img and execute fastboot flash boot boot.img. This needs to be done EVERY time CyanogenMod is updated, thus it is recommended to not use the internal CM updater. The alternative to this burden is to S-OFF your device (recommended), then the boot partition will automatically be updated when CyanogenMod is installed or updated.

  1. Make sure your computer has working adb.
  2. Download the CyanogenMod build package for your device that you’d like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  3. Place the CyanogenMod .zip package, as well as any optional .zip packages, on the root of /sdcard:
    • Using adb: adb push filename.zip /sdcard/
    Note: You can copy the .zip packages to your device using any method you are familiar with. The adb method is used here because it is universal across all devices and works in both Android and recovery mode. If you are in recovery mode, you may need to ensure /sdcard (sometimes called Internal Storage) is mounted by checking its status in the Mounts menu. If you have booted regularly, USB debugging must be enabled.
  4. If you are not already in recovery, boot to recovery mode now.
    • With the device powered down, hold the Volume Down and Power buttons until HBOOT appears, then release the buttons. Navigate using the volume keys and select RECOVERY using the Power key.
  5. In Team Win Recovery Project, select menu choices by tapping on the appropriately labelled button.
  6. Optional (Recommended): Select the Backup button to create a backup.
  7. Select Wipe and then Factory Reset.
  8. Select Install.
  9. Navigate to /sdcard and select the CyanogenMod .zip package.
  10. Follow the on-screen notices to install the package.
  11. Optional: Install any additional packages you wish using the same method (if you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it).
  12. Once installation has finished, return to the main menu and select Reboot, then System. The device will now boot into CyanogenMod.

Helpful Tip

See something wrong on this page? Click here: Report a Site Problem.

How To Build CyanogenMod For HTC EVO 4G LTE (jewel)

Introduction

These instructions will hopefully assist you to start with a stock EVO 4G LTE, unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A EVO 4G LTE
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the EVO 4G LTE (typically micro USB, but older devices may use mini USB or have a proprietary cable)
  • A decent internet connection & reliable electricity :)
  • Some familiarity with basic Android operation and terminology. It would help if you’ve installed custom roms on other devices and are familiar with recovery. It may also be useful to know some basic command line concepts such as cd for “change directory”, the concept of directory hierarchies, that in Linux they are separated by /, etc.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.

Note:

You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment

Note:

You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see http://source.android.com/source/initializing.html which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt apps (CM11 and below)

Next,

$ cd ~/android/system/vendor/cm

then enter:

$ ./get-prebuilts

You won’t see any confirmation- just another prompt. But this should cause some prebuilt apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

Helpful Tip – Errors during breakfast

Different maintainers setup their device inheritance rules differently. Some require a vendor directory to be populated before breakfast will even succeed. If you receive an error here about vendor makefiles, then jump down to the next section Extract proprietary blobs. The first portion of breakfast should have succeeded at pulling in the device tree and the extract blobs script should be available. After completing that section, you can rerun breakfast jewel

After the source downloads, ensure you are in the root of the source code (cd ~/android/system), then type:

$ source build/envsetup.sh
$ breakfast jewel

This will download the device specific configuration and kernel source for your device. An alternative to using the breakfast command is to build your own local manifest. To do this, you will need to locate your device on CyanogenMod’s GitHub and list all of the repositories defined in cm.dependencies in your local manifest.

Helpful Tip

If you want to know more about what source build/envsetup.sh does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/envsetup.sh from ~/android/system.

Extract proprietary blobs

Now ensure that your EVO 4G LTE is connected to your computer via the USB cable and that you are in the ~/android/system/device/htc/jewel directory (you can cd ~/android/system/device/htc/jewel if necessary). Then run the extract-files.sh script:

$ ./extract-files.sh

You should see the proprietary files (aka “blobs”) get pulled from the device and moved to the ~/android/system/vendor/htc directory. If you see errors about adb being unable to pull the files, adb may not be in the path of execution. If this is the case, see the adb page for suggestions for dealing with “command not found” errors.

Note:

Your device should already be running a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly.

Note:

It’s important that these proprietary files are extracted to the ~/android/system/vendor/htc directory by using the extract-files.sh script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilts/misc/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch jewel

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make jewel should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/jewel/cm_jewel-ota-eng.root.zip] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/common.py:

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2) cm-13.0-20161224-UNOFFICIAL-jewel.zip, which is the CyanogenMod installation package.

Installing a custom recovery using fastboot

See All About Recovery Images for more information about custom recoveries and their capabilities.

  1. Make sure your computer has working fastboot and adb.
  1. Connect the EVO 4G LTE to the computer via USB.
  2. Make sure the fastboot binary is in your PATH or that you place the recovery image in the same directory as fastboot.
  3. 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 for your device while it is powered off.
  4. 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 permissionsfastboot”, make sure your UDEV rules are setup correctly.
  5. Flash recovery onto your device by entering the following command:
    fastboot flash recovery your_recovery_image.img
    where the latter part is the filename of the recovery image.
  6. Once the flash completes successfully, reboot the device into recovery to verify the installation.
    • 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.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:

cm-13.0-20161224-UNOFFICIAL-jewel.zip

Note:

The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the cm...zip file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.

Categories HTC

HTC One Mini (m4)

CyanogenMod ROM HTC One Mini (m4)

CyanogenMod ROM HTC One Mini (m4)

Quick Info

Download CyanogenMod

Download (nightly build)
CyanogenMod 11 (Android 4.4-4.4.4 (KitKat))

Notes

Note: Minimum supported recovery

The minimum version of recovery that can be used to install CyanogenMod on this device is: ClockworkMod 6.0.4.9 or TWRP 2.7.0.8. See this page for more information.

Special boot modes

  • Recovery: With the device powered down, hold the Volume Down and Power buttons until HBOOT appears, then release the buttons. Navigate using the volume keys and select RECOVERY using the Power key.
  • Bootloader: With the device powered down, hold the Volume Down and Power buttons until HBOOT appears, then release the buttons.
  • Fastboot: With the device powered down, hold the Volume Down and Power buttons until HBOOT appears, then release the buttons. Navigate using the volume keys and select FASTBOOT using the Power key.

Source code

Device http://www.github.com/cyanogenmod/android_device_htc_m4
Kernel http://www.github.com/cyanogenmod/android_kernel_htc_msm8960
One Mini Specifications
Codename: m4
Vendor: HTC
Manufacturer: HTC
Release date: 2013 August
Type: phone
GSM freq: 850 900 1800 1900 2100 MHz UMTS/HSPA+
LTE freq: 800 1800 2600 MHz (EMEA)
900 1800 2100 2600 MHz (Asia)
700 850 1700 1900 2100 MHz (AT&T)
Platform: Qualcomm Snapdragon 400
CPU: 1.4 GHz dual-core Krait 200
GPU: Adreno 305
RAM: 1GB
Weight: 122 g (4.30 oz)
Dimensions: 132 mm (h)
63.2 mm (w)
9.3 mm (d)
Screen size: 109 mm (4.3 in)
Resolution: 1280×720
Screen density: 342 ppi
Screen type: Super-LCD 2
Internal storage: 16GB
SD Card: none
Bluetooth: 4.0
Wi-Fi: 802.11 b/g/n 2.4/5GHz
Main camera: 4UP, flash: LED
Secondary camera: 1.6MP
Power: 1800 mAh
Sound: Boomsound, Beats Audio
Peripherals: stereo speakers, accelerometer, gyroscope, proximity sensor, digital compass, GPS, magnometer, microphone
CM supported: 11

How to Install CyanogenMod on the HTC One Mini (m4)

Note: DISCLAIMER

Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.

Important Notes

Note: Minimum supported recovery

The minimum version of recovery that can be used to install CyanogenMod on this device is: ClockworkMod 6.0.4.9 or TWRP 2.7.0.8. See this page for more information.

Unlocking the bootloader

WARNING:

Unlocking the bootloader will automatically wipe all device data.

Note:

The One Mini can be unlocked officially via the HTC Dev unlock program. This unlock method may have certain restrictions, such as not being able to flash a kernel via recovery (no longer applicable to 2013+ released HTC devices) or no USB access to sdcard in recovery. Some devices, however, have no other method to install custom firmware.

  1. Make sure your computer has working fastboot and adb.
  2. Enable USB debugging on the device.
  3. Enable OEM unlock in the Developer options settings on the device. (Note: Not all devices have this setting, so continue with next step if yours does not.)
  4. Connect the device to the computer through USB.
  5. From a terminal on a computer, type the following to boot the device into fastboot mode:
    adb reboot bootloader
  6. 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.
  7. From the same terminal, type the following command to obtain your bootloader unlock token:
    fastboot oem get_identifier_token
  8. Visit the HTCDev Bootloader Unlock website and follow the instructions there to obtain your unlock key and unlock your bootloader. If your device does not appear in the drop-down list, select All Other Supported Models.
  9. If the device doesn’t automatically reboot, reboot it from the menu. It should now be unlocked.
  10. Since the device resets completely, you will need to re-enable USB debugging on the device to continue.

Installing a custom recovery using fastboot

See All About Recovery Images for more information about custom recoveries and their capabilities.

  1. Make sure your computer has working fastboot and adb.
  2. Download recovery — you can directly download a recovery image using the link below, or visit twrp.me to obtain the latest version of Team Win Recovery Project for your device.
    Recovery: Download
    md5: 325d6d51d7938c76da4ea862fccfeddd
  3. Connect the One Mini to the computer via USB.
  4. Make sure the fastboot binary is in your PATH or that you place the recovery image in the same directory as fastboot.
  5. 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 for your device while it is powered off.
  6. 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 permissionsfastboot”, make sure your UDEV rules are setup correctly.
  7. Flash recovery onto your device by entering the following command:
    fastboot flash recovery your_recovery_image.img
    where the latter part is the filename of the recovery image.
  8. Once the flash completes successfully, reboot the device into recovery to verify the installation. Boot to recovery instructions: With the device powered down, hold the Volume Down and Power buttons until HBOOT appears, then release the buttons. Navigate using the volume keys and select RECOVERY using the Power key.
    • 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

  1. Make sure your computer has working adb.
  2. Download the CyanogenMod build package for your device that you’d like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  3. Place the CyanogenMod .zip package, as well as any optional .zip packages, on the root of /sdcard:
    • Using adb: adb push filename.zip /sdcard/
    Note: You can copy the .zip packages to your device using any method you are familiar with. The adb method is used here because it is universal across all devices and works in both Android and recovery mode. If you are in recovery mode, you may need to ensure /sdcard (sometimes called Internal Storage) is mounted by checking its status in the Mounts menu. If you have booted regularly, USB debugging must be enabled.
  4. If you are not already in recovery, boot to recovery mode now.
    • With the device powered down, hold the Volume Down and Power buttons until HBOOT appears, then release the buttons. Navigate using the volume keys and select RECOVERY using the Power key.
  5. In Team Win Recovery Project, select menu choices by tapping on the appropriately labelled button.
  6. Optional (Recommended): Select the Backup button to create a backup.
  7. Select Wipe and then Factory Reset.
  8. Select Install.
  9. Navigate to /sdcard and select the CyanogenMod .zip package.
  10. Follow the on-screen notices to install the package.
  11. Optional: Install any additional packages you wish using the same method (if you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it).
  12. Once installation has finished, return to the main menu and select Reboot, then System. The device will now boot into CyanogenMod.

Helpful Tip

See something wrong on this page? Click here: Report a Site Problem.

How To Build CyanogenMod For HTC One Mini (m4)

Introduction

These instructions will hopefully assist you to start with a stock One Mini, unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A One Mini
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the One Mini (typically micro USB, but older devices may use mini USB or have a proprietary cable)
  • A decent internet connection & reliable electricity :)
  • Some familiarity with basic Android operation and terminology. It would help if you’ve installed custom roms on other devices and are familiar with recovery. It may also be useful to know some basic command line concepts such as cd for “change directory”, the concept of directory hierarchies, that in Linux they are separated by /, etc.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.

Note:

You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment

Note:

You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see http://source.android.com/source/initializing.html which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt apps (CM11 and below)

Next,

$ cd ~/android/system/vendor/cm

then enter:

$ ./get-prebuilts

You won’t see any confirmation- just another prompt. But this should cause some prebuilt apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

Helpful Tip – Errors during breakfast

Different maintainers setup their device inheritance rules differently. Some require a vendor directory to be populated before breakfast will even succeed. If you receive an error here about vendor makefiles, then jump down to the next section Extract proprietary blobs. The first portion of breakfast should have succeeded at pulling in the device tree and the extract blobs script should be available. After completing that section, you can rerun breakfast m4

After the source downloads, ensure you are in the root of the source code (cd ~/android/system), then type:

$ source build/envsetup.sh
$ breakfast m4

This will download the device specific configuration and kernel source for your device. An alternative to using the breakfast command is to build your own local manifest. To do this, you will need to locate your device on CyanogenMod’s GitHub and list all of the repositories defined in cm.dependencies in your local manifest.

Helpful Tip

If you want to know more about what source build/envsetup.sh does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/envsetup.sh from ~/android/system.

Extract proprietary blobs

Now ensure that your One Mini is connected to your computer via the USB cable and that you are in the ~/android/system/device/htc/m4 directory (you can cd ~/android/system/device/htc/m4 if necessary). Then run the extract-files.sh script:

$ ./extract-files.sh

You should see the proprietary files (aka “blobs”) get pulled from the device and moved to the ~/android/system/vendor/htc directory. If you see errors about adb being unable to pull the files, adb may not be in the path of execution. If this is the case, see the adb page for suggestions for dealing with “command not found” errors.

Note:

Your device should already be running a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly.

Note:

It’s important that these proprietary files are extracted to the ~/android/system/vendor/htc directory by using the extract-files.sh script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilts/misc/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch m4

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make m4 should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/m4/cm_m4-ota-eng.root.zip] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/common.py:

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2) cm-13.0-20161224-UNOFFICIAL-m4.zip, which is the CyanogenMod installation package.

Installing a custom recovery using fastboot

See All About Recovery Images for more information about custom recoveries and their capabilities.

  1. Make sure your computer has working fastboot and adb.
  1. Connect the One Mini to the computer via USB.
  2. Make sure the fastboot binary is in your PATH or that you place the recovery image in the same directory as fastboot.
  3. 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 for your device while it is powered off.
  4. 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 permissionsfastboot”, make sure your UDEV rules are setup correctly.
  5. Flash recovery onto your device by entering the following command:
    fastboot flash recovery your_recovery_image.img
    where the latter part is the filename of the recovery image.
  6. Once the flash completes successfully, reboot the device into recovery to verify the installation.
    • 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.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:

cm-13.0-20161224-UNOFFICIAL-m4.zip

Note:

The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the cm...zip file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.

Categories HTC

HTC Incredible 2 (vivow)

Cyanogenmod ROM HTC Incredible 2 (Vivow)

Cyanogenmod ROM HTC Incredible 2 (vivow)

Quick Info

Download CyanogenMod

Download (nightly build)
CyanogenMod 7 (Android 2.3 (Gingerbread))

Note: Support Status

This device does not support the latest official release of CyanogenMod. This may be due to hardware limitations or simply because development is ongoing. The most recent version supported is based on the gingerbread branch of CyanogenMod.

Special boot modes

  • Recovery: Vol Down & Power then select recovery

Source code

Device http://www.github.com/cyanogenmod/android_device_htc_vivow
Incredible 2 Specifications
Codename: vivow
Vendor: HTC
Manufacturer: HTC
Release date: 2011 April 28 (USA)
Type: phone
CDMA freq: Dual-Band CDMA 800 1900MHz
Quad-Band GSM 850 900 1800 1900 MHz
Dual-Band UMTS 900 2100MHz
Platform: Qualcomm MSM8655
CPU: 1 GHz single-core Qualcomm Snapdragon S2
RAM: 768MB
Weight: 136 g (4.8 oz)
Dimensions: 120 mm (4.7 in) (h)
64 mm (2.52 in) (w)
12 mm (0.472 in) (d)
Screen size: 102 mm (4.0 in)
Resolution: 800×480
Screen density: 233 ppi
Screen type: S-LCD
Internal storage: 1.1GB
SD Card: up to 32GB
Bluetooth: 2.1+EDR w A2DP Stereo
Wi-Fi: 802.11b/g
Main camera: 8MP w/ dual LED flash
Secondary camera: 1.3MP
Power: 1450 mAh internal, rechargeable, removable lithium-ion battery
Peripherals: micro-USB, A-GPS, FM Radio, DNLA, capacitive touchscreen, proximity & ambient light sensors, volume controls, 3-axis accelerometer, digital compass
CM supported: 7
Latest CM version: gingerbread

How to Install CyanogenMod on the HTC Incredible 2 (vivow)

Note: DISCLAIMER

Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.

Obtaining S-OFF and installing a custom recovery on the Incredible 2

Certain HTC devices can be exploited via a tool called Revolutionary to obtain S-OFF. The status of your device’s support can be checked at their site. Pay close attention to the HBOOT revision as newer updates break the tool’s ability to work properly. The Revolutionary tool will also install ClockworkMod Recovery.

Supported version(s) of HBOOT for the Incredible 2: 0.97.0000 (Gingerbread only!).

  1. Windows Only: Download and install HTC USB drivers v3.0.0.007
    md5: f60771a86c4ad69c8c9c1d158e60e850
  2. Disable Fast Boot on the Incredible 2 (not to be confused with fastboot):
    Settings » Power » Fast Boot
    (or)
    Settings » Applications » Fast Boot
  3. Enable USB debugging:
    Settings » Applications » Development » USB debugging
  4. Connect the Incredible 2 to the computer via USB
  5. Find your device’s HBOOT version:
    From a command prompt or terminal, type: adb reboot bootloader
    If your HBOOT version is NOT 0.97.0000 (Gingerbread only!), you will need to downgrade. To downgrade your Incredible 2 from Gingerbread (Including HBOOT 2.18) to Froyo, so you can root with unrEVOked v3.32 and gain RADIO S-OFF, follow this guide: [[1]]
  6. Write down the serial number of the device:
    If at the bootloader: fastboot devices
    If Android is booted: adb devices
    Alternatively, the serial number can usually be found under the battery
  7. Download Revolutionary 0.4pre4
  8. Fill out the form on the Revolutionary site to get a beta key.
  9. Once you have the beta key, launch the Revolutionary beta (you may need to launch it as root or administrator) and enter in the beta key minding that the key contains both upper- and lower-case letters.
  10. Revolutionary will now attempt to temp-root your device, set S-OFF, and install a custom recovery image. The device will reboot on its own and the entire process should only take a few minutes. If the process takes longer than 15 minutes, reboot the device and attempt again. Some users have had to attempt S-OFF multiple times before achieving success.

NOTE: If you are unable to S-OFF your device, and it is listed as supported by Revolutionary, join the Revolutionary IRC channel for further assistance.

Installing CyanogenMod from recovery

  1. Make sure your computer has working adb.
  2. Download the CyanogenMod build package for your device that you’d like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  3. Boot to recovery mode, and connect the phone to your computer through USB.
    • Vol Down & Power then select recovery
  4. In ClockworkMod Recovery, use the physical volume buttons to move up and down. On most devices, the power button is used to confirm a menu selection, but for some devices a physical home key acts as a selector. Some devices have touch enabled ClockworkMod Recovery, in which case you may be able to swipe to, or touch, menu selections.
  5. Optional (Recommended): Select backup and restore to create a backup.
  6. Select wipe data/factory reset.
  7. You have two options for transferring and installing the installation packages. The sideload method is more universal across devices, whereas the push and install method is more commonly used:
    • Sideload method: select install zip > install zip from sideload. Follow the on-screen notices to install the package. The installer does not necessarily display an “Install complete.” message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Push and install method: Open a command prompt (or Terminal on Mac and Linux) and navigate to the directory holding the package(s) you would like to install. On the device, navigate to the mounts and storage menu. If you see /storage/sdcard0 or /sdcard as a mountable volume, go ahead and mount it. If you do not see one of these partitions, then instead mount the /data partition. Take note of which volume you mounted. Now, push the package(s) to your device (also, see tip below):
    – If you mounted /storage/sdcard0, then: adb push update.zip /storage/sdcard0/
    – If you mounted /sdcard or /data, then: adb push update.zip /sdcard/
    where update.zip should be replaced with the package filename. Go back to the main menu and select install zip. Choose to install from the same directory where you pushed the package(s). If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  8. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Helpful Tip – SD card folders

CyanogenMod 10.1 and newer have multi-user support (introduced in Android 4.2). If your device has storage on the /data partition, then Android actually looks in /data/media/0/ for the first user’s /sdcard/ storage. ClockworkMod recovery symlinks /sdcard/ to /data/media/ though. So, if you are pushing files to internal storage in recovery and want them to be visible in Android, you should push them to /sdcard/0/ or /data/media/0/. Here’s the most frequent scenarios:

  1. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10 or older: adb push update.zip /sdcard/
  2. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10.1 or newer: adb shell "mkdir /sdcard/0/" followed by adb push update.zip /sdcard/0/
  3. If you’re coming from a ROM with Android 4.2 or newer to CyanogenMod 10.1 or newer: adb push update.zip /sdcard/0/

Helpful Tip

See something wrong on this page? Click here: Report a Site Problem.

How To Build CyanogenMod For HTC Incredible 2 (vivow)

Introduction

These instructions will hopefully assist you to start with a stock Incredible 2, unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A Incredible 2
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the Incredible 2 (typically micro USB, but older devices may use mini USB or have a proprietary cable)
  • A decent internet connection & reliable electricity :)
  • Some familiarity with basic Android operation and terminology. It would help if you’ve installed custom roms on other devices and are familiar with recovery. It may also be useful to know some basic command line concepts such as cd for “change directory”, the concept of directory hierarchies, that in Linux they are separated by /, etc.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.

Note:

You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment

Note:

You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see http://source.android.com/source/initializing.html which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b gingerbread

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt Rom Manager

$ cd ~/android/system/vendor/cyanogen

then enter:

$ ./get-rommanager

You won’t see any confirmation- just another prompt. But this should cause the Rom Manager apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

After the source downloads, ensure you are in the root of the source code (cd ~/android/system), then type:
$ source build/envsetup.sh
$ lunch

You should see a list of devices, including something like cm_vivow-userdebug. Select it by typing its number. It is possible that lunch does not display your device. In that case try

$ lunch cm_vivow-userdebug

or

$ lunch full_vivow-userdebug

If all goes well, you should see that vivow-specific directories are downloaded automatically.

Helpful Tip

If you want to know more about what source build/envsetup.sh does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/envsetup.sh from ~/android/system.

Extract proprietary blobs

Now ensure that your Incredible 2 is connected to your computer via the USB cable and that you are in the ~/android/system/device/htc/vivow directory (you can cd ~/android/system/device/htc/vivow if necessary). Then run the extract-files.sh script:

$ ./extract-files.sh

You should see the proprietary files (aka “blobs”) get pulled from the device and moved to the ~/android/system/vendor/htc directory. If you see errors about adb being unable to pull the files, adb may not be in the path of execution. If this is the case, see the adb page for suggestions for dealing with “command not found” errors.

Note:

Your device should already be running a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly.

Note:

It’s important that these proprietary files are extracted to the ~/android/system/vendor/htc directory by using the extract-files.sh script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilt/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch vivow

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make vivow should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/vivow/cm_vivow-ota-eng.root.zip] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/common.py:

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2) cm-7-20161224-UNOFFICIAL-vivow.zip, which is the CyanogenMod installation package.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:

cm-7-20161224-UNOFFICIAL-vivow.zip

Note:

The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the cm...zip file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.

Categories HTC

HTC Incredible S (vivo)

Cyanogenmod ROM HTC Incredible S (Vivo)

Cyanogenmod ROM HTC Incredible S (vivo)

Quick Info

Download CyanogenMod

Download (nightly build)
CyanogenMod 7 (Android 2.3 (Gingerbread))

Note: Support Status

This device does not support the latest official release of CyanogenMod. This may be due to hardware limitations or simply because development is ongoing. The most recent version supported is based on the gingerbread branch of CyanogenMod.

Source code

Device http://www.github.com/cyanogenmod/android_device_htc_vivo
Incredible S Specifications
Codename: vivo
Vendor: HTC
Manufacturer: HTC
Release date: 2011 February 26 (UK)
2011 March 17 RUS)
Type: phone
GSM freq: Quad-band GSM 850 900 1800 1900 MHz GPRS/EDGE
Tri-band 900 AWS 2100 MHz HSPA/WCDMA
Platform: Qualcomm MSM8255
CPU: 1 GHz single-core Qualcomm Snapdragon S2
RAM: 768MB
Weight: 136 g (4.8 oz)
Dimensions: 120 mm (4.7 in) (h)
64 mm (2.52 in) (w)
12 mm (0.472 in) (d)
Screen size: 102 mm (4.0 in)
Resolution: 800×480
Screen density: 233 ppi
Screen type: S-LCD
Internal storage: 16GB
SD Card: up to 32GB
Bluetooth: 2.1+EDR w A2DP Stereo
Wi-Fi: 802.11b/g
Main camera: 8MP w/ dual LED flash
Secondary camera: 1.3MP
Power: 1450 mAh internal, rechargeable, removable lithium-ion battery
Peripherals: micro-USB, A-GPS, FM Radio, DNLA, capacitive touchscreen, proximity & ambient light sensors, volume controls, 3-axis accelerometer, digital compass
CM supported: 7
Latest CM version: gingerbread

How to Install CyanogenMod on the HTC Incredible S (vivo)

Note: DISCLAIMER

Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.

Obtaining S-OFF and installing a custom recovery on the Incredible S

Certain HTC devices can be exploited via a tool called Revolutionary to obtain S-OFF. The status of your device’s support can be checked at their site. Pay close attention to the HBOOT revision as newer updates break the tool’s ability to work properly. The Revolutionary tool will also install ClockworkMod Recovery.

Supported version(s) of HBOOT for the Incredible S: 1.09.0000, 1.13.0000.

  1. Windows Only: Download and install HTC USB drivers v3.0.0.007
    md5: f60771a86c4ad69c8c9c1d158e60e850
  2. Disable Fast Boot on the Incredible S (not to be confused with fastboot):
    Settings » Power » Fast Boot
    (or)
    Settings » Applications » Fast Boot
  3. Enable USB debugging:
    Settings » Applications » Development » USB debugging
  4. Connect the Incredible S to the computer via USB
  5. Find your device’s HBOOT version:
    From a command prompt or terminal, type: adb reboot bootloader
    If your HBOOT version is NOT 1.09.0000, 1.13.0000, you will need to downgrade. To downgrade your Incredible S from Gingerbread (Including HBOOT 2.18) to Froyo, so you can root with unrEVOked v3.32 and gain RADIO S-OFF, follow this guide: [[1]]
  6. Write down the serial number of the device:
    If at the bootloader: fastboot devices
    If Android is booted: adb devices
    Alternatively, the serial number can usually be found under the battery
  7. Download Revolutionary 0.4pre4
  8. Fill out the form on the Revolutionary site to get a beta key.
  9. Once you have the beta key, launch the Revolutionary beta (you may need to launch it as root or administrator) and enter in the beta key minding that the key contains both upper- and lower-case letters.
  10. Revolutionary will now attempt to temp-root your device, set S-OFF, and install a custom recovery image. The device will reboot on its own and the entire process should only take a few minutes. If the process takes longer than 15 minutes, reboot the device and attempt again. Some users have had to attempt S-OFF multiple times before achieving success.

NOTE: If you are unable to S-OFF your device, and it is listed as supported by Revolutionary, join the Revolutionary IRC channel for further assistance.

Installing CyanogenMod from recovery

  1. Make sure your computer has working adb.
  2. Download the CyanogenMod build package for your device that you’d like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  3. Boot to recovery mode, and connect the phone to your computer through USB.
  1. In ClockworkMod Recovery, use the physical volume buttons to move up and down. On most devices, the power button is used to confirm a menu selection, but for some devices a physical home key acts as a selector. Some devices have touch enabled ClockworkMod Recovery, in which case you may be able to swipe to, or touch, menu selections.
  2. Optional (Recommended): Select backup and restore to create a backup.
  3. Select wipe data/factory reset.
  4. You have two options for transferring and installing the installation packages. The sideload method is more universal across devices, whereas the push and install method is more commonly used:
    • Sideload method: select install zip > install zip from sideload. Follow the on-screen notices to install the package. The installer does not necessarily display an “Install complete.” message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Push and install method: Open a command prompt (or Terminal on Mac and Linux) and navigate to the directory holding the package(s) you would like to install. On the device, navigate to the mounts and storage menu. If you see /storage/sdcard0 or /sdcard as a mountable volume, go ahead and mount it. If you do not see one of these partitions, then instead mount the /data partition. Take note of which volume you mounted. Now, push the package(s) to your device (also, see tip below):
    – If you mounted /storage/sdcard0, then: adb push update.zip /storage/sdcard0/
    – If you mounted /sdcard or /data, then: adb push update.zip /sdcard/
    where update.zip should be replaced with the package filename. Go back to the main menu and select install zip. Choose to install from the same directory where you pushed the package(s). If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  5. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Helpful Tip – SD card folders

CyanogenMod 10.1 and newer have multi-user support (introduced in Android 4.2). If your device has storage on the /data partition, then Android actually looks in /data/media/0/ for the first user’s /sdcard/ storage. ClockworkMod recovery symlinks /sdcard/ to /data/media/ though. So, if you are pushing files to internal storage in recovery and want them to be visible in Android, you should push them to /sdcard/0/ or /data/media/0/. Here’s the most frequent scenarios:

  1. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10 or older: adb push update.zip /sdcard/
  2. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10.1 or newer: adb shell "mkdir /sdcard/0/" followed by adb push update.zip /sdcard/0/
  3. If you’re coming from a ROM with Android 4.2 or newer to CyanogenMod 10.1 or newer: adb push update.zip /sdcard/0/

Helpful Tip

See something wrong on this page? Click here: Report a Site Problem.

How To Build CyanogenMod For HTC Incredible S (vivo)

Introduction

These instructions will hopefully assist you to start with a stock Incredible S, unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A Incredible S
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the Incredible S (typically micro USB, but older devices may use mini USB or have a proprietary cable)
  • A decent internet connection & reliable electricity :)
  • Some familiarity with basic Android operation and terminology. It would help if you’ve installed custom roms on other devices and are familiar with recovery. It may also be useful to know some basic command line concepts such as cd for “change directory”, the concept of directory hierarchies, that in Linux they are separated by /, etc.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.

Note:

You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment

Note:

You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see http://source.android.com/source/initializing.html which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b gingerbread

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt Rom Manager

$ cd ~/android/system/vendor/cyanogen

then enter:

$ ./get-rommanager

You won’t see any confirmation- just another prompt. But this should cause the Rom Manager apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

After the source downloads, ensure you are in the root of the source code (cd ~/android/system), then type:
$ source build/envsetup.sh
$ lunch

You should see a list of devices, including something like cm_vivo-userdebug. Select it by typing its number. It is possible that lunch does not display your device. In that case try

$ lunch cm_vivo-userdebug

or

$ lunch full_vivo-userdebug

If all goes well, you should see that vivo-specific directories are downloaded automatically.

Helpful Tip

If you want to know more about what source build/envsetup.sh does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/envsetup.sh from ~/android/system.

Extract proprietary blobs

Now ensure that your Incredible S is connected to your computer via the USB cable and that you are in the ~/android/system/device/htc/vivo directory (you can cd ~/android/system/device/htc/vivo if necessary). Then run the extract-files.sh script:

$ ./extract-files.sh

You should see the proprietary files (aka “blobs”) get pulled from the device and moved to the ~/android/system/vendor/htc directory. If you see errors about adb being unable to pull the files, adb may not be in the path of execution. If this is the case, see the adb page for suggestions for dealing with “command not found” errors.

Note:

Your device should already be running a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly.

Note:

It’s important that these proprietary files are extracted to the ~/android/system/vendor/htc directory by using the extract-files.sh script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilt/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch vivo

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make vivo should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/vivo/cm_vivo-ota-eng.root.zip] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/common.py:

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2) cm-7-20161224-UNOFFICIAL-vivo.zip, which is the CyanogenMod installation package.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:

cm-7-20161224-UNOFFICIAL-vivo.zip

Note:

The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the cm...zip file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.

Categories HTC

HTC Hero (GSM) (heroc)

HTC Heroc Cyanogenmod

Cyanogenmod ROM HTC Hero (GSM) (heroc)

Quick Info

Download CyanogenMod

Download (nightly build)
CyanogenMod 7 (Android 2.3 (Gingerbread))

Note: Support Status

This device does not support the latest official release of CyanogenMod. This may be due to hardware limitations or simply because development is ongoing. The most recent version supported is based on the gingerbread branch of CyanogenMod.

Notes

The HTC Hero (CDMA) (aka heroc) is a touchscreen smartphone manufactured by HTC. It was released in two flavors, CDMA & GSM. Official CyanogenMod support for the HTC Hero (CDMA) was added in CyanogenMod 6.

Source code

Device http://www.github.com/cyanogenmod/android_device_htc_heroc
Hero (CDMA) Specifications
Codename: heroc
Vendor: HTC
Release date: 2009 October 11 (USA)
Type: phone
CDMA freq: 800 1900 MHz CDMA
2000 MHz 1xEV-DO
Platform: Qualcomm MSM7600A
CPU: 528 MHz single-core Qualcomm
RAM: 288MB
Weight: 135 g (4.8 oz)
Dimensions: 112 mm (4.4 in) (h)
56.2 mm (2.21 in) (w)
14.35 mm (0.565 in) (d)
Screen size: 81 mm (3.2 in)
Resolution: 480×320
Screen density: 180 ppi
Internal storage: 256MB
SD Card: up to 32GB
Bluetooth: 2.0 + EDR
Wi-Fi: 802.11b/g
Main camera: 5MP
Power: 1500 mAh Internal rechargeable removable lithium-ion battery
Peripherals: capacitive touchscreen, volume controls, ambient light sensors, 3-axis accelerometer, digital compass
CM supported: 7
Latest CM version: gingerbread

Note: DISCLAIMER

Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.

Gain Root with Framaroot

  1. Install Framaroot for one click root. http://forum.xda-developers.com/showthread.php?t=2130276 (Select Gimli.)
  2. Run adb push Framaroot_9.9.9.apk /sdcard/
  3. Open Files app, navigate to SDCard, select Framaroot, install, open, root, reboot.

Gaining Root Access with rageagainstthecage

  1. You will need ADB on the computer to root the Hero (CDMA).
  2. Download the following files:
    • rageagainstthecage-arm5: Download
      md5: bfa28d457b54508326ab55d11399c586
      (Note: Antivirus software may delete this because “it could be used by malware to root Android phones”. Either turn off your antivirus, or flag this as “allowed” while you are gaining root access, and un”allow” it when done.)
    • Superuser package: Download
      md5: 43d9a40b63e916635d5ad7ca32433fab
  1. Unzip rageinthecage-arm5 & the Superuser package to the same folder as adb (the /platform-tools folder within the Android SDK folder).
  2. Connect the Hero (CDMA) to the computer via USB.
  3. Allow “USB debug” on the device: Settings > Applications > Development and check USB debugging box.
  4. On the computer, open terminal and run the following commands:
    adb push rageagainstthecage-arm5.bin /data/local/tmp/
    adb shell
    chmod 755 /data/local/tmp/rageagainstthecage-arm5.bin
    /data/local/tmp/rageagainstthecage-arm5.bin
  5. Once the exploit finishes, in terminal, run the following commands:
    exit
    adb kill-server
    adb start-server
    adb shell

    NOTE: You should see a “#”. If you see a “$”, then the exploit didn’t work, please repeat steps 4 & 5.
    mount -o rw,remount /dev/block/mtdblock3 /system
    exit
    adb push su /system/xbin/
    adb shell chmod 4755 /system/xbin/su
    adb push Superuser.apk /system/app/
  6. The Hero (CDMA) is now rooted, please continue to the next section.

Installing a recovery image using flash_image

Use of the flash_image binary assumes your device already has root. For more detailed instructions on using the tools in this guide, please visit ADB.

  1. Download the flash_image binary
  2. Install the binary into /data/local on your phone via adb and set permissions
    • adb push flash_image /data/local/
    • adb shell chmod 777 /data/local/flash_image
  3. Download koush’s ClockworkMod Recovery.
    • koush’s ClockworkMod Recovery: download
      md5: 4b079b60f9af1e79c353b4c410991568
  4. Push the file(s) to your device via adb.
    • adb push yourrecoveryimage.img /data/local/
    • adb shell chmod 777 /data/local/yourrecoveryimage.img

Flash the recovery:

  1. adb shell /data/local/flash_image recovery /data/local/yourrecoveryimage.img

Installing CyanogenMod from recovery

  1. Make sure your computer has working adb.
  2. Download the CyanogenMod build package for your device that you’d like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  3. Boot to recovery mode, and connect the phone to your computer through USB.
    • Home & Power
  4. In ClockworkMod Recovery, use the physical volume buttons to move up and down. On most devices, the power button is used to confirm a menu selection, but for some devices a physical home key acts as a selector. Some devices have touch enabled ClockworkMod Recovery, in which case you may be able to swipe to, or touch, menu selections.
  5. Optional (Recommended): Select backup and restore to create a backup.
  6. Select wipe data/factory reset.
  7. You have two options for transferring and installing the installation packages. The sideload method is more universal across devices, whereas the push and install method is more commonly used:
    • Sideload method: select install zip > install zip from sideload. Follow the on-screen notices to install the package. The installer does not necessarily display an “Install complete.” message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Push and install method: Open a command prompt (or Terminal on Mac and Linux) and navigate to the directory holding the package(s) you would like to install. On the device, navigate to the mounts and storage menu. If you see /storage/sdcard0 or /sdcard as a mountable volume, go ahead and mount it. If you do not see one of these partitions, then instead mount the /data partition. Take note of which volume you mounted. Now, push the package(s) to your device (also, see tip below):
    – If you mounted /storage/sdcard0, then: adb push update.zip /storage/sdcard0/
    – If you mounted /sdcard or /data, then: adb push update.zip /sdcard/
    where update.zip should be replaced with the package filename. Go back to the main menu and select install zip. Choose to install from the same directory where you pushed the package(s). If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  8. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Helpful Tip – SD card folders

CyanogenMod 10.1 and newer have multi-user support (introduced in Android 4.2). If your device has storage on the /data partition, then Android actually looks in /data/media/0/ for the first user’s /sdcard/ storage. ClockworkMod recovery symlinks /sdcard/ to /data/media/ though. So, if you are pushing files to internal storage in recovery and want them to be visible in Android, you should push them to /sdcard/0/ or /data/media/0/. Here’s the most frequent scenarios:

  1. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10 or older: adb push update.zip /sdcard/
  2. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10.1 or newer: adb shell "mkdir /sdcard/0/" followed by adb push update.zip /sdcard/0/
  3. If you’re coming from a ROM with Android 4.2 or newer to CyanogenMod 10.1 or newer: adb push update.zip /sdcard/0/

How To Build CyanogenMod For HTC Hero (CDMA) (heroc)

Introduction

These instructions will hopefully assist you to start with a stock Hero (CDMA), unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A Hero (CDMA)
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the Hero (CDMA) (typically micro USB, but older devices may use mini USB or have a proprietary cable)
  • A decent internet connection & reliable electricity :)
  • Some familiarity with basic Android operation and terminology. It would help if you’ve installed custom roms on other devices and are familiar with recovery. It may also be useful to know some basic command line concepts such as cd for “change directory”, the concept of directory hierarchies, that in Linux they are separated by /, etc.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.

Note:

You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment

Note:

You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see http://source.android.com/source/initializing.html which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b gingerbread

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt Rom Manager

$ cd ~/android/system/vendor/cyanogen

then enter:

$ ./get-rommanager

You won’t see any confirmation- just another prompt. But this should cause the Rom Manager apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

After the source downloads, ensure you are in the root of the source code (cd ~/android/system), then type:
$ source build/envsetup.sh
$ lunch

You should see a list of devices, including something like cm_heroc-userdebug. Select it by typing its number. It is possible that lunch does not display your device. In that case try

$ lunch cm_heroc-userdebug

or

$ lunch full_heroc-userdebug

If all goes well, you should see that heroc-specific directories are downloaded automatically.

Helpful Tip

If you want to know more about what source build/envsetup.sh does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/envsetup.sh from ~/android/system.

Extract proprietary blobs

Now ensure that your Hero (CDMA) is connected to your computer via the USB cable and that you are in the ~/android/system/device/htc/heroc directory (you can cd ~/android/system/device/htc/heroc if necessary). Then run the extract-files.sh script:

$ ./extract-files.sh

You should see the proprietary files (aka “blobs”) get pulled from the device and moved to the ~/android/system/vendor/htc directory. If you see errors about adb being unable to pull the files, adb may not be in the path of execution. If this is the case, see the adb page for suggestions for dealing with “command not found” errors.

Note:

Your device should already be running a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly.

Note:

It’s important that these proprietary files are extracted to the ~/android/system/vendor/htc directory by using the extract-files.sh script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilt/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch heroc

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make heroc should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/heroc/cm_heroc-ota-eng.root.zip] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/common.py:

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2) cm-7-20161224-UNOFFICIAL-heroc.zip, which is the CyanogenMod installation package.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:

cm-7-20161224-UNOFFICIAL-heroc.zip

Note:

The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the cm...zip file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.

Categories HTC

HTC G2 / Desire Z (Vision)

Cyanogenmod ROM HTC G2 / Desire Z (Vision)

Cyanogenmod ROM HTC G2 / Desire Z (vision)

Quick Info

Download CyanogenMod

Download (nightly build)
CyanogenMod 7 (Android 2.3 (Gingerbread))

Note: Support Status

This device does not support the latest official release of CyanogenMod. This may be due to hardware limitations or simply because development is ongoing. The most recent version supported is based on the gingerbread branch of CyanogenMod.

Notes

The HTC Vision is a touchscreen smartphone manufactured by HTC. It is marketed as the TMobile G2 in the USA and as the HTC Desire Z internationally. Official CyanogenMod support for the HTC Vision was added in CyanogenMod 6.1.

Special boot modes

  • Recovery: Vol Down & Power

Source code

Device http://www.github.com/cyanogenmod/android_device_htc_vision
G2 / Desire Z Specifications
Codename: vision
Vendor: HTC
Manufacturer: HTC
Release date: Oct 6, 2010 (USA)
Type: phone
GSM freq: Quad band GSM 850 900 1800 1900 MHz GPRS/EDGE

Dual band UMTS 1700 2100 MHz, and HSPA+

Platform: Qualcomm MSM7230
CPU: 800 MHz single-core Qualcomm Snapdragon S2
RAM: 512MB
Weight: 180 g (6.3 oz)
Dimensions: 119 mm (4.69 in) (h)

60 mm (2.36 in) (w)

14 mm (0.55 in) (d)

Screen size: 94 mm (3.7 in)
Resolution: 800×480
Screen density: 252 ppi
Screen type: TFT LCD
Internal storage: 4GB
SD Card: yes
Bluetooth: Bluetooth 2.1+EDR
Wi-Fi: (802.11b/g)
Main camera: 5MP w/ LED flash
Power: 1300 mAh internal, rechargeable, removable lithium-ion battery
Peripherals: micro-USB, A-GPS, capacitive touchscreen display, proximity and ambient light sensors, optical joystick, volume controls, 3-axis accelerometer
CM supported: 7
Latest CM version: gingerbread

How to Install CyanogenMod on the HTC G2 / Desire Z (vision)

Note: DISCLAIMER

Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.

Important Notes

The HTC Vision is a touchscreen smartphone manufactured by HTC. It is marketed as the TMobile G2 in the USA and as the HTC Desire Z internationally. Official CyanogenMod support for the HTC Vision was added in CyanogenMod 6.1.

Note:

Although the hardware is virtually identical between both versions of the vision, the installation instructions are slightly different if you have a T-Mobile G2 or Desire Z, so only follow the instructions for your device.

First, downgrade the firmware (if necessary)

If you are running a newer version of the stock firmware, you will need to first downgrade it to an older version which can be “exploited” (by which we mean given the ability to replace the operating system). So, if you have never installed your own firmware, this step may be necessary.

Here are the instructions for both the HTC Desire Z (sold in Europe) and the T-Mobile (sold in the US), both of which are based on the vision hardware:

Rooting the T-Mobile G2

Note:

If you have the Desire Z, skip this section.

Before you begin, if VISIONary is installed on the TMobile G2, uninstall it before continuing.

  1. You will need ADB on the computer to root the TMobile G2 and to flash the necessary files for radio S-OFF. Follow the Android SDK guide, to get the ADB shell on the computer.
  2. Download busybox, the ClockworkMod Recovery, the Engineering HBoot, gfree 1.0, psneuter, root_psn, Superuser package:
    • busybox: Download
      md5: 25c5db694c987995909cc3166d4f01b0
    • ClockworkMod Recovery: Download
      md5: cbc776e7941ebf030e9fa39473d5b6f1
    • Engineering HBoot: Download
      md5: 24670529d0b676ff3e53be33ac003185
    • gfree 1.0: Download
      md5: 0bc9fc22bda897c765b02066f8a3c83b
    • psneuter: Download
      md5: 89c2dec8d72d87b4c669f44dd31c8d17
    • root_psn: Download
      md5: c8fe38ef55eb8951def9ff17b2eb99c1
    • Superuser package: Download
      md5: 43d9a40b63e916635d5ad7ca32433fab
  3. Unzip the zip files and copy the contents to the same folder as adb (the /platform-tools folder within the Android SDK folder).
  4. Connect the TMobile G2 to the computer via USB.
  5. Make sure USB debugging is enabled on the TMobile G2 by checking Settings » Applications » Development » USB debugging.
  6. On the computer, open terminal and run the following commands:
    adb push busybox /data/local/tmp/
    adb push gfree /data/local/tmp/
    adb push hboot-eng.img /data/local/tmp/
    adb push psneuter /data/local/tmp/
    adb push recovery-clockwork-3.0.2.4-vision.img /data/local/tmp/recovery.img
    adb push root_psn /data/local/tmp/
    adb push su /sdcard/
    adb push Superuser.apk /sdcard/
    adb shell
    chmod 755 /data/local/tmp/*
    /data/local/tmp/psneuter

    NOTE: You will drop out of the shell after this command. Restart the shell using:
    adb shell
    cd /data/local/tmp
    ./gfree -f -b hboot-eng.img -y recovery.img
  7. As it is very important that the hboot was installed correctly gfree calculates md5sums of the partition. It will calculate the following 3 checksums
    • md5sum #1 – checksum of partition 18 before the installation
    • md5sum #2 – checksum of the hboot image that should be installed
    • md5sum #3 – checksum of partition 18 after the installation
  8. The messages that you what to see are either/or
    • md5sum #1 == md5sum #2 – the hboot image is already installed -> skipping installation
    • md5sum #3 == md5sum #2 – the hboot image was successfully installed -> OK!
  9. If you get a different error message then DO NOT REBOOT and join #G2Root on Freenode for further help.
  10. If gfree worked correctly continue with:
    ./root_psn
    sync
    reboot
  11. The TMobile G2 is now rooted with S-OFF, the Engineering HBoot & the ClockworkMod Recovery. Continue to the next section.

Rooting the Desire Z

Note:

If you have the T-mobile G2, skip this section.

Before you begin, if VISIONary is installed on the HTC Desire Z, uninstall it before continuing.

  1. You will need ADB on the computer to root the HTC Desire Z and to flash the necessary files for radio S-OFF. Follow the Android SDK guide, to get the ADB shell on the computer.
  2. Download busybox, the ClockworkMod Recovery, the Engineering HBoot, gfree 1.0, psneuter, root_psn, Superuser package:
    • busybox: Download
      md5: 25c5db694c987995909cc3166d4f01b0
    • ClockworkMod Recovery: Download
      md5: cbc776e7941ebf030e9fa39473d5b6f1
    • Engineering HBoot: Download
      md5: d8f61830f104ff5d48b855bbe0d95f56
    • gfree 1.0: Download
      md5: 0bc9fc22bda897c765b02066f8a3c83b
    • psneuter: Download
      md5: 89c2dec8d72d87b4c669f44dd31c8d17
    • root_psn: Download
      md5: c8fe38ef55eb8951def9ff17b2eb99c1
    • Superuser package: Download
      md5: 43d9a40b63e916635d5ad7ca32433fab
  3. Unzip the zip files and copy the contents to the same folder as adb (the /platform-tools folder within the Android SDK folder).
  4. Connect the HTC Desire Z to the computer via USB.
  5. Make sure USB debugging is enabled on the HTC Desire Z by checking Settings » Applications » Development » USB debugging.
  6. On the computer, open terminal and run the following commands:
    adb push busybox /data/local/tmp/
    adb push gfree /data/local/tmp/
    adb push hboot-eng.img /data/local/tmp/
    adb push psneuter /data/local/tmp/
    adb push recovery-clockwork-3.0.2.4-vision.img /data/local/tmp/recovery.img
    adb push root_psn /data/local/tmp/
    adb push su /sdcard/
    adb push Superuser.apk /sdcard/
    adb shell
    chmod 755 /data/local/tmp/*
    /data/local/tmp/psneuter

    NOTE: You will drop out of the shell after this command. Restart the shell using:
    adb shell
    cd /data/local/tmp
    ./gfree -f -b hboot-eng.img -y recovery.img
  7. As it is very important that the hboot was installed correctly gfree calculates md5sums of the partition. It will calculate the following 3 checksums
    • md5sum #1 – checksum of partition 18 before the installation
    • md5sum #2 – checksum of the hboot image that should be installed
    • md5sum #3 – checksum of partition 18 after the installation
  8. The messages that you what to see are either/or
    • md5sum #1 == md5sum #2 – the hboot image is already installed -> skipping installation
    • md5sum #3 == md5sum #2 – the hboot image was successfully installed -> OK!
  9. If you get a different error message then DO NOT REBOOT and join #G2Root on Freenode for further help.
  10. If gfree worked correctly continue with:
    ./root_psn
    sync
    reboot
  11. The HTC Desire Z is now rooted with S-OFF, the Engineering HBoot & the ClockworkMod Recovery. Continue to the next section.

Installing CyanogenMod from recovery

  1. Make sure your computer has working adb.
  2. Download the CyanogenMod build package for your device that you’d like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  3. Boot to recovery mode, and connect the phone to your computer through USB.
    • Vol Down & Power
  4. In ClockworkMod Recovery, use the physical volume buttons to move up and down. On most devices, the power button is used to confirm a menu selection, but for some devices a physical home key acts as a selector. Some devices have touch enabled ClockworkMod Recovery, in which case you may be able to swipe to, or touch, menu selections.
  5. Optional (Recommended): Select backup and restore to create a backup.
  6. Select wipe data/factory reset.
  7. You have two options for transferring and installing the installation packages. The sideload method is more universal across devices, whereas the push and install method is more commonly used:
    • Sideload method: select install zip > install zip from sideload. Follow the on-screen notices to install the package. The installer does not necessarily display an “Install complete.” message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Push and install method: Open a command prompt (or Terminal on Mac and Linux) and navigate to the directory holding the package(s) you would like to install. On the device, navigate to the mounts and storage menu. If you see /storage/sdcard0 or /sdcard as a mountable volume, go ahead and mount it. If you do not see one of these partitions, then instead mount the /data partition. Take note of which volume you mounted. Now, push the package(s) to your device (also, see tip below):
    – If you mounted /storage/sdcard0, then: adb push update.zip /storage/sdcard0/
    – If you mounted /sdcard or /data, then: adb push update.zip /sdcard/
    where update.zip should be replaced with the package filename. Go back to the main menu and select install zip. Choose to install from the same directory where you pushed the package(s). If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  8. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Helpful Tip – SD card folders

CyanogenMod 10.1 and newer have multi-user support (introduced in Android 4.2). If your device has storage on the /data partition, then Android actually looks in /data/media/0/ for the first user’s /sdcard/ storage. ClockworkMod recovery symlinks /sdcard/ to /data/media/ though. So, if you are pushing files to internal storage in recovery and want them to be visible in Android, you should push them to /sdcard/0/ or /data/media/0/. Here’s the most frequent scenarios:

  1. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10 or older: adb push update.zip /sdcard/
  2. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10.1 or newer: adb shell "mkdir /sdcard/0/" followed by adb push update.zip /sdcard/0/
  3. If you’re coming from a ROM with Android 4.2 or newer to CyanogenMod 10.1 or newer: adb push update.zip /sdcard/0/

Helpful Tip

See something wrong on this page? Click here: Report a Site Problem.

How To Build CyanogenMod For HTC G2 / Desire Z (vision)

Introduction

These instructions will hopefully assist you to start with a stock G2 / Desire Z, unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A G2 / Desire Z
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the G2 / Desire Z (typically micro USB, but older devices may use mini USB or have a proprietary cable)
  • A decent internet connection & reliable electricity :)
  • Some familiarity with basic Android operation and terminology. It would help if you’ve installed custom roms on other devices and are familiar with recovery. It may also be useful to know some basic command line concepts such as cd for “change directory”, the concept of directory hierarchies, that in Linux they are separated by /, etc.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.

Note:

You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment

Note:

You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see http://source.android.com/source/initializing.html which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b gingerbread

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt Rom Manager

$ cd ~/android/system/vendor/cyanogen

then enter:

$ ./get-rommanager

You won’t see any confirmation- just another prompt. But this should cause the Rom Manager apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

After the source downloads, ensure you are in the root of the source code (cd ~/android/system), then type:
$ source build/envsetup.sh
$ lunch

You should see a list of devices, including something like cm_vision-userdebug. Select it by typing its number. It is possible that lunch does not display your device. In that case try

$ lunch cm_vision-userdebug

or

$ lunch full_vision-userdebug

If all goes well, you should see that vision-specific directories are downloaded automatically.

Helpful Tip

If you want to know more about what source build/envsetup.sh does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/envsetup.sh from ~/android/system.

Extract proprietary blobs

Now ensure that your G2 / Desire Z is connected to your computer via the USB cable and that you are in the ~/android/system/device/htc/vision directory (you can cd ~/android/system/device/htc/vision if necessary). Then run the extract-files.sh script:

$ ./extract-files.sh

You should see the proprietary files (aka “blobs”) get pulled from the device and moved to the ~/android/system/vendor/htc directory. If you see errors about adb being unable to pull the files, adb may not be in the path of execution. If this is the case, see the adb page for suggestions for dealing with “command not found” errors.

Note:

Your device should already be running a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly.

Note:

It’s important that these proprietary files are extracted to the ~/android/system/vendor/htc directory by using the extract-files.sh script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilt/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch vision

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make vision should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/vision/cm_vision-ota-eng.root.zip] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/common.py:

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2) cm-7-20161224-UNOFFICIAL-vision.zip, which is the CyanogenMod installation package.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:

cm-7-20161224-UNOFFICIAL-vision.zip

Note:

The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the cm...zip file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.

Categories HTC