3

我正在尝试在我的 64 位 Ubuntu 12.04 发行版上启动并运行 Android 模拟器。首先,我必须安装 ia32-libs 来解决我在之前(失败的)尝试中遇到的一些早期问题。

然后我下载并安装了 64 位 linux 发行版。我在命令行上导航到android应用程序(SDK 管理器)并运行它。我下载了 Android 工具和最新版本的 Android 操作系统。

我现在想运行emulator,但是当我这样做时,我收到以下错误:

myUser@myMachine:~/android-sdk/21.1/android-sdk-linux/tools$ ./emulator

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 '@<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我得到的输出包括以下内容:

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'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.

这非常令人困惑。我在 YouTube 上看到过使用模拟器的人的例子,只不过./emulator -datadir=/some/path.

所以我问:

  • 通过 SDK、“ Android 构建系统”(???) 和通过终端运行模拟器有什么区别,就像我在这里尝试的那样?
  • 为什么在某些情况下可以通过 运行模拟器./emulator -datadir=/some/path,但是第二个窗口中的输出似乎需要 4 - 8 个命令行参数?
  • 在什么时候启动 AVD 管理器并设置我的机器?

提前致谢!

4

1 回答 1

4

您必须在启动模拟器之前创建 AVD 配置:

android create avd -n <name> -t <targetID> [-<option> <value>] ... 

http://developer.android.com/tools/devices/managing-avds-cmdline.html#AVDCmdLine

那么你就可以启动它了

emulator -avd <avd_name> [<options>]

http://developer.android.com/tools/devices/emulator.html#starting

于 2013-04-13T21:40:41.100 回答