編譯androidx86
㈠ 如何編譯android x86模擬器
首先你需要設置一下emulator工具的目錄之類的,這個不細說了,
要在.bashrc中新增環境變數,如下
ANDROID_PRODUCT_OUT=~/android/out/target/proct/generic
ANDROID_PRODUCT_OUT_BIN=~/android/out/host/linux-x86/bin
這里是設置你的輸出文件的位置和bin工具目錄,不用多解釋吧?
然後在命令行輸入:
export PATH=${PATH}:${ANDROID_PRODUCT_OUT_BIN}:${ANDROID_PRODUCT_OUT};
上面是導入了相關的配置,然後使之生效。
source ~/.bashrc
接著切換到輸出的system文件夾
cd ~/android/out/target/proct/generic
然後來創建模擬器
emulator -system system.img -data userdata.img -ramdisk ramdisk.img
如果你運氣夠好的話,也許現在已經在運行了,不過我運氣明顯不夠好。
提示一:
emulator: ERROR: You did not specify a virtual device name, and the system
directory could not be found.
If you are an Android SDK user, please use 『@』 or 『-avd 』
to start a given virtual device (see -help-avd for details).
Otherwise, follow the instructions in -help-disk-images to start the emulator
既然人家提示了,那就按照步驟走吧,輸入命令:
emulator -help-avd
接著提示如下:
use 『-avd 』 to start the emulator program with a given Android
Virtual Device (a.k.a. AVD), where must correspond to the name
of one of the existing AVDs available on your host machine.
See -help-virtual-device to learn how to create/list/manage AVDs.
As a special convenience, using 『@』 is equivalent to using
『-avd 』.
跟著提示繼續走,輸入命令:
emulator -help-virtual-device
又是提示了:
An Android Virtual Device (AVD) models a single virtual
device running the Android platform that has, at least, its own
kernel, system image and data partition.
Only one emulator process can run a given AVD at a time, but
you can create several AVDs and run them concurrently.
You can invoke a given AVD at startup using either 『-avd 』
or 『@』, both forms being equivalent. For example, to launch
the AVD named 『foo』, type:
emulator @foo
The 『android』 helper tool can be used to manage virtual devices.
For example:
android create avd -n -t 1 # creates a new virtual device.
android list avd # list all virtual devices available.
Try 『android –help』 for more commands.
Each AVD really corresponds to a content directory which stores
persistent and writable disk images as well as configuration files.
Each AVD must be created against an existing SDK platform or add-on.
For more information on this topic, see -help-sdk-images.