Android SDK Emulator: Compile CyanogenMod (Linux)

How to compile CyanogenMod for the Android Emulator.

This how-to was written for Ubuntu 10.04 & Ubuntu 10.10Android Emulator r08CyanogenMod 7.x (Gingerbread), on 2 February 2011.

Contents

  [hide]

Prepare the Build Environment

NOTE: You only need to do these steps the first time you build. If you previously prepared your build environment, skip to  Download RomManager.

Install the ADB

Install the  Android SDK.

Install the Build Packages

Install using the package manager of your choice:

For 32-bit & 64-bit systems:

git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool

For 64-bit only systems:

g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib

Note: On Ubuntu 10.10, and variants, you need to enable the parter repository to install sun-java6-jdk:

add-apt-repository "deb http://archive.canonical.com/ maverick partner"

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 Repository

Enter the following to download make executable the "repo" binary:

curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
NOTE: You may need to reboot for these changes to take effect.

Now enter the following to initialize the repository:

cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
repo sync -j16

Download RomManager

NOTE: This only needs to be done when an update to RomManager is released. If you are-up-to date, you may skip to  Building CyanogenMod.

Download ROM Manager which is needed by the build:

cd ~/android/system/vendor/cyanogen/
./get-rommanager

Building CyanogenMod

Check for updates

First, check for updates in the source:

cd ~/android/system/
repo sync

Configure Build

Now, your environment must be configured to build specifically for the Android Emulator. To set up your build environment:

. build/envsetup.sh
lunch cyanogen_generic-eng

Compile

Next, we will build the actual ROM.

mka

Install

  1. Create a folder called android-9-cyanogen on Your/Android-SDK/platforms/
  2. Copy the contents of Your/Android-SDK/platforms/android-9 into Your/Android-SDK/platforms/android-9-cyanogen
  3. Copy the ramdisk.img system.img and userdata.img file from ~/android/system/out/target/product/generic to Your/Android-SDK/platforms/android-9-cyanogen/images/
  4. Run the Android AVD Manager and select the second Android 2.3 target.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值