1# **Acloud Manual**
5Acloud is a command line tool that assists users to create an Android Virtual
8## **Table of Contents**
101. [Environment Setup](#Environment-Setup)
112. [Basic Usage](#Basic-Usage)
13### **Environment Setup**
15Add acloud to your $PATH by lunching your environment.
17* Source envsetup.sh from the root of the android source checkout
20$ source build/envsetup.sh
23* Run lunch for an AVD target
26$ lunch aosp_cf_x86_phone-userdebug
30You should now be able to call acloud from anywhere.
32### **Basic Usage**
34Acloud commands take the following form:
36**acloud <command> <optional arguments>**
49Create is the main entry point in creating an AVD, supporting both remote
50instance (running on a virtual machine in the cloud) and local instance
51(running on your local host) use cases. You also have the option to use
52a locally built image or an image from the Android Build servers.
54**Disclaimer: Creation of a cuttlefish local instance is not formally supported, please use at your own risk.**
56Here's a quick cheat-sheet for the 4 use cases:
58* Remote instance using an Android Build image (LKGB (Last Known Good Build)
59for cuttlefish phone target in the branch of your repo, default aosp master
60if we can't determine it)
62> $ acloud create
64* Remote instance using a locally built image (use `m` to build the image)
66> $ acloud create --local-image [optional local-image-path]
68* Local instance using an Android Build image (LKGB for cuttlefish phone
69target in the branch of your repo)
71> $ acloud create --local-instance
73* Local instance using a locally built image (use `m` to build the image)
75> $ acloud create --local-instance --local-image
77When specifying an Android Build image, you can specify the branch,
78target and/or build id (e.g. `--branch my_branch`). Acloud will assume the
79following if they're not specified:
81* `--branch`: The branch of the repo you're running the acloud command in, e.g.
82in an aosp repo on the master branch, acloud will infer the aosp-master branch.
84* `--build-target`: Defaults to the phone target for cuttlefish (e.g.
85aosp\_cf\_x86\_phone-userdebug in aosp-master).
87* `--build-id`: Default to the Last Known Good Build (LKGB) id for the branch and
88target set from above.
90Additional helpful create options are:
92* `--flavor`: This can be one of phone, auto, wear, tv, iot, tablet and 3g.
93This will be used to choose the default hw properties and infer build target
94if not specified.
96* `--autoconnect`: This defaults to true and upon creation of a remote instance,
97creates a ssh tunnel to enable adb and vnc connection to the instance. For the
98local instance, acloud will just invoke the vnc client. If you don't want
99autoconnect, you can pass in `--no-autoconnect`
101* `--unlock`: This can unlock screen after invoke the vnc client.
103* `--hw-property`: This is a string where you can specify the different
104properties of the AVD. You can specify the cpu, resolution, dpi, memory,and/or
105disk in a key:value format like so:
108* `--reuse-gce`: 'cuttlefish only' This can help users use their own instance.
109Reusing specific gce instance if `--reuse-gce` [instance-name] is provided.
110Select one gce instance to reuse if `--reuse-gce` is provided.
112The full list of options are available via `--help`
114> $ acloud create --help
118List will retrieve all the remote instances you've created in addition to
119any local instances created as well.
123* List will show device IP address, adb port and instance name.
125> $ acloud list
127* List -v will show more detail info on the list.
129> $ acloud list -v
134Delete will stop your remote and local instances. Acloud will find all
135instances created by you and stop them. If more than one instance is found
136(remote or local), you will be prompted to select which instance you would
137like to stop.
141* Delete sole instance or prompt user with list of instances to delete.
143> $ acloud delete
145* Delete all instances
147> $ acloud delete --all
149* Delete a specific instance
151> $ acloud delete --instance-names [instance-name]
155Reconnect will re-establish ssh tunnels for adb/vnc port forwarding for all
156remote instance created by you. It will then look for any devices missing in
157`adb devices` and reconnect them to adb. Lastly it will restart vnc for all
158devices that don't already have vnc started for them.
162* Reconnect sole instance or prompt user with list of instances to reconnect.
164> $ acloud reconnect
166* Reconnect all instances
168> $ acloud reconnect --all
170* Reconnect a specific instance
172> $ acloud reconnect --instance-names [instance-name]
177Pull will provide all log files to download or show in screen. It is helpful
178to debug about AVD boot up fail or AVD has abnromal behaviors.
182* Pull logs from a sole instance or prompt user to choose one to pull if where
183are more than one active instances.
185> $ acloud pull
187* Pull logs from the specific instance.
189> $ acloud pull --instance-name "instance-name"
191* Pull a specific log file from a specific instance
193> $ acloud pull --instance-name "instance-name" --file-name "file-name"
198Setup will walk you through the steps needed to set up your local host to
199create a remote or local instance. It will automatically get invoked through
200the create command if we detect some necessary setup steps are required. This
201is a standalone command if the user wants to do setup separate from the create
206* Run setup for remote/local instances
208> $ acloud setup
210* Run setup for remote instances only
212> $ acloud setup --gcp-init
214* Run setup for local instances only
216> $ acloud setup --host
218* Force run setup
220> $ acloud setup --force
222* * *
224If you have any questions or feedback, contact [firstname.lastname@example.org](mailto:email@example.com).
226If you have any bugs or feature requests, [go/acloud-bug](http://go/acloud-bug).