从源代码构建后的And​​r​​oid模拟器运行 [英] Running emulator after building Android from source

查看:114
本文介绍了从源代码构建后的And​​r​​oid模拟器运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够拉下了最新的Andr​​oid源$ C ​​$ C到Ubuntu的虚拟机中的32位(主持人:Windows 7的64位)。构建完成,没有任何错误。

I am able to pull down the latest android source code into a Ubuntu virtual machine 32-bit (Host: Windows 7 64-bit). The build completes without any errors.

然后我试图按照这些说明,它提到,我应该在的根目录运行模拟器我的源$ C ​​$ C。然而,当我尝试了,我得到一个错误,指出未找到此命令。

Then I tried to follow these instructions, where it mentions that I should run the emulator on the root of my source code. However, when I tried that, I get an error stating that this command is not found.

于是我去到该文件夹​​输出/主机/ Linux的-86 /斌,我发现有对模拟器情侣档*

So I went to the folder out/host/linux-x86/bin and I found out that there are couple files for emulator*:

  • 模拟器
  • 仿真臂
  • emulator_renderer
  • 模拟器-UI
  • 模拟器-86
  • emulator
  • emulator-arm
  • emulator_renderer
  • emulator-ui
  • emulator-x86

当我键入模拟器模拟器-86 在这里,它也不起作用。这是我收到的错误:

When I typed the emulator and emulator-x86 here, it also doesn't work. Here is the error I'm getting:

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

所以,当我运行 ./模拟器86 -help-磁盘映像,我看到以下内容:

So when I run ./emulator-x86 -help-disk-images, I see the following:

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脚本来获得该组。

I built this myself, so I would think that ANDROID_PRODUCT_OUT is set in my environment variables, but I don't see it. So I think that I should run some other shell script to get that set.

我看着 IMG 文件,我看到的情侣在位置输出/目标/产品/通用

I looked at the img files, I saw couple at the location out/target/product/generic:

  • 的ramdisk.img
  • system.img
  • userdata.img
  • ramdisk.img
  • system.img
  • userdata.img

任何人都可以提供一些线索就这个问题和帮助我什么,我应该怎么做?我是新来的Andr​​oid和我做了这方面的一些研究,但我找不到任何类似的问题。

Could anyone shed some light on this and assist me on what I should do next? I am new to Android and I did some research on this but I couldn't find any similar issues.

推荐答案

我不知道哪个产品你完成你的构建,但运行模拟器,你可以使用下面的命令:

I do not know for which product you do your build but to run emulator you can use the following command:

输出/主机/ Linux的-86 /斌/仿真器-sysdir输出/目标/产品/通用/ -system输出/目标/产品/通用/ system.img -ramdisk输出/目标/产品/通用/的ramdisk.img - 数据输出/目标/产品/通用/ userdata.img -kernel prebuilt /机器人臂/内核/内核QEMU -sdcard sdcard.img -skindir SDK /仿真器/皮-skin WVGA800 -scale 0.7 -memory 512 -partition尺寸1024

out/host/linux-x86/bin/emulator -sysdir out/target/product/generic/ -system out/target/product/generic/system.img -ramdisk out/target/product/generic/ramdisk.img -data out/target/product/generic/userdata.img -kernel prebuilt/android-arm/kernel/kernel-qemu -sdcard sdcard.img -skindir sdk/emulator/skins -skin WVGA800 -scale 0.7 -memory 512 -partition-size 1024

只要将其复制到sh文件到你的Andr​​oid源文件夹的根目录并运行此文件。或者你可以运行它,但你应该CHDIR到Android源文件夹的根在第一。

Just copy it into .sh file into the root of your Android source folder and run this file. Or you can just run it but you should chdir to your Android source folder root at first.

和不要忘了与命令的根文件夹中创建一个SD卡图像 mksdcard

And do not forget to create an sdcard image in the root folder with command mksdcard.

这篇关于从源代码构建后的And​​r​​oid模拟器运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆