In the past, the source code compilation for cm was based on a fixed model. Sometimes you need to use a simulator. Here we will record how to compile the android simulator using cm source code, however, you 'd better evaluate your machine configuration before doing this. The recommended configuration here is that the CPU and hard disk above I5 should be solid state disks, otherwise the startup and loading speed of the simulator will be almost intolerable.
After the android source code is compiled, the generated directories are all in the out folder under the source code directory.
Out/Target indicates that the target machine is generated by various programs on the mobile phone, such as Rom.
Out/host indicates that various tools on the host machine are generated, such as ADB aapt dexdump and some library files.
Here we mainly care about the files generated under the out/target. Different configurations in the CM source code have corresponding directories for different models of the target, such as maguro and Crespo mentioned above, the directory corresponding to the simulator is generic.
The most basic files to be started for the android simulator are as follows:
1. The Kernel File of the kernel file, including Bootloader and boot animation. For the goldfish Kernel used by the android simulator, download the goldfish Linux Kernel Based on CM 11.0 from githup.
2 system. IMG mount the image of the system directory
3 ramdisk. IMG Mount disk image
4. userdata. IMG mount the image of user data
With the previous introduction, we started to compile the Simulator Based on the CM 11.0 source code.
I. Prerequisites
1. Download a complete set of CM 11.0 Source Code. For the process, see the previous blog.
2. Download the related goldfish kernel code
The download address here is
Https://github.com/CyanogenMod/android_kernel_goldfish/tree/cm-11.0
After the download is complete, decompress the code in kernel/goldfish.
Second compilation
Go to the source code directory
1. Build/envsetup. Sh
2 lunch
Find cm_goldfish-eng
Which wocould you like? Aosp_arm-eng
Fill in the number before the cm_goldfish-eng to complete the configuration
3 make-J4
After a long compilation, various imgfiles are generated in the out/target/product/Generic Directory, such
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/45/79/wKiom1PoX7iwR_22AAJUwU4YSgs464.jpg "Title =" tu3.png "alt =" wkiom1pox7iwr_22aajuwu4ysgs464.jpg "/>
3. Run the simulator.
Emulator-kernel/diskcm11/CM-11/out/target/product/generic/kernel-data/diskcm11/CM-11/out/target/product/generic/userdata. IMG-system/diskcm11/CM-11/out/target/product/generic/system. IMG-ramdisk/diskcm11/CM-11/out/target/product/generic/ramdisk. IMG
This command can run the simulator, but if the hard disk and computer are not powerful, the speed of the simulator is not flattering.