From 2b2f778802f7d01fa3082a324e321d6f7e8ae122 Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Wed, 20 Apr 2022 08:36:22 +0800 Subject: [PATCH] added new method to avoid lunch when run emualtor Signed-off-by: Chen Wang --- docs/howto-build-emu-riscv.md | 21 ++++++++++++++++++--- docs/zh/howto-build-emu-riscv.md | 10 +++++++++- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/docs/howto-build-emu-riscv.md b/docs/howto-build-emu-riscv.md index e0ae5e2..c1bf82f 100644 --- a/docs/howto-build-emu-riscv.md +++ b/docs/howto-build-emu-riscv.md @@ -51,7 +51,9 @@ export PATH=$PATH:$HOME/bin Do not forget to add this to your `.bashrc` file. -After the installation is complete, you can run `repo version` to check the effect. An output similar to the following shows that the installation is successful. The repo version needs to be 2.15 or higher. +After the installation is complete, you can run `repo version` to check the effect. +An output similar to the following shows that the installation is successful. +The repo version needs to be 2.15 or higher. ``` $ repo version @@ -68,7 +70,8 @@ Bug reports: https://bugs.chromium.org/p/gerrit/issues/entry?template=Repo+tool+ # 4. Download source code -Create an emulator source code build directory, here assume it is `/home/u/emu-dev`, and then enter the directory. +Create an emulator source code build directory, here assume it is `/home/u/emu-dev`, +and then enter the directory. ``` $ mkdir -p /home/u/emu-dev && cd /home/u/emu-dev @@ -158,4 +161,16 @@ $ lunch sdk_phone_arm64-eng $ cd /home/u/emu-dev/external/qemu $ export ANDROID_BUILD_TOP=$AOSP $ objs/emulator -no-window -show-kernel -no-audio -qemu -machine virt -``` \ No newline at end of file +``` + +**Supplement**: If you want to avoid switching between AOSP and Emulator projects +and don't want to execute `lunch`, we can also define environment variable +`ANDROID_PRODUCT_OUT` to specify `target-specific out directory where disk +images will be looked for`. For specific operations, take the above example as +an example, you can replace the above command input with the following command: +```` +$ cd /home/u/emu-dev/external/qemu +$ export ANDROID_BUILD_TOP=$AOSP +$ export ANDROID_PRODUCT_OUT=$AOSP/out/target/product/emulator_arm64 +$ objs/emulator -no-window -show-kernel -no-audio -qemu -machine virt +```` \ No newline at end of file diff --git a/docs/zh/howto-build-emu-riscv.md b/docs/zh/howto-build-emu-riscv.md index b8b7ec6..de072a3 100644 --- a/docs/zh/howto-build-emu-riscv.md +++ b/docs/zh/howto-build-emu-riscv.md @@ -152,4 +152,12 @@ $ lunch sdk_phone_arm64-eng $ cd /home/u/emu-dev/external/qemu $ export ANDROID_BUILD_TOP=$AOSP $ objs/emulator -no-window -show-kernel -no-audio -qemu -machine virt -``` \ No newline at end of file +``` + +**补充**:如果嫌麻烦想避免在 AOSP 和 Emulator 两个项目之间切换以及不想执行避免 lunch,我们也可以自己定义 `ANDROID_PRODUCT_OUT`,这个环境变量用于指定 `target-specific out directory where disk images will be looked for`。具体操作,以上面的例子为例,可以用以下命令替换上面的命令输入: +``` +$ cd /home/u/emu-dev/external/qemu +$ export ANDROID_BUILD_TOP=$AOSP +$ export ANDROID_PRODUCT_OUT=$AOSP/out/target/product/emulator_arm64 +$ objs/emulator -no-window -show-kernel -no-audio -qemu -machine virt +``` -- Gitee