|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| create/ | | 03-May-2024 | - | 5,022 | 3,716 |
| delete/ | | 03-May-2024 | - | 500 | 361 |
| internal/ | | 03-May-2024 | - | 11,007 | 8,831 |
| list/ | | 03-May-2024 | - | 1,567 | 1,182 |
| metrics/ | | 03-May-2024 | - | 82 | 50 |
| public/ | | 03-May-2024 | - | 5,301 | 4,096 |
| pull/ | | 03-May-2024 | - | 454 | 320 |
| reconnect/ | | 03-May-2024 | - | 434 | 319 |
| setup/ | | 03-May-2024 | - | 1,889 | 1,361 |
| .coveragerc | D | 03-May-2024 | 605 | 27 | 23 |
| .gitignore | D | 03-May-2024 | 99 | 7 | 7 |
| Android.bp | D | 03-May-2024 | 4.1 KiB | 201 | 187 |
| CleanSpec.mk | D | 03-May-2024 | 2 KiB | 48 | 2 |
| LICENSE | D | 03-May-2024 | 11.1 KiB | 204 | 169 |
| OWNERS | D | 03-May-2024 | 39 | 3 | 2 |
| PREUPLOAD.cfg | D | 03-May-2024 | 138 | 6 | 4 |
| README.md | D | 03-May-2024 | 6 KiB | 227 | 134 |
| TEST_MAPPING | D | 03-May-2024 | 88 | 9 | 8 |
| __init__.py | D | 03-May-2024 | 0 | 1 | 0 |
| acloud_test.py | D | 03-May-2024 | 2.9 KiB | 89 | 49 |
| acloud_unittest.xml | D | 03-May-2024 | 1,011 | 24 | 8 |
| errors.py | D | 03-May-2024 | 5.8 KiB | 248 | 123 |
| pylintrc | D | 03-May-2024 | 687 | 25 | 18 |
| revert_host_setup.sh | D | 03-May-2024 | 1.5 KiB | 57 | 48 |
| run_tests.sh | D | 03-May-2024 | 3.1 KiB | 120 | 96 |
| setup.cfg | D | 03-May-2024 | 102 | 5 | 4 |
| setup.py | D | 03-May-2024 | 4.2 KiB | 135 | 99 |
README.md
1# **Acloud Manual**
2
3## **Acloud**
4
5Acloud is a command line tool that assists users to create an Android Virtual
6Device (AVD).
7
8## **Table of Contents**
9
101. [Environment Setup](#Environment-Setup)
112. [Basic Usage](#Basic-Usage)
12
13### **Environment Setup**
14
15Add acloud to your $PATH by lunching your environment.
16
17* Source envsetup.sh from the root of the android source checkout
18
19```
20$ source build/envsetup.sh
21```
22
23* Run lunch for an AVD target
24
25```
26$ lunch aosp_cf_x86_phone-userdebug
27```
28
29
30You should now be able to call acloud from anywhere.
31
32### **Basic Usage**
33
34Acloud commands take the following form:
35
36**acloud <command> <optional arguments>**
37
38Available commands:
39
40* [create](#create)
41* [list](#list)
42* [delete](#delete)
43* [reconnect](#reconnect)
44* [setup](#setup)
45* [pull](#pull)
46
47#### **create**
48
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.
53
54**Disclaimer: Creation of a cuttlefish local instance is not formally supported, please use at your own risk.**
55
56Here's a quick cheat-sheet for the 4 use cases:
57
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)
61
62> $ acloud create
63
64* Remote instance using a locally built image (use `m` to build the image)
65
66> $ acloud create --local-image [optional local-image-path]
67
68* Local instance using an Android Build image (LKGB for cuttlefish phone
69target in the branch of your repo)
70
71> $ acloud create --local-instance
72
73* Local instance using a locally built image (use `m` to build the image)
74
75> $ acloud create --local-instance --local-image
76
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:
80
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.
83
84* `--build-target`: Defaults to the phone target for cuttlefish (e.g.
85aosp\_cf\_x86\_phone-userdebug in aosp-master).
86
87* `--build-id`: Default to the Last Known Good Build (LKGB) id for the branch and
88target set from above.
89
90Additional helpful create options are:
91
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.
95
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`
100
101* `--unlock`: This can unlock screen after invoke the vnc client.
102
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:
106`cpu:2,resolution:1280x700,dpi:160,memory:2g,disk:2g`
107
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.
111
112The full list of options are available via `--help`
113
114> $ acloud create --help
115
116#### **list**
117
118List will retrieve all the remote instances you've created in addition to
119any local instances created as well.
120
121Cheatsheet:
122
123* List will show device IP address, adb port and instance name.
124
125> $ acloud list
126
127* List -v will show more detail info on the list.
128
129> $ acloud list -v
130
131
132#### **delete**
133
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.
138
139Cheatsheet:
140
141* Delete sole instance or prompt user with list of instances to delete.
142
143> $ acloud delete
144
145* Delete all instances
146
147> $ acloud delete --all
148
149* Delete a specific instance
150
151> $ acloud delete --instance-names [instance-name]
152
153#### **reconnect**
154
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.
159
160Cheatsheet:
161
162* Reconnect sole instance or prompt user with list of instances to reconnect.
163
164> $ acloud reconnect
165
166* Reconnect all instances
167
168> $ acloud reconnect --all
169
170* Reconnect a specific instance
171
172> $ acloud reconnect --instance-names [instance-name]
173
174
175### **pull**
176
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.
179
180Cheatsheet:
181
182* Pull logs from a sole instance or prompt user to choose one to pull if where
183are more than one active instances.
184
185> $ acloud pull
186
187* Pull logs from the specific instance.
188
189> $ acloud pull --instance-name "instance-name"
190
191* Pull a specific log file from a specific instance
192
193> $ acloud pull --instance-name "instance-name" --file-name "file-name"
194
195
196#### **setup**
197
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
202command.
203
204Cheatsheet:
205
206* Run setup for remote/local instances
207
208> $ acloud setup
209
210* Run setup for remote instances only
211
212> $ acloud setup --gcp-init
213
214* Run setup for local instances only
215
216> $ acloud setup --host
217
218* Force run setup
219
220> $ acloud setup --force
221
222* * *
223
224If you have any questions or feedback, contact [acloud@google.com](mailto:acloud@google.com).
225
226If you have any bugs or feature requests, [go/acloud-bug](http://go/acloud-bug).
227