---
id: "sistema.emulador-android"
titulo: "Install, launch and read an app on the emulated Android"
resumo: "Install an APK, launch the app by package, adjust permissions and read the screen and the logs of the emulated Android."
idioma: "en"
tipo: "tutorial"
categoria: "ambientes"
aplicavelDesde: "0.0.16"
capabilities: ["devices.android.apps", "devices.android.diagnostics"]
estadoEditorial: "aprovado"
nivelEvidencia: "artefato-distribuido"
refFonte: "27574c339b58316408f6be2d62169d59041d07bf"
revisaoFonte: "2026-09-24"
revisor: "mantenedor (v1, 2026-10-03)"
rota: "/docs/en/sistema/emulador-android/"
fonte: "pt-br/sistema/emulador-android.md"
caminhoPublico: "docs/publica/en/sistema/emulador-android.md"
hashFonte: "sha256:d0e4fba9af6f76aaddb5b3bf7368f120b9094f9e806a6bedc5b215205a4bb7d5"
hashDestaPagina: "sha256:2c01599d89ab03bbe9a068d9ca3ce8208a3dca209f28a6ef720d4afc72bce44b"
traducaoAssistidaPorIA: true
traducaoDesatualizada: false
corpoRetido: false
---
<!-- traducao-assistida-por-ia: idioma=EN fonte=pt-br/sistema/emulador-android.md fonteHash=sha256:d0e4fba9af6f76aaddb5b3bf7368f120b9094f9e806a6bedc5b215205a4bb7d5 estado=atual -->

This is the Android path: putting an APK on the emulated device, opening the app, changing runtime
permissions and reading what is happening — the accessibility tree and logcat. These are the steps that
replace "installing through Android Studio" and "looking at the screen" when the device is inside Elyra.

## Prerequisites

- An emulated **Android** device active for the workspace. See [Mobile emulator](/docs/en/sistema/emulador/).
- The APK already built on disk, if you are going to install it.
- The app's package — and the activity, if it is not the default one.

## Steps

1. **Install the APK.** Point at the file path and the target:

   ```bash
   elyra emulator install ./app-debug.apk --device emulator-5554 --json
   ```

   Use `--reinstall` to **replace an existing install** of the same package:

   ```bash
   elyra emulator install ./app-debug.apk --reinstall --json
   ```

2. **Launch the app by package**, with the activity when it matters:

   ```bash
   elyra emulator launch com.acme.app --activity .MainActivity --json
   ```

3. **Grant or revoke a runtime permission.** The order is `grant|revoke`, then the package, then the
   permission:

   ```bash
   elyra emulator permissions grant com.acme.app android.permission.CAMERA --json
   elyra emulator permissions revoke com.acme.app android.permission.CAMERA --json
   ```

4. **Reset every runtime grant** at once, when you want a clean state. `reset` takes neither a package
   nor a permission:

   ```bash
   elyra emulator permissions reset --json
   ```

5. **Read the screen through the accessibility tree.** `ax` dumps the uiautomator tree, which is how you
   know what is visible without a screenshot:

   ```bash
   elyra emulator ax --device emulator-5554 --json
   ```

6. **Capture a log excerpt.** `logcat` makes a one-shot dump, with a line limit and per-tag filters:

   ```bash
   elyra emulator logcat --lines 200 --device emulator-5554 --json
   elyra emulator logcat --filters "MyTag:D" --filters "*:S" --lines 200 --json
   ```

   Each filter is `TAG:PRIORITY`, with priority among `V D I W E F S` and `*` as the wildcard tag.

## Result

- The APK stays installed on the emulated device and the app opens by package and activity.
- The state of runtime permissions is under your control through the commands, without going through the
  Android UI.
- The accessibility tree and the log lines say what the app published and recorded.

## Limits

- **These commands are Android-only.** On an iOS Simulator they are refused with `emulator_unsupported`.
  On iOS, `install` and `launch` are up to Apple's tooling, outside Elyra.
- **An untrusted APK changes the device.** Installing is running third-party code on the device: install
  only what you built or trust, and prefer a throwaway AVD for it.
- **`reset` removes every runtime grant you gave** — not only the last one. It is the way back to the
  initial state and also the way to break an app that depended on them.
- **The accessibility tree and the logs can contain personal data or tokens.** Redact before sharing:
  nothing here was written to become a public attachment.
- **Read the result field, not just the absence of an error.** `install` answers `installed`, `launch`
  answers `launched` and `permissions` answers `applied`; the false variant carries the reason.
- **The permissions order is the common trap**: swapping package and permission is refused, and the
  refusal does not say which of the two is out of place.
- **There is no verb to uninstall an app** in this family. `exec` is a raw passthrough, runs in the
  device shell and returns only stdout — and it can change the simulator's state.
- **There is no screenshot and no copying of files off the device** here.

## Recovery and safe cleanup

- **The install failed** — re-read the reason in the reply; confirm the APK path exists on the execution
  host and that the target is an Android device.
- **The app did not open** — check the package and the activity; without `--activity`, the package must
  resolve the default activity.
- **The permission was refused** — confirm the `grant|revoke` order, the package and the full permission
  name (`android.permission.<NAME>`).
- **Undoing a grant** — `permissions revoke` for a specific permission; `permissions reset` for all of
  them.
- **Stopping the helper** — `elyra emulator kill` to free the session leaving the device on, or
  `elyra emulator shutdown` to stop it and power the device off. See
  [Emulator commands](/docs/en/sistema/emulador-cli/).

## Next steps

- [Emulator commands](/docs/en/sistema/emulador-cli/)
- [Interact with the emulated device](/docs/en/sistema/emulador-interacao/)
