本文介绍了Android的建设,从源头 - 仿真器和AVDS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了Android源模拟器。我读href="http://source.android.com/source/building.html"> Android源文档的路径为模拟器是在构建成功autmatically添加的

I have built the Android source for the emulator. I read in the Android Source documentation that the path to 'emulator' is added autmatically during a successful build. However I have two questions about this:

  1. 如果我打开一个新的外壳或关闭我现有的外壳,模拟器不再发现。当然,我没有建立我想运行模拟器每次?

  1. If I open a new shell or close my existing shell, 'emulator' is no longer found. Surely I don't have to build each time I want to run the emulator?

如果模拟器需要AVD如何创建和管理这些给没有Android SDK中我的机器上?

If the emulator requires an AVD how do I create and manage these given there is no Android SDK on my machine?

谢谢,杰克

解决方案,第2部分。

我需要创建一个名为ANDROID_PRODUCT_OUT的环境变量。从下面的命令:

I needed to create an environment variable called ANDROID_PRODUCT_OUT. From the the following command:

emulator -help-build-images

我看了...

I read...

模拟器检测到您从Android构建工作  系统通过查看该ANDROID_PRODUCT_OUT变量您  环境。

如果它被定义,它应该指向特定产品的目录  包含所生成的图像系统。

If it is defined, it should point to the product-specific directory that contains the generated system images.

然后我做了搜索我的'出'目录'system.ing。因为我建立仿真器的形象是:

I then did a search for 'system.ing' in my 'out' directory. since I am building for the emulator the image was in:

out/target/product/generic

我添加下面一行到我的.bashrc文件:

I added the following line to my .bashrc file:

export ANDROID_PRODUCT_OUT=/home/jack.wootton/code/out/target/product/generic

当时我能够从运行模拟器:

I was then able to run the emulator from:

/home/jack.wootton/code/out/host/linux-x86/bin

解决方案,第1部分。

我不知道Android的虚拟设备,所以这个问题仍然有效 - 但我并不需要提供一个做一个成功的构建和设置ANDROID_PRODUCT_OUT环境变量后运行模拟器

I don't know about Android Virtual Devices, so this question still stands - however I did not need to provide one to run the emulator after doing a successful build and setting the ANDROID_PRODUCT_OUT environment variable.

更新,以解决方案

显然变量,如ANDROID_PRODUCT_OUT应自动构建过程中,并使用envSetup.sh脚本创建。我想事情已经错了我的环境设置此不发生。

Apparently variables such as ANDROID_PRODUCT_OUT should be automatically created during a build and using the envSetup.sh script. I guess something has gone wrong with my environment setup for this not to happen.

推荐答案

您共享的:

显然变量,如ANDROID_PRODUCT_OUT应自动构建过程中,并使用envSetup.sh脚本创建。我想事情已经错了我的环境设置此不发生。

我也试图得到这个工作,得知:

I ALSO ATTEMPTED to get this to work and LEARNED that:

  1. 午餐全ENG 设置所有适当的ENV
  2. 要检查它,只需运行:
    ENV | ANDROID的grep
    你会看到所有相应的ENV变量的设置。
    这些地方只对当前shell!
  3. 模拟器然后做什么,它应该。
  1. lunch full-eng sets up all the appropriate env
  2. to check it, simply run:
    env | grep ANDROID
    and you will see all the appropriate env variables setup.
    These are local to the current shell only!
  3. emulator then does what it should.

当我回到了壳以后,我只是跑了午饭全ENG一次恢复我的环境。
我希望这可以帮助其他人也!

When I came back to the shell later, I simply ran lunch full-eng again to restore my environment.
I hope this helps others as well!

这篇关于Android的建设,从源头 - 仿真器和AVDS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 07:05