Build the CyanogenMod compiling environment under Ubuntu10.0.4 and compile and package the Flash files (ForHTCDream)

Source: Internet
Author: User
This article only describes how to build the compiling environment in Ubuntu and how to compile ROM. Some general Ubuntu operation skills may be required during the process, new users of Ubuntu can learn through Google. I am also a newbie. It is not difficult to google it just a short time ago. In addition, the source code and the files generated after compilation are both large, if you want to get up and running, it is better to have 30 GB of Ubuntu partitions. If you want to use 20 GB of partitions, you will be able to use them in a short time. I also allocated 20 GB of partitions before, but the space will be insufficient in a short time, therefore, the partition is finally split and duplicated.

This article only describes how to build the compiling environment in Ubuntu and how to compile ROM. Some general Ubuntu operation skills may be required during the process, new users of Ubuntu can learn through Google. I am also a newbie. It is not difficult to google it just a short time ago. In addition, the source code and the files generated after compilation are both large, if you want to get up and running, it is better to have 30 GB of Ubuntu partitions. If you want to use 20 GB of partitions, you will be able to use them in a short time. I also allocated 20 GB of partitions before, but the space will be insufficient in a short time, so we finally split the partition and allocated GB to Ubuntu again.

Build the compiling environment

JDK Installation
A) JDK is a required software package for Ubuntu to use the Android SDK and compile the source code.

B) download the latest JDK version from sun's official website. bin file, the author downloaded is the jdk-6u20-linux-i586.bin (according to different files, the command will also be changed, we should pay attention to when using, mainly the file name and path changes ).

C) Because JDK will be installed in the current directory during runtime, before installation, move it to the directory you want to install, for example, I installed it in the/usr/lib/jvm/java directory. If you want to install it in the same directory, follow the commands below to do it.

Code:

Sudo-I

Cd/usr/lib

Mkdir jvm

Cd jvm

Mkdir java

Cd java

Cp "jdk-6u20-linux-i586.bin Directory"/jdk-6u20-linux-i586.bin/usr/lib/jvm/java

Chmod u + x jdk-6u20-linux-i586.bin

Jdk-6u20-linux-i586.bin
 

In this case, the JDK installation prompt is displayed. Press enter to keep the prompt, and the prompt will continue to scroll. www.linuxidc.com will start installation after you enter Yes/NO on the screen, after the installation is complete, the system prompts you to press enter to continue. After you press enter, the installation is successful.

D) Unlike Windows, Ubuntu does not have a registry. After the installation is complete, we need to inform the System of the JDK installation directory, therefore, execute the following command in the terminal just now (if it is a new terminal that has not executed "sudo-I", you need to get the permission before the command + "sudo)

Code:

Gedit/etc/environment

A text editor is displayed.

Code:

PATH = "......"

The ellipsis is the default path. Here, we do not need to change it. We need to modify it, write the JDK installation path, and tell the system where our JDK is installed, make the following changes:

I. Original PATH = "......" Add:

Code:

PATH = "...... :/Usr/lib/jvm/java/jdk1.6.0 _ 20/bin"

Ii. Add two rows and enter the following content:

Code:

CLASSPATH =.:/usr/lib/jvm/java/jdk1.6.0 _ 20/lib

JAVA_HOME =/usr/lib/jvm/java/jdk1.6.0 _ 20
 

The final form is as follows:

Code:

PATH = "...... :/Usr/lib/jvm/java/jdk1.6.0 _ 20/bin"

CLASSPATH =.:/usr/lib/jvm/java/jdk1.6.0 _ 20/lib

JAVA_HOME =/usr/lib/jvm/java/jdk1.6.0 _ 20
 

The ellipsis is the original content of the file. We Add a new part of content and two new lines. Save the modification and exit.

E) Ubuntu may come with JDK or Install Multiple JDK. In this case, we need to set this to the default one.

I. First, add the JDK installation directory to the JDK selection menu and execute the following code:

Code:

Update-alternatives-install/usr/bin/java/usr/lib/jvm/java/jdk1.6.0 _ 12/bin/java 300

Update-alternatives-install/usr/bin/javac/usr/lib/jvm/java/jdk1.6.0 _ 12/bin/javac 300
 

Ii. Second, use the command to select the default JDK and execute the following code:

Code:

Update-alternatives-config java

Iii. Finally, check the current JDK version of the system and enter the following code to view it:

Code:

Java-version

F) So far, JDK is installed successfully.

Android SDK Installation
A) Since rom is used, debugging and testing tools are required. The official Android SDK also provides an official version. You can download and install it directly.

B) go to Google's official website to download the latest SDK version. Just a few days ago, we launched r6 that supports 2.2. However, after the official website of the SDK is on the wall, we can only download the SDK from the wall, this is helpless. Windows, Mac OS X, and Linux are officially available. We need to download the Linux version.

C) You can directly decompress the SDK without installing it. It is recommended to put it in the main directory for convenient calling.

D) to facilitate the use of the adb command, we also need to add the directory where the adb command is located to the system environment variable so that adb can be directly called under any directory, you do not need to add cd to the SDK directory. This is more convenient. The implementation method is as follows:

Code:

Sudo gedit ~ /. Bashrc

Open the. bashrc file in a text editor and add the following line at the end:

Code:

Export PATH =$ {PATH }: <你sdk的目录> /Tools

Here, you need to add the installation directory of your sdk and save it.

E) connect the mobile phone to usb and enter:

Code:

Adb devices

All android devices connected to the computer are listed. If a serial number of numbers and letters is displayed, the SDK is successfully installed.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.