我可以将最新的Android源代码下载到Ubuntu虚拟机32位中(主机为Windows 7 64位),并且编译没有任何错误。
然后我尝试按照这些说明操作,里面提到我应该在我的源代码根目录下运行模拟器。但是,当我尝试这样做时,我收到一个错误消息,指出这个命令未找到。
因此,我进入文件夹out/host/linux-x86/bin
,发现有几个与模拟器相关的文件:
emulator
emulator-arm
emulator_renderer
emulator-ui
emulator-x86
当我在这里输入emulator
和emulator-x86
时,它也无法正常工作。下面是我得到的错误:
xxxx/out/host/linux-x86/bin$ ./emulator-x86
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-x86 -help-disk-images
时,我看到以下内容: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.
我自己构建了这个,所以我认为我的环境变量中已经设置了
ANDROID_PRODUCT_OUT
,但是我没有看到它。所以我认为我应该运行一些其他的 shell 脚本来设置它。我查看了
img
文件,在位置 out/target/product/generic
看到了几个文件。
ramdisk.img
system.img
userdata.img
有人能为我解惑并协助我下一步该做什么吗?我是 Android 方面的新手,我对此进行了一些研究,但我没有找到任何类似的问题。