Docs Operation reference android operations
android operations#
48 operations. Generated from assets/operations.json; all areas.
On this page (48)
- android.screen
- android.store_screenshots
- android.input
- android.hierarchy
- android.launch
- android.record
- android.mirror
- android.deep_link
- android.performance
- android.ports
- android.permission
- android.settings
- android.display
- android.notifications
- android.app_files
- android.each
- android.connect
- android.pair
- android.calibrate
- android.sdk_packages
- android.sdk_install
- android.avds
- android.avd_create
- android.avd_profile
- android.avd_configure
- android.avd_start
- android.avd_usage
- android.avd_manage
- android.avd_plan
- android.avd_setup
- android.emulator
- android.package_inspect
- android.size_report
- android.sensors
- android.app_links
- android.network_capture
- android.environment.capabilities
- android.environment.preset.list
- android.environment.preset.get
- android.environment.preset.save
- android.environment.preset.delete
- android.environment.preset.export
- android.environment.preset.import
- android.environment.inspect
- android.environment.plan
- android.environment.apply
- android.environment.restore
- android.environment.restores
android.screen#
Android screen preview
Save an Android device's screen as a PNG at path at once, through adb exec-out screencap, within 10 seconds and without a job, for previews that refresh such as the desktop's device grid. The result has the file's size and the picture's width and height. For evidence kept with a job, use device.capture.
Annotations: writes, idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Device serial / UDID from device.list | |
path | string | yes | non-empty; Absolute path of the PNG to write; an existing file is replaced. |
tomaccoctl call android.screen '{"device":"<device>","path":"<path>"}'
android.store_screenshots#
Capture store screenshots
Capture store screenshots of an installed Android app as a job: on each device, for each app language (set with android.settings app_locale, Android 13 and newer) and each of light and dark mode, every screen in order: stop and launch the app, run the screen's testing.run steps, wait settle_ms and save the screen. Files go to DIRECTORY/THEME/LOCALE/images/KIND/NN_SCREEN.png, where KIND is phoneScreenshots, sevenInchScreenshots or tenInchScreenshots by the device's smallest width, so each THEME folder is a fastlane supply metadata directory. Animations are off while capturing; each device's dark mode, animations and app language are put back afterwards. report.json lists every file with its size and play_problems (a side under 320 or over 3840 pixels, or longer than 2:1).
Annotations: writes, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
bundle_id | string | yes | non-empty; Application ID of the installed app | |
devices | array of string | yes | 1 to 8 items; Serials from device.list, at most one per screen size group | |
locales | array of string | yes | 1 to 30 items; App languages as Google Play's language codes, such as en-US or de-DE | |
themes | array of string | items one of light, dark; 1 to 2 items; Defaults to light only | ||
screens | array of object | yes | 1 to 10 items; Screens in store order | |
screens[].name | string | yes | matching [A-Za-z0-9_-]{1,40}; File name part of this screen | |
screens[].steps | array of object | [] | up to 100 items; testing.run scenario steps that lead from the launched app to this screen | |
directory | string | yes | non-empty; Absolute path of an empty or new directory for the screenshots | |
settle_ms | integer | 1000 | 0 to 30000; Wait after the last step before capturing | |
timeout | integer | 3600 | 10 to 86400; Seconds for the whole job |
tomaccoctl call android.store_screenshots '{"bundle_id":"<bundle_id>","devices":["<device>"],"locales":["<locale>"],"screens":[{"name":"<name>"}],"directory":"<directory>"}'
android.input#
Tap / swipe / input
Control real Android UI through adb, using device pixel coordinates. ASCII text is typed; other text is pasted through the device clipboard with the configured scrcpy 4.1 server on Android 7 and newer. With reservation_token it acts under a device reservation (device.reservation.acquire); with request_id it is recorded once in the request ledger, so a repeat after a lost answer is not sent again.
Annotations: writes, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Device serial / UDID from device.list | |
action | string | yes | one of tap, swipe, text, keyevent | |
x | integer | 0 | 0 to 16384 | |
y | integer | 0 | 0 to 16384 | |
end_x | integer | 0 | 0 to 16384 | |
end_y | integer | 0 | 0 to 16384 | |
duration | integer | 300 | 1 to 10000 | |
text | string | "" | ||
key | string | "KEYCODE_HOME" | ||
reservation_token | string | up to 200 characters; Act under this device reservation (device.reservation.acquire). A reserved device takes input only with its token; a token whose reservation expired, was released or was taken over is refused before anything is sent. | ||
request_id | string | non-empty, up to 128 characters; matching ^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$; Your identity for this action, unique per intent (order-42-submit). It is recorded with a digest of the arguments before anything is sent; repeating it with the same arguments answers the recorded outcome (retained: true) or request_outcome_unknown instead of sending again, with other arguments request_conflict. A refusal that sent nothing may be repeated under it. device.request.get shows the record. |
tomaccoctl call android.input '{"device":"<device>","action":"tap"}'
android.hierarchy#
Read UI tree
Read Android's UIAutomator XML hierarchy.
Annotations: read-only, idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Device serial / UDID from device.list |
tomaccoctl call android.hierarchy '{"device":"<device>"}'
android.launch#
Start Android activity
Resolve the installed launcher activity and wait for the actual launch result.
Annotations: writes, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Device serial / UDID from device.list | |
bundle_id | string | yes |
tomaccoctl call android.launch '{"device":"<device>","bundle_id":"<bundle_id>"}'
android.record#
Record display
Record an Android screen video and pull it to the given path, as a job. job.send stop ends the recording early and still pulls the video.
Annotations: writes, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Device serial / UDID from device.list | |
path | string | yes | non-empty; Absolute local filesystem path | |
seconds | integer | 30 | 1 to 180 |
tomaccoctl call android.record '{"device":"<device>","path":"<path>"}'
android.mirror#
Show Android live
Open scrcpy with keyboard and pointer control for the selected device.
Annotations: writes, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Device serial / UDID from device.list |
tomaccoctl call android.mirror '{"device":"<device>"}'
android.deep_link#
Open deep link
Open a deep link on the selected Android device.
Annotations: writes, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Device serial / UDID from device.list | |
url | string | yes |
tomaccoctl call android.deep_link '{"device":"<device>","url":"<url>"}'
android.performance#
Performance report
Collect actual memory, frame timing, battery or package reports.
Annotations: read-only, idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Device serial / UDID from device.list | |
bundle_id | string | yes | ||
report | string | "memory" | one of memory, frames, battery, package |
tomaccoctl call android.performance '{"device":"<device>","bundle_id":"<bundle_id>"}'
android.ports#
Connect dev server
Create/remove adb reverse or forward TCP ports.
Annotations: writes, idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Device serial / UDID from device.list | |
local_port | integer | yes | 1 to 65535 | |
device_port | integer | yes | 1 to 65535 | |
reverse | boolean | true | ||
remove | boolean | false |
tomaccoctl call android.ports '{"device":"<device>","local_port":1,"device_port":1}'
android.permission#
App permission
Grant or revoke a runtime permission for a selected app.
Annotations: writes, idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Device serial / UDID from device.list | |
bundle_id | string | yes | ||
permission | string | yes | ||
grant | boolean | true |
tomaccoctl call android.permission '{"device":"<device>","bundle_id":"<bundle_id>","permission":"<permission>"}'
android.settings#
Device settings for tests
Read or set what changes an app's look and motion in UI tests and screenshots: dark mode, font scale, animations, airplane mode and one app's language. Arguments left out stay as they are; the result reads every setting back and reports a value Android did not apply as setting_not_applied.
Annotations: writes, idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Device serial / UDID from device.list | |
dark_mode | string | one of on, off, auto; System dark theme; auto follows the device schedule | ||
font_scale | number | 0.5 to 2; System font size; 1 is the default | ||
animations | boolean | false sets the window, transition and animator scales to 0; true sets them to 1 | ||
airplane_mode | boolean | Android 11 and newer | ||
bundle_id | string | App whose language app_locale sets and the result reads | ||
app_locale | string | Language tags separated by commas, such as de-DE or fr,en; empty follows the device language again. Android 13 and newer. |
tomaccoctl call android.settings '{"device":"<device>"}'
android.display#
Display orientation and size
Lock the screen orientation, override the display size or density, or reset them, on a phone or emulator; the result reads all three back. A value Android did not apply answers setting_not_applied. With no other argument it only reads.
Annotations: writes, idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Device serial / UDID from device.list | |
orientation | string | one of auto, portrait, landscape, reverse-portrait, reverse-landscape; Lock the rotation; auto follows the sensor again | ||
width | integer | 100 to 10000; Override width in pixels, with height | ||
height | integer | 100 to 10000; Override height in pixels, with width | ||
density | integer | 72 to 1000; Override density in dpi | ||
reset | boolean | false | Return size and density to the device's own and rotation to the sensor, before anything else given |
tomaccoctl call android.display '{"device":"<device>"}'
android.notifications#
Notifications
List the notifications Android is showing, with key, package, title, text, channel and flags; open or close the notification shade; or snooze one notification by its key. Every action returns the list afterwards. adb cannot cancel another app's notifications, so snooze hides one for a time instead.
Annotations: writes, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Device serial / UDID from device.list | |
action | string | "list" | one of list, open, close, snooze; open and close expand or collapse the notification shade | |
bundle_id | string | List only this app's notifications | ||
key | string | Notification key from the list, for snooze | ||
seconds | integer | 3600 | 1 to 604800; How long snooze hides the notification |
tomaccoctl call android.notifications '{"device":"<device>"}'
android.app_files#
App data files
List or pull the private files of a debuggable app (its data directory, through run-as). pull returns a job that writes the files as one .tar archive. Release builds answer app_not_debuggable. To clear app data or force-stop the app, use device.app.
Annotations: writes, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Device serial / UDID from device.list | |
bundle_id | string | yes | Application ID of a debuggable build | |
action | string | "list" | one of list, pull | |
path | string | "." | File or directory inside the app's data directory, relative to it, such as files or databases/app.db | |
output | string | "" | Absolute local path of the .tar archive, for pull |
tomaccoctl call android.app_files '{"device":"<device>","bundle_id":"<bundle_id>"}'
android.each#
Run on every Android device
Run the same steps on every connected Android device, or on the listed ones, as one job: all devices at once, each device's steps in order until one fails. A step that returns a job is followed to its end. The job's report.json artifact has every device's result; the job fails if any device failed. Steps leave out device and platform, which are set per device.
Annotations: destructive, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
steps | array of object | yes | 1 to 20 items | |
steps[].operation | string | yes | one of device.install, device.app, android.launch, android.permission, android.settings, android.display, android.deep_link, android.input, android.notifications | |
steps[].arguments | object | {} | The operation's arguments without device and platform | |
devices | array of string | up to 100 items; Serials from device.list; all online Android devices when left out | ||
timeout | integer | 1800 | 10 to 86400; Seconds for the whole job |
tomaccoctl call android.each '{"steps":[{"operation":"device.install"}]}'
android.connect#
Android over Wi-Fi
Pair or connect adb to a device address. Pairing codes are not persisted.
Annotations: writes, idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
address | string | yes | ||
pairing_code | string | "" | ||
retry | object | Try again after a failure: count more attempts (at most 5), waiting backoff_seconds, doubled each time up to 600. Only adb connect is repeated, never pairing; the result says how many attempts it took. | ||
retry.count | integer | yes | 0 to 5 | |
retry.backoff_seconds | integer | 5 | 1 to 600 |
tomaccoctl call android.connect '{"address":"<address>"}'
android.pair#
Pair over Wi-Fi by QR code
Wireless debugging pairing by QR code, for Android 11 and newer. action qr makes a one-time service name and password and returns the QR code the phone's Developer options > Wireless debugging > Pair device with QR code scans: qr_text, the modules as qr.rows (1 is dark), an SVG, and with path a PNG or SVG file. Nothing is stored. action wait, with that service and password, waits up to timeout seconds for the phone to offer the code on the local network (adb mdns), pairs with adb pair and connects to the phone's debugging service; the result names the device to use. Call wait again while the code shows; pairing_timeout means the phone has not scanned it yet. action services lists what adb finds on the network, such as the address the phone shows under Pair device with pairing code, for android.connect with pairing_code.
Annotations: writes, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
action | string | "qr" | one of qr, wait, services; qr shows a new code, wait pairs once the phone scanned it, services lists discovered devices. | |
service | string | For wait: the service name action qr returned. | ||
password | string | For wait: the password action qr returned. | ||
timeout | integer | 60 | 1 to 300; For wait: how many seconds to wait for the phone. | |
path | string | "" | For qr: an absolute path ending in .png or .svg to write the code to. |
tomaccoctl call android.pair
android.calibrate#
Read model from device
Create a custom profile from actual wm size/density. Frame details remain editable.
Annotations: writes, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Device serial / UDID from device.list | |
profile_id | string | yes | ||
name | string | yes |
tomaccoctl call android.calibrate '{"device":"<device>","profile_id":"<profile_id>","name":"<name>"}'
android.sdk_packages#
SDK packages
List available/installed Android SDK packages.
Annotations: read-only, idempotent, open world.
Takes no arguments.
tomaccoctl call android.sdk_packages
android.sdk_install#
Install SDK packages
Install explicit SDK package IDs. License acceptance is opt-in.
Annotations: destructive, idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
packages | array of string | yes | 1 to 100 items | |
accept_licenses | boolean | false | ||
retry | object | Try again after a failure: count more attempts (at most 5), waiting backoff_seconds, doubled each time up to 600. A cancelled or timed-out job is not repeated; the job's result lists its attempts. | ||
retry.count | integer | yes | 0 to 5 | |
retry.backoff_seconds | integer | 5 | 1 to 600 |
tomaccoctl call android.sdk_install '{"packages":["<package>"]}'
android.avds#
Android emulators
List configured Android emulators with model profile, resolution, density, GPU mode and installed system images. Legacy profiles are inferred only from unique resolution/density matches.
Annotations: read-only, idempotent, open world.
Takes no arguments.
tomaccoctl call android.avds
android.avd_create#
Create emulator
Create an AVD using an installed system image and a catalogue profile.
Annotations: writes, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
name | string | yes | ||
system_image | string | yes | ||
profile_id | string | yes |
tomaccoctl call android.avd_create '{"name":"<name>","system_image":"<system_image>","profile_id":"<profile_id>"}'
android.avd_profile#
Set emulator display
Apply a profile's resolution/density to a stopped Tomacco AVD. On a host with less than 10 GiB of memory or at most 4 processors it also lowers the emulator's memory and processors (adapted_to_host), unless android.avd_configure set them.
Annotations: destructive, idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
name | string | yes | ||
profile_id | string | yes |
tomaccoctl call android.avd_profile '{"name":"<name>","profile_id":"<profile_id>"}'
android.avd_configure#
Set emulator performance
Persist graphics, RAM and CPU settings for a stopped registered Android emulator. Preserves app data and other configuration, saves the original configuration, and skips incompatible VM snapshots on subsequent Tomacco starts. Running AVDs are rejected.
Annotations: writes, idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
name | string | yes | ||
gpu | string | one of auto, host, software, swiftshader, lavapipe | ||
memory_mb | integer | 512 to 32768 | ||
cores | integer | 1 to 32 | ||
vulkan | string | one of auto, on, off; Vulkan compatibility override; off keeps OpenGL ES and avoids the Vulkan interoperability path. Requires a cold restart. |
tomaccoctl call android.avd_configure '{"name":"<name>"}'
android.avd_start#
Start emulator
Start or reuse an Android virtual device. A Tomacco-managed AVD resumes from its Quick Boot snapshot when android.emulator saved one at its last stop; the result's boot says quick or cold and why. CPU acceleration remains enabled independently of the selected GPU renderer. A start with a window needs X11 (DISPLAY, XWayland on Wayland) and is refused with emulator_no_display without it; the emulator gets QT_QPA_PLATFORM=xcb when the session names only wayland. With gpu configured and the AVD's default auto renderer, a host without a hardware GPU driver starts with swiftshader (gpu in the result says so).
Annotations: writes, idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
name | string | yes | ||
headless | boolean | false | ||
software | boolean | false | ||
gpu | string | "configured" | one of configured, auto, host, software, swiftshader, lavapipe; configured respects the saved AVD renderer; auto selects a compatible renderer; host uses the computer GPU. An override applies to this start. Changing renderer requires stopping the emulator first. | |
cold_boot | boolean | false | Boot fully instead of loading the Quick Boot snapshot, for example after changing the GPU renderer. App data is retained. | |
audio | boolean | true | Enable the emulator host audio backend independently of headless mode. Embedded clients can disable this and use runtime.audio instead. Applied only to a new emulator process. | |
vulkan | string | "configured" | one of configured, auto, on, off; Vulkan compatibility override; off keeps OpenGL ES and avoids the Vulkan interoperability path. Requires a cold restart. | |
camera_image | string | non-empty; Absolute path of a PNG or JPEG the emulated camera shows instead of its scene, for QR code and document scanning. Applied only to a new emulator process, which then boots cold. | ||
camera_facing | string | "back" | one of back, front; Which camera shows camera_image |
tomaccoctl call android.avd_start '{"name":"<name>"}'
android.avd_usage#
Emulator disk usage
Space every AVD takes on disk, what a wipe of each would free, whether Tomacco runs it or its lock files say it may be running, and the free space of Tomacco's AVD directory. Reads files only; no device or adb server is reached.
Annotations: read-only, idempotent, closed world.
Takes no arguments.
tomaccoctl call android.avd_usage
android.avd_manage#
Duplicate, rename or wipe emulator
duplicate copies a stopped AVD under new_name into Tomacco's AVD directory as a cancellable job; the copy appears only when complete, without the source's snapshots and lock files, with its own identity. rename renames a stopped AVD through the SDK's avdmanager move and carries its nickname over; a nickname alone is device.label. wipe removes a stopped AVD's user data, cache and snapshots so its next boot is like a new device; its configuration and SD card stay. rename and wipe need the AVD's name a second time in confirm, after the person agreed. A running emulator, or one whose lock files exist, is refused with avd_in_use.
Annotations: destructive, not idempotent, closed world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
action | string | yes | one of duplicate, rename, wipe | |
name | string | yes | matching [A-Za-z0-9][A-Za-z0-9_-]{0,63}; AVD name from android.avds | |
new_name | string | matching [A-Za-z0-9][A-Za-z0-9_-]{0,63}; The new AVD name, for duplicate and rename; it must be free | ||
confirm | string | The AVD name again, for rename and wipe |
tomaccoctl call android.avd_manage '{"action":"duplicate","name":"<name>"}'
android.avd_plan#
Plan emulator setup
What android.avd_setup would do for a name, system image and profile, without doing it: whether the image is installed, the estimated download and disk space against the free space, whether Google's SDK licence is already accepted, which tools are missing, and whether the name is free. blockers lists what stops a setup; ready says whether one can start. Reads files only.
Annotations: read-only, idempotent, closed world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
name | string | yes | matching [A-Za-z0-9][A-Za-z0-9_-]{0,63}; AVD name from android.avds | |
system_image | string | yes | non-empty; System image package, such as system-images;android-36;google_apis;x86_64; android.avds lists the installed ones | |
profile_id | string | yes | non-empty; Android device profile from catalog.list | |
start | object | Start the emulator at the end of the job with these android.avd_start arguments; headless defaults to true | ||
start.headless | boolean | true | ||
start.gpu | string | "configured" | one of configured, auto, host, software, swiftshader, lavapipe | |
start.cold_boot | boolean | false |
tomaccoctl call android.avd_plan '{"name":"<name>","system_image":"<system_image>","profile_id":"<profile_id>"}'
android.avd_setup#
Set up emulator
One job from image to running emulator: install the system image when it is missing, create the AVD, apply the profile and, with start, start it. The job's steps are the plan's steps and job.cancel stops it at any of them. A missing image is downloaded only when Google's SDK licence is already accepted or accept_licenses is true; otherwise the call answers sdk_license_required and nothing is downloaded or created. Blockers from android.avd_plan answer avd_setup_blocked.
Annotations: destructive, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
name | string | yes | matching [A-Za-z0-9][A-Za-z0-9_-]{0,63}; AVD name from android.avds | |
system_image | string | yes | non-empty; System image package, such as system-images;android-36;google_apis;x86_64; android.avds lists the installed ones | |
profile_id | string | yes | non-empty; Android device profile from catalog.list | |
accept_licenses | boolean | false | Accept Google's Android SDK licence for the image download, after the person agreed | |
start | object | Start the emulator at the end of the job with these android.avd_start arguments; headless defaults to true | ||
start.headless | boolean | true | ||
start.gpu | string | "configured" | one of configured, auto, host, software, swiftshader, lavapipe | |
start.cold_boot | boolean | false |
tomaccoctl call android.avd_setup '{"name":"<name>","system_image":"<system_image>","profile_id":"<profile_id>"}'
android.emulator#
Control emulator
Stop an emulator, saving the Quick Boot snapshot of a Tomacco-managed one so its next start resumes in seconds; save, load, list or delete its snapshots; set its GPS location, battery or network speed and latency through the emulator console. A command the console refuses answers emulator_refused.
Annotations: destructive, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Device serial / UDID from device.list | |
action | string | yes | one of stop, snapshot-save, snapshot-load, snapshot-list, snapshot-delete, location, battery, network | |
name | string | "default" | Snapshot name for snapshot-save, snapshot-load and snapshot-delete | |
longitude | number | 0 | -180 to 180 | |
latitude | number | 0 | -90 to 90 | |
battery_level | integer | 100 | 0 to 100; Battery charge in percent, for battery | |
charging | boolean | true | Whether the charger is connected, for battery | |
network_speed | string | "full" | one of gsm, hscsd, gprs, edge, umts, hsdpa, lte, evdo, 5g, full; Network speed preset, for network; full means no limit | |
network_delay | string | "none" | one of gprs, edge, umts, none; Network latency, for network: gprs 150-550 ms, edge 80-400 ms, umts 35-200 ms, none adds no latency | |
save_quick_boot | boolean | true | For stop: save the Quick Boot snapshot of a Tomacco-managed emulator first, which its next android.avd_start loads. Other emulators are never saved. |
tomaccoctl call android.emulator '{"device":"<device>","action":"stop"}'
android.package_inspect#
Inspect APK or AAB
Read an APK or AAB without a device: package, version name and code, minimum, target and compile SDK, permissions, native ABIs and signing certificates with their SHA-256 digests. APKs go through aapt2 and apksigner from the SDK build-tools; an AAB's manifest is read directly and its signature through keytool. Reads the file only.
Annotations: read-only, idempotent, closed world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
path | string | yes | non-empty; Absolute path of an .apk or .aab file |
tomaccoctl call android.package_inspect '{"path":"<path>"}'
android.size_report#
Report APK or AAB size
Break an APK or AAB down by size without a device: totals, each category (dex, native, resources, assets, manifest, signature), each ABI, screen density and bundle module, and the largest files. estimate.by_abi_density adds up the compressed sizes one device would get without other ABIs' libraries and other densities' resources. For an AAB with bundletool configured, download has bundletool get-size total's download size per ABI and density, from APKs it builds in a temporary directory. baseline compares with an earlier build: the change of every total and the files that grew, shrank, appeared or went away the most.
Annotations: read-only, idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
path | string | yes | non-empty; Absolute path of an .apk or .aab file | |
baseline | string | "" | Absolute path of an earlier .apk or .aab to compare with | |
top | integer | 15 | 1 to 200; How many of the largest and most changed files to list | |
bundletool | boolean | true | For an AAB, also ask bundletool for the download size; false reads the file only |
tomaccoctl call android.size_report '{"path":"<path>"}'
android.sensors#
Emulator sensors
Simulate the sensors of an Android emulator through its console. status lists every sensor with its values; set gives one sensor values; orientation turns the device by gravity and reads back the display rotation Android chose; shake shakes the accelerometer for about a second; proximity covers or uncovers the proximity sensor; light sets the ambient light; fingerprint touches the fingerprint sensor with an enrolled finger, for a biometric prompt; posture folds, half-opens or opens a foldable emulator.
Annotations: writes, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Emulator serial from device.list, such as emulator-5554 | |
action | string | yes | one of status, set, orientation, shake, proximity, light, fingerprint, posture | |
sensor | string | non-empty; For set: a sensor name from status, such as acceleration or magnetic-field | ||
values | array of number | 1 to 6 items; For set: the sensor's values, such as x, y and z | ||
orientation | string | "portrait" | one of portrait, landscape, reverse-portrait, reverse-landscape; For orientation: how the device is held | |
near | boolean | true | For proximity: whether something covers the sensor | |
lux | number | 300 | 0 to 100000; For light: ambient light in lux | |
finger_id | integer | 1 | 1 to 10; For fingerprint: the enrolled finger, as the emulator numbers them | |
posture | string | "open" | one of closed, half-open, open; For posture: the foldable's hinge |
tomaccoctl call android.sensors '{"device":"<device>","action":"status"}'
android.app_links#
App Links
Check an app's Android App Links. status reads each web domain the app declares with autoVerify and its verification state (verified, none, denied, or the verifier's error code) and the user's link choices; verify asks Android to verify the domains again and waits up to seconds for the answers, which need the domains' assetlinks.json and a network; resolve names the app and activity a link opens, or that Android shows a chooser, and every app that could open it; set approves, denies or resets domains by hand, as tests of a debug build need. Opening a link is android.deep_link.
Annotations: writes, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Device serial / UDID from device.list | |
action | string | "status" | one of status, verify, resolve, set | |
bundle_id | string | non-empty; The app's application ID; for resolve it adds opens_in_app | ||
url | string | non-empty; For resolve: the link, such as https://example.com/item/1 | ||
seconds | integer | 30 | 0 to 120; For verify: how long to wait for the verifier | |
state | string | "approved" | one of approved, denied, none; For set: the state to give the domains | |
domains | array of string | For set: domains the app declares; all of them when left out |
tomaccoctl call android.app_links '{"device":"<device>"}'
android.network_capture#
Network capture
Capture the network traffic of an emulator, or only what one app sends, and summarise it: hosts with bytes and connections, TLS server names, HTTP requests with method, host and path but no query, and DNS queries. Contents are never in the summary; HTTPS stays encrypted, as no certificate is installed. start needs opt_in:true, a running emulator whose image allows root through su (Google APIs or AOSP, not Google Play) and runs the image's tcpdump; bundle_id limits it to the app's outgoing packets through an iptables rule that stop removes. stop ends it, copies the pcap file, readable only by you, to path and summarises it; summary reads any pcap file.
Annotations: writes, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | non-empty; Emulator serial from device.list, such as emulator-5554 | ||
action | string | yes | one of start, stop, summary | |
opt_in | boolean | false | For start: confirm that every packet, contents included, may be recorded | |
bundle_id | string | non-empty; For start: capture only what this app sends | ||
path | string | non-empty; For stop: where to write the pcap file, absolute; by default under Tomacco's data. For summary: the pcap file to read |
tomaccoctl call android.network_capture '{"action":"start"}'
android.environment.capabilities#
QA environment settings
List the settings a QA environment preset can name, the Android version each needs, and which are read back and restorable. Touches no device.
Annotations: read-only, idempotent, closed world.
Takes no arguments.
tomaccoctl call android.environment.capabilities
android.environment.preset.list#
List QA environments
List the saved QA environment presets. A preset file that does not validate is listed under problems, not dropped silently.
Annotations: read-only, idempotent, closed world.
Takes no arguments.
tomaccoctl call android.environment.preset.list
android.environment.preset.get#
Read QA environment
Read one saved QA environment preset with its revision.
Annotations: read-only, idempotent, closed world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
id | string | yes | matching [a-z0-9][a-z0-9-]{0,62}; Preset ID: lower-case letters, digits and hyphens |
tomaccoctl call android.environment.preset.get '{"id":"<id>"}'
android.environment.preset.save#
Save QA environment
Create a named QA environment preset, or replace one when if_revision names its current revision. The preset is a versioned JSON document (format tomacco.environment-preset, version 1).
Annotations: writes, not idempotent, closed world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
id | string | yes | matching [a-z0-9][a-z0-9-]{0,62}; Preset ID: lower-case letters, digits and hyphens | |
name | string | yes | non-empty, up to 80 characters | |
description | string | up to 500 characters | ||
settings | object | yes | The settings this environment sets; settings left out stay as they are | |
settings.dark_mode | string | one of on, off, auto; System dark theme | ||
settings.font_scale | number | 0.5 to 2; System font size; 1 is the default | ||
settings.animations | boolean | false sets the three animation scales to 0 | ||
settings.airplane_mode | boolean | Android 11 and newer | ||
settings.app_locale | string | Language tags of one app, such as de-DE or fr,en; Android 13 and newer | ||
settings.location | object | GPS fix; emulators only, and neither read back nor restorable | ||
settings.location.latitude | number | yes | -90 to 90 | |
settings.location.longitude | number | yes | -180 to 180 | |
settings.talkback | boolean | TalkBack on or off; needs the installed service and keeps every other accessibility service | ||
if_revision | integer | 1 to 9007199254740991 |
tomaccoctl call android.environment.preset.save '{"id":"<id>","name":"<name>","settings":{}}'
android.environment.preset.delete#
Delete QA environment
Delete a saved QA environment preset. if_revision must name its current revision. Restore points made with it stay.
Annotations: destructive, not idempotent, closed world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
id | string | yes | matching [a-z0-9][a-z0-9-]{0,62}; Preset ID: lower-case letters, digits and hyphens | |
if_revision | integer | yes | 1 to 9007199254740991 |
tomaccoctl call android.environment.preset.delete '{"id":"<id>","if_revision":1}'
android.environment.preset.export#
Export QA environment
Return a preset as its versioned JSON document and, with path, write it to a new file. An existing file is never replaced.
Annotations: writes, not idempotent, closed world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
id | string | yes | matching [a-z0-9][a-z0-9-]{0,62}; Preset ID: lower-case letters, digits and hyphens | |
path | string | New JSON file to write |
tomaccoctl call android.environment.preset.export '{"id":"<id>"}'
android.environment.preset.import#
Import QA environment
Import a preset document, given inline or as a file. It becomes a new preset, or replaces one when if_revision names its current revision. A newer format version is refused.
Annotations: writes, not idempotent, closed world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
document | object | A document from android.environment.preset.export | ||
path | string | JSON file with such a document | ||
id | string | matching [a-z0-9][a-z0-9-]{0,62}; Preset ID: lower-case letters, digits and hyphens | ||
if_revision | integer | 1 to 9007199254740991 |
tomaccoctl call android.environment.preset.import
android.environment.inspect#
Read QA environment of device
Read every QA environment setting of one named device as it is now: value, whether it is supported, read back and restorable, and the installed TalkBack service. Changes nothing.
Annotations: read-only, idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | yes | non-empty; Serial from device.list. Required: a QA environment never applies to whatever device happens to be connected. | |
bundle_id | string | App whose language app_locale sets; needed when the preset has app_locale |
tomaccoctl call android.environment.inspect '{"device":"<device>"}'
android.environment.plan#
Plan QA environment
Read a named device for a preset and record what applying it would change, what the device does not support and what cannot be restored. Changes nothing on the device. Returns plan_id for android.environment.apply; a plan holds for 15 minutes and applies once.
Annotations: read-only, idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
preset | string | yes | matching [a-z0-9][a-z0-9-]{0,62}; Preset ID: lower-case letters, digits and hyphens | |
device | string | yes | non-empty; Serial from device.list. Required: a QA environment never applies to whatever device happens to be connected. | |
bundle_id | string | App whose language app_locale sets; needed when the preset has app_locale |
tomaccoctl call android.environment.plan '{"preset":"<preset>","device":"<device>"}'
android.environment.apply#
Apply QA environment
Apply a plan to the device it was made for. Refuses when the device behind the serial, the preset or the planned settings changed, and when the device lacks a setting unless allow_partial is true. Writes a restore point first, then reads every setting back and reports a value Android did not apply as setting_not_applied.
Annotations: writes, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
plan_id | string | yes | matching [0-9a-f]{32} | |
device | string | yes | non-empty; Serial from device.list. Required: a QA environment never applies to whatever device happens to be connected. | |
allow_partial | boolean | false | Set the supported settings and skip the rest |
tomaccoctl call android.environment.apply '{"plan_id":"<plan_id>","device":"<device>"}'
android.environment.restore#
Restore device settings
Write back what an apply changed, on the same device, from the values read before it, and read them back. A GPS fix has no previous value and is reported as not restorable.
Annotations: writes, not idempotent, open world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
restore_id | string | yes | matching [0-9a-f]{32} | |
device | string | yes | non-empty; Serial from device.list. Required: a QA environment never applies to whatever device happens to be connected. |
tomaccoctl call android.environment.restore '{"restore_id":"<restore_id>","device":"<device>"}'
android.environment.restores#
List restore points
List the restore points of applied QA environments, newest first, optionally for one device.
Annotations: read-only, idempotent, closed world.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
device | string | Only this serial |
tomaccoctl call android.environment.restores