diff --git a/docs/cvdr.md b/docs/cvdr.md index 06613b33..a1b74460 100644 --- a/docs/cvdr.md +++ b/docs/cvdr.md @@ -9,10 +9,8 @@ remotely. It wraps [Cloud Orchestrator](cloud_orchestrator.md), to provide user-friendly interface. -Please run `cvdr --help` for advanced functionalities of `cvdr` not described -below, such as launching Cuttlefish with locally built image. - -## Download cvdr +## Install cvdr +### Debian prebuilt packages `cuttlefish-cvdremote` is available to download via `apt install` with adding the apt repository at Artifact Registry. @@ -29,21 +27,36 @@ sudo apt install cuttlefish-cvdremote cvdr --help ``` +### Manual build + +To build `cvdr` manually, please run: +```bash +git clone https://github.com/google/cloud-android-orchestration.git +cd cloud-android-orchestration # Root directory of git repository +go build ./cmd/cvdr +``` + ## Configure cvdr -Please check and modify the configuration file(`~/.config/cvdr/cvdr.toml`). +Please check and modify the configuration file (defaults to `~/.config/cvdr/cvdr.toml`). See either [build/debian/cuttlefish_cvdremote/host/etc/cvdr.toml](/build/debian/cuttlefish_cvdremote/host/etc/cvdr.toml) or [scripts/on-premises/single-server/cvdr.toml](/scripts/on-premises/single-server/cvdr.toml) as examples of how to write a configuration file. -## Use cvdr -Let's assume using the latest Cuttlefish x86_64 image enrolled in -[ci.android.com](https://ci.android.com/). +## Run CVD + + +```bash +CVDR_USER_CONFIG_PATH=/path/to/cvdr.toml ./cvdr --help +``` + +## Create CVD examples + +### Latest Cuttlefish x86_64 image enrolled in [ci.android.com](https://ci.android.com/) -Please run: ```bash cvdr \ --branch=aosp-main \ @@ -51,7 +64,33 @@ cvdr \ create ``` -Then we expect the result like below. +### Custom AOSP build + +Ensure you have completed an AOSP build as described in the [docs](https://source.android.com/docs/setup/build/building). +To start a Cuttlefish emulator based on this build, the following environment variables should be defined: +``` +export ANDROID_BUILD_TOP=/path/to/your/AOSP/sources/root +export ANDROID_PRODUCT_OUT="${ANDROID_BUILD_TOP}/out/target/product/your_target" +``` +Replace the latter with the your `OUT_DIR` if you override it. + +
+ +To automatically fetch the [required images](https://cs.android.com/android/platform/superproject/+/master:device/google/cuttlefish/required_images) from your AOSP root and create an instance, please run: + +```bash +CVDR_USER_CONFIG_PATH=/path/to/cvdr.toml ./cvdr create --local_image +``` + +Alternatively, manually specify the images and create an instance: +```bash +CVDR_USER_CONFIG_PATH=/path/to/cvdr.toml ./cvdr --local_cvd_host_pkg_src="${ANDROID_PRODUCT_OUT}/dist/cvd-host_package.tar.gz --local_images_zip_src=${ANDROID_PRODUCT_OUT}/dist/your-target-img.zip" +``` +For this to work, you have to build the .zip images using `m dist` in AOSP root beforehand. + +
+On success, we expect the result like below. + ``` Creating Host........................................ OK Fetching main bundle artifacts....................... OK @@ -69,16 +108,4 @@ and check if the page seems like below. Also, you should be able to see the device is enrolled via `adb devices`. ![cvdr_cf_creation](resources/cvdr_cf_creation_example.png) -## Manually build and run cvdr - -To build `cvdr` manually, please run: -```bash -git clone https://github.com/google/cloud-android-orchestration.git -cd cloud-android-orchestration # Root directory of git repository -go build ./cmd/cvdr -``` - -To run `cvdr`, please run: -```bash -CVDR_USER_CONFIG_PATH=/path/to/cvdr.toml ./cvdr --help -``` +Please run `cvdr --help` for advanced functionalities of `cvdr`, including individual commands and their flags.