Skip to content

Cloud emulators & real phones

ocloud v3.17.3View Markdown

Outcome: give your local olef commands, CI jobs, or coding agent on-demand Android emulators and real physical phones without provisioning VMs or managing a USB rack.

1. Standalone cloud emulators (ocloud emulator)

Section titled “1. Standalone cloud emulators (ocloud emulator)”

Named cloud emulators keep their apps, accounts, and Quick Boot state on disk while stopped (billed for compute only while running). You can attach any running cloud emulator to local adb so every olef command drives it directly:

Terminal window
ocloud emulator create staging-36
ocloud emulator boot staging-36 --attach
olef -d cloud:staging-36 ui dump
ocloud emulator viewer staging-36 # hosted browser viewer URL
ocloud emulator stop staging-36 # saves Quick Boot state, stops compute billing

Save and restore clean states before destructive tests, or share an emulator with teammates in your organization:

Terminal window
ocloud emulator snapshot save staging-36 logged-in
ocloud emulator snapshot load staging-36 logged-in
ocloud emulator share staging-36

Need a clean disposable emulator for one script or CI step? Use the crash-safe wrapper, which unconditionally detaches on exit or signal:

Terminal window
ocloud emulator run staging-36 -- olef test run tests/olef

2. Real physical phones (Google Cloud DDP, preview)

Section titled “2. Real physical phones (Google Cloud DDP, preview)”

Reserve real Android phones from Google Cloud’s Developer Device Platform and drive them like a local USB device. Sessions can be billed to your own Google Cloud project (ddp.project in .olef/config.json) or to your Olef Cloud account where enabled ("billing": "olef"):

Terminal window
ocloud devices catalog --physical --available # specs like ddp:tokay-36
ocloud devices reserve ddp:tokay-36 # attached as 127.0.0.1:<port>
olef -d ddp:tokay-36 app apply # any olef command works on it
ocloud devices leases # time left, idle time, estimated cost
ocloud devices release ddp:tokay-36

In CI or automated scripts, prefer the RAII billing wrapper so a crash or Ctrl-C never leaves a paid phone leased:

Terminal window
ocloud devices run ddp:tokay-36 -- olef test run tests/olef --junit-out build/junit.xml

Spend protection is built in: set ddp.budget_usd_per_day in .olef/config.json, or approve the first daily reservation interactively (default daily cap $10). Idle leases release automatically after ddp.idle_release_ms (default 10 minutes). See Configuration for full settings.

3. Workspace SSH, port forwards, previews & desktop

Section titled “3. Workspace SSH, port forwards, previews & desktop”

A linked cloud workspace is a full Linux development environment, not just an emulator host. Use ocloud to interact with it directly:

Terminal window
ocloud run -- olef app apply # run remotely and sync project files back
ocloud ssh # plain ssh via short-lived certificate over TCP 443
ocloud ssh-config # writes ~/.olef/ssh/config (`ssh olef-<workspace>`)
ocloud forward 8080 # forward a workspace port to 127.0.0.1
ocloud preview open 5173 # private browser preview URL (*.olef.site)
ocloud desktop # XFCE graphical desktop, terminal, and Chrome

Every connection rides outbound HTTPS/WebSockets on TCP 443—no inbound ports or VPN tunnels required. See Restricted networks & proxies and ocloud emulator / ocloud devices.