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>
Available commands:
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
m
to build the image)$ acloud create --local-image [optional local-image-path]
$ acloud create --local-instance
m
to 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:
--config
: This can be one of phone, auto, tablet, tv. This wil be used to configure different types of hardware properties and infer build target if not specified.
--autoconnect
: Cuttlefish AVD defaults to webrtc and acloud will automatically open the browser upon creation of a remote or local instance. Acloud will also create a ssh tunnel to enable adb and webrtc connection to the instance. Other AVD types(such as goldfish, cheeps...) still default to vnc.
--autoconnect vnc
.--no-autoconnect
.--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: cpu:2,resolution:1280x700,dpi:160,memory:2g,disk:2g
--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 --help
$ acloud create --help
List will retrieve all the remote instances you've created in addition to any local instances created as well.
Cheatsheet:
$ 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.
Cheatsheet:
$ acloud delete
$ acloud delete --all
$ acloud delete --instance-names [instance-name]
Reconnect will re-establish ssh tunnels for adb/webrtc/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 webrtc/vnc for all devices that don't already have webrtc/vnc started for them.
Cheatsheet:
$ 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.
Cheatsheet:
$ 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.
Cheatsheet:
$ acloud setup
$ acloud setup --gcp-init
$ acloud setup --host
$ acloud setup --force
If you have any questions or feedback, contact acloud@google.com.
If you have any bugs or feature requests email them to buganizer-system+419709@google.com