Android Source Code编译后运行emulator, 以下内容来自于Android帮助
--------------------------------------------------------------------------------------------
run emulator, it will pompt:
If you are an Android SDK user, please use '@<name>' or '-avd <name>'
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-disk-images
The emulator needs several key image files to run appropriately.
Their exact location depends on whether you're using the emulator
from the Android SDK, or not (more details below).
The minimal required image files are the following:
kernel-qemu the emulator-specific Linux kernel image
ramdisk.img the ramdisk image used to boot the system
system.img the *initial* system image
userdata.img the *initial* data partition image
It will also use the following writable image files:
userdata-qemu.img the persistent data partition image
system-qemu.img an *optional* persistent system image
cache.img an *optional* cache partition image
sdcard.img an *optional* SD Card partition image
snapshots.img an *optional* state snapshots image
If you use a virtual device, its content directory should store
all writable images, and read-only ones will be found from the
corresponding platform/add-on directories. See -help-sdk-images
for more details.
If you are building from the Android build system, you should
have ANDROID_PRODUCT_OUT defined in your environment, and the
emulator shall be able to pick-up the right image files automatically.
See -help-build-images for more details.
If you're neither using the SDK or the Android build system, you
can still run the emulator by explicitely providing the paths to
*all* required disk images through a combination of the following
options: -sysdir, -datadir, -kernel, -ramdisk, -system, -data, -cache
-sdcard and -snapstorage.
The actual logic being that the emulator should be able to find all
images from the options you give it.
For more detail, see the corresponding -help-<option> entry.
Other related options are:
-init-data Specify an alternative *initial* user data image
-wipe-data Copy the content of the *initial* user data image
(userdata.img) into the writable one (userdata-qemu.img)
-no-cache do not use a cache partition, even if one is
available.
-no-snapstorage do not use a state snapshot image, even if one is
available.
./emulator -help-build-images
The emulator detects that you are working from the Android build system
by looking at the ANDROID_PRODUCT_OUT variable in your environment.
If it is defined, it should point to the product-specific directory that
contains the generated system images.
In this case, the emulator will look by default for the following image
files there:
- system.img : the *initial* system image.
- ramdisk.img : the ramdisk image used to boot the system.
- userdata.img : the *initial* user data image (see below).
- kernel-qemu : the emulator-specific Linux kernel image.
If the kernel image is not found in the out directory, then it is searched
in <build-root>/prebuilts/qemu-kernel/.
Skins will be looked in <build-root>/development/tools/emulator/skins/
You can use the -sysdir, -system, -kernel, -ramdisk, -datadir, -data options
to specify different search directories or specific image files. You can
also use the -cache and -sdcard options to indicate specific cache partition
and SD Card image files.
For more details, see the corresponding -help-<option> section.
Note that the following behaviour is specific to 'build mode':
- the *initial* system image is copied to a temporary file which is
automatically removed when the emulator exits. There is thus no way to
make persistent changes to this image through the emulator, even if
you use the '-image <file>' option.
- unless you use the '-cache <file>' option, the cache partition image
is backed by a temporary file that is initially empty and destroyed on
program exit.
SPECIAL NOTE: If you are using the emulator with the Android SDK, the
information above doesn't apply. See -help-sdk-images for more details.