Acloud is a command line tool that assists users to create an Android Virtual Device (AVD).
Add acloud to your $PATH by lunching your environment.
$ source build/envsetup.sh
$ lunch aosp_cf_x86_phone-userdebug
You should now be able to call acloud from anywhere.
Acloud commands take the following form:
acloud <command> <optional arguments>
Create is the main entry point in creating an AVD, supporting both remote instance (running on a virtual machine in the cloud) and local instance (running on your local host) use cases. You also have the option to use a locally built image or an image from the Android Build servers.
Here's a quick cheat-sheet for the 4 use cases:
$ acloud create
mto build the image)
$ acloud create --local-image [optional local-image-path]
$ acloud create --local-instance
mto build the image)
$ acloud create --local-instance --local-image
When specifying an Android Build image, you can specify the branch, target and/or build id (e.g.
--branch my_branch). Acloud will assume the following if they're not specified:
--branch: The branch of the repo you're running the acloud command in, e.g. in an aosp repo on the master branch, acloud will infer the aosp-main (aosp-master) branch.
--build-target: Defaults to the phone target for cuttlefish (e.g. aosp_cf_x86_phone-userdebug in aosp-main (aosp-master)).
--build-id: Default to the Last Known Good Build (LKGB) id for the branch and target set from above.
Additional helpful create options are:
--flavor: This can be one of phone, auto, wear, tv, iot, tablet and 3g. This will be used to choose the default hw properties and infer build target if not specified.
--autoconnect: This defaults to true and upon creation of a remote instance, creates a ssh tunnel to enable adb and vnc connection to the instance. For the local instance, acloud will just invoke the vnc client. If you don't want autoconnect, you can pass in
--unlock: This can unlock screen after invoke the vnc client.
--hw-property: This is a string where you can specify the different properties of the AVD. You can specify the cpu, resolution, dpi, memory,and/or disk in a key:value format like so:
--reuse-gce: ‘cuttlefish only’ This can help users use their own instance. Reusing specific gce instance if
--reuse-gce [instance-name] is provided. Select one gce instance to reuse if
--reuse-gce is provided.
The full list of options are available via
$ acloud create --help
List will retrieve all the remote instances you've created in addition to any local instances created as well.
$ acloud list
$ acloud list -v
Delete will stop your remote and local instances. Acloud will find all instances created by you and stop them. If more than one instance is found (remote or local), you will be prompted to select which instance you would like to stop.
$ acloud delete
$ acloud delete --all
$ acloud delete --instance-names [instance-name]
Reconnect will re-establish ssh tunnels for adb/vnc port forwarding for all remote instance created by you. It will then look for any devices missing in
adb devices and reconnect them to adb. Lastly it will restart vnc for all devices that don't already have vnc started for them.
$ acloud reconnect
$ acloud reconnect --all
$ acloud reconnect --instance-names [instance-name]
Pull will provide all log files to download or show in screen. It is helpful to debug about AVD boot up fail or AVD has abnromal behaviors.
$ acloud pull
$ acloud pull --instance-name “instance-name”
$ acloud pull --instance-name “instance-name” --file-name “file-name”
Setup will walk you through the steps needed to set up your local host to create a remote or local instance. It will automatically get invoked through the create command if we detect some necessary setup steps are required. This is a standalone command if the user wants to do setup separate from the create command.
$ acloud setup
$ acloud setup --gcp-init
$ acloud setup --host
$ acloud setup --force
If you have any questions or feedback, contact email@example.com.
If you have any bugs or feature requests, go/acloud-bug.