feat(cli): cloud device control + listing#372
Merged
Conversation
Wire the existing CloudDriver into the `device` subcommands so screenshot/ tap/swipe/type/press/ui/apps/start can target a cloud.mobilerun.ai device. - add --cloud/--device-id/--base-url to every device subcommand - -d/--device doubles as the cloud device id when --cloud is set - resolve the API key from MOBILERUN_API_KEY or the saved credential - accept package_name/packageName in `device apps` (cloud field names)
Add --cloud/--base-url to the devices command and a helper that lists cloud devices (id, name, state, type) via the SDK, so users can discover device ids.
7 tasks
`mobilerun devices` (no flags) now lists local ADB devices and, when a Mobilerun credential is present (env var or saved login), also lists cloud devices. With no auth, the cloud section is silently skipped. `mobilerun devices --cloud` continues to show cloud-only.
Mirrors the unified `mobilerun devices` ergonomics. Previously `mobilerun device ui -d <uuid>` without `--cloud` fell into the local ADB path and surfaced an unhelpful "device 'uuid' not found" from adbutils. Now: if `-d` / `--device-id` matches the RFC-4122 UUID shape AND a cloud credential is resolvable (env var or `mobilerun login`), the cloud driver is used automatically. `--cloud` is no longer required for the common case of "I copied this id from `mobilerun devices`". Detection is strict (full-string UUID regex) so real ADB serials (`emulator-5554`, `R5CN10ABCDE`, `192.168.1.5:5555`) never match. Help text on `-d` / `--device-id` updated to surface the behavior. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
RasulOs
approved these changes
Jun 22, 2026
|
Docs PR opened: https://github.com/droidrun/mobilerun-docs/pull/22 Documented new cloud device support in the CLI guide for the mobilerun devices and mobilerun device commands. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds first-class cloud-device support to the
mobilerunCLI:mobilerun device <action> --cloud --device-id <id>— tap, swipe, screenshot, ui, type, press, apps, start, long-press now work against a cloud device oncloud.mobilerun.ai(in addition to local ADB).-d <id>is accepted as a shorthand for--device-idwhen--cloudis set.mobilerun devices --cloud— lists cloud devices (id / name / state / type) via the SDK.mobilerun devices(no flag) — now lists local ADB devices AND cloud devices (when a credential is present, silent otherwise). Single command, two sections.-dis a UUID.mobilerun device ui -d <uuid>(no--cloudflag) now works as long as a credential is resolvable — mirrors the unifieddevicesergonomics so users don't have to remember--cloudafter copy-pasting a cloud id frommobilerun devices. Strict UUID match, so ADB serials (emulator-5554,R5CN10ABCDE,192.168.1.5:5555) never trigger auto-routing.MOBILERUN_API_KEYenv var (themobilerun logincredential is added in the stacked PR on top of this one).--base-urldefaults tohttps://api.mobilerun.ai/v1; passhttps://dev-api.mobilerun.ai/v1for dev.--cloudand--iosare mutually exclusive (cloud is Android-only).Stack
This is PR 1 of 4 in a stack:
feat/cli-login-logout—mobilerun login/logout/whoami(OAuth 2.0 device flow)feat/cli-stream—mobilerun streamlive cloud viewer (not pushed yet)feat/extract-viewer— extract viewer into separatemobilerun-viewerdistribution (not pushed yet)Test plan
MOBILERUN_API_KEY=… mobilerun devices --cloudlists devices on prod--base-url https://dev-api.mobilerun.ai/v1lists devices on devmobilerun devices(no flag) shows both local and cloud sections when authenticatedmobilerun devices(no flag) shows only local section when no credential is set (cloud silently skipped, no error)mobilerun device ui -d <uuid>(no--cloudflag) auto-routes to cloud when authenticatedmobilerun device ui -d <uuid>falls back to local ADB when no credential is set (preserves old error)mobilerun device ui -d emulator-5554(or other non-UUID serial) stays on the local path even when authenticatedmobilerun device ui --cloud --device-id <id>works (explicit form unchanged)mobilerun device ui --cloud --device-id <id>returns an accessibility tree against a real devicemobilerun device screenshot --cloud --device-id <id>returns a PNG pathmobilerun device tap/swipe/typeround-trip against a cloud devicemobilerun device --cloud --iosis rejected with a clear errorMOBILERUN_API_KEYon a--cloudsubcommand produces a helpful error pointing tomobilerun login--cloud, non-UUID serial) still work