# ocloud emulator

Source: https://olef.dev/docs/reference/ocloud/emulator

Generated from **ocloud 3.17.3**. [All ocloud commands](https://olef.dev/docs/reference/ocloud) · [Olef Cloud overview](https://olef.dev/docs/cloud/overview) · [`olef` commands](https://olef.dev/docs/reference/commands)

Create, boot, attach, snapshot, share, view, and run standalone cloud emulators

Global options (`--org`, `--project-root`, `--quiet`, `--redact`) apply across commands; see the [`ocloud` command catalog](https://olef.dev/docs/reference/ocloud#global-options).

## ocloud emulator adopt

Turn a workspace's emulator into a named cloud emulator, once

```bash
ocloud emulator adopt --help
```

| Argument | Description |
| --- | --- |
| `<workspace>` | **Required.** The workspace (name or id) |
| `--name` | **Required.** The cloud emulator's name |

## ocloud emulator attach

Attach a running cloud emulator to this machine's adb and publish an Attachment Record so `olef` can drive it

```bash
ocloud emulator attach --help
```

| Argument | Description |
| --- | --- |
| `<emulator>` | **Required.** Cloud emulator name (`<name>` or `cloud:<name>`) |
| `--shared` | Attach although someone else is attached |
| `--port` | Local adb port (default: a free one from 15600) |

## ocloud emulator boot

Boot a cloud emulator and wait until it has finished starting

```bash
ocloud emulator boot --help
```

| Argument | Description |
| --- | --- |
| `<emulator>` | **Required.** Cloud emulator name (`<name>` or `cloud:<name>`) |
| `--attach` | Attach it to local adb once running |
| `--no-wait` | Return once asked, without waiting |

## ocloud emulator create

Create a cloud emulator: a named device with its own disk, kept while stopped (billed for storage) and booted on a cloud host (billed for compute while it runs)

```bash
ocloud emulator create --help
```

| Argument | Description |
| --- | --- |
| `<name>` | **Required.** Its name (`cloud:<name>`) |
| `--profile` | Device and image, from the catalog (default `phone-36`) |
| `--image` | A system image from the catalog, instead of the profile's |
| `--ram` | RAM, e.g. `4G` or `4096` (MB) |
| `--cores` |  |
| `--disk` | Disk size, e.g. `16G` |
| `--near` | Place it in this workspace's zone (fast and free traffic between them) |
| `--zone` |  |
| `--idle-stop-min` | Stop it after this many minutes without use (default 15) |
| `--max-run-hours` | Stop a run after this many hours (default 8) |
| `--boot` | Boot it once created |

## ocloud emulator delete

Delete a stopped cloud emulator and its disk

```bash
ocloud emulator delete --help
```

| Argument | Description |
| --- | --- |
| `<emulator>` | **Required.** Cloud emulator name (`<name>` or `cloud:<name>`) |

## ocloud emulator detach

Detach a cloud emulator from this machine (it keeps running)

```bash
ocloud emulator detach --help
```

| Argument | Description |
| --- | --- |
| `<emulator>` | **Required.** Cloud emulator name (`<name>` or `cloud:<name>`) |

## ocloud emulator list

List your Olef Cloud emulators and whether each is attached locally

```bash
ocloud emulator list --help
```

## ocloud emulator logs

A cloud emulator's boot log (why a boot failed)

```bash
ocloud emulator logs --help
```

| Argument | Description |
| --- | --- |
| `<emulator>` | **Required.** Cloud emulator name (`<name>` or `cloud:<name>`) |

## ocloud emulator reset

Reset a cloud emulator back to its image: apps and data go

```bash
ocloud emulator reset --help
```

| Argument | Description |
| --- | --- |
| `<emulator>` | **Required.** Cloud emulator name (`<name>` or `cloud:<name>`) |

## ocloud emulator run

Boot and attach a cloud emulator, run a command with `OLEF_DEVICE` and `ANDROID_SERIAL` set, and unconditionally detach on exit or signal (D6 crash-safe billing wrapper)

```bash
ocloud emulator run --help
```

| Argument | Description |
| --- | --- |
| `<emulator>` | **Required.** Cloud emulator name (`<name>` or `cloud:<name>`) |
| `--shared` | Attach although someone else is attached |
| `--stop-on-exit` | Also stop the cloud emulator when the command finishes (stops compute billing immediately) |
| `<command>` | **Required.** Command to run after `--` |

## ocloud emulator share

Share a cloud emulator with your org's members, or stop sharing it

```bash
ocloud emulator share --help
```

| Argument | Description |
| --- | --- |
| `<emulator>` | **Required.** Cloud emulator name (`<name>` or `cloud:<name>`) |
| `--off` | Stop sharing it |

## ocloud emulator snapshot list

List the saved states

```bash
ocloud emulator snapshot list --help
```

| Argument | Description |
| --- | --- |
| `<emulator>` | **Required.** Positional argument. |

## ocloud emulator snapshot load

Load a saved state

```bash
ocloud emulator snapshot load --help
```

| Argument | Description |
| --- | --- |
| `<emulator>` | **Required.** Positional argument. |
| `<name>` | **Required.** Positional argument. |

## ocloud emulator snapshot save

Save the running state under a name

```bash
ocloud emulator snapshot save --help
```

| Argument | Description |
| --- | --- |
| `<emulator>` | **Required.** Positional argument. |
| `<name>` | **Required.** Positional argument. |

## ocloud emulator stop

Stop a cloud emulator: its Quick Boot state is saved, compute billing stops

```bash
ocloud emulator stop --help
```

| Argument | Description |
| --- | --- |
| `<emulator>` | **Required.** Cloud emulator name (`<name>` or `cloud:<name>`) |

## ocloud emulator viewer

A link to a running cloud emulator's live viewer, hosted by Olef

```bash
ocloud emulator viewer --help
```

| Argument | Description |
| --- | --- |
| `<emulator>` | **Required.** Cloud emulator name (`<name>` or `cloud:<name>`) |
| `--view` | Watch only, without tapping or typing |
