Cloud emulators & real phones
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:
ocloud emulator create staging-36ocloud emulator boot staging-36 --attacholef -d cloud:staging-36 ui dumpocloud emulator viewer staging-36 # hosted browser viewer URLocloud emulator stop staging-36 # saves Quick Boot state, stops compute billingSave and restore clean states before destructive tests, or share an emulator with teammates in your organization:
ocloud emulator snapshot save staging-36 logged-inocloud emulator snapshot load staging-36 logged-inocloud emulator share staging-36Need a clean disposable emulator for one script or CI step? Use the crash-safe wrapper, which unconditionally detaches on exit or signal:
ocloud emulator run staging-36 -- olef test run tests/olef2. 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"):
ocloud devices catalog --physical --available # specs like ddp:tokay-36ocloud devices reserve ddp:tokay-36 # attached as 127.0.0.1:<port>olef -d ddp:tokay-36 app apply # any olef command works on itocloud devices leases # time left, idle time, estimated costocloud devices release ddp:tokay-36In CI or automated scripts, prefer the RAII billing wrapper so a crash or Ctrl-C never leaves a paid phone leased:
ocloud devices run ddp:tokay-36 -- olef test run tests/olef --junit-out build/junit.xmlSpend 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:
ocloud run -- olef app apply # run remotely and sync project files backocloud ssh # plain ssh via short-lived certificate over TCP 443ocloud ssh-config # writes ~/.olef/ssh/config (`ssh olef-<workspace>`)ocloud forward 8080 # forward a workspace port to 127.0.0.1ocloud preview open 5173 # private browser preview URL (*.olef.site)ocloud desktop # XFCE graphical desktop, terminal, and ChromeEvery connection rides outbound HTTPS/WebSockets on TCP 443—no inbound ports or VPN tunnels required. See Restricted networks & proxies and ocloud emulator / ocloud devices.