> For the complete documentation index, see [llms.txt](https://docs.mozark.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mozark.ai/mcp/mozark-mcp-docs/guides/automate-devices-with-appium.md).

# Automate devices with Appium

Drive Mozark cloud devices for exploratory testing and automation.

For exploratory testing, debugging, or ad-hoc automation, the assistant can drive a Mozark cloud device directly through **Appium**—no test case required.

## Typical prompts

> *"Grab a free Android 14 device, install my APK from `~/builds/app-release.apk` and open it."*
>
> *"Take a screenshot of the current screen."*
>
> *"Find the element with text 'Continue' and tap it."*
>
> *"Pull the crash logs and the HAR file from this session."*

## How a session works

{% stepper %}
{% step %}

## Devices

The assistant lists free devices and starts a session (`appium_start_session`) with the platform and any filters you mention. You never need to manage session IDs.
{% endstep %}

{% step %}

## Install your build

A local APK/IPA is streamed straight from your machine to Mozark's file store (`appium_get_app_upload_command`), then installed by ID (`appium_install_app`) and brought to the foreground (`appium_activate_app`). IPA files are re-signed automatically (allow 1–3 minutes).
{% endstep %}

{% step %}

## Interact

Find elements, tap, type, clear fields, navigate, rotate, switch between native and webview contexts, and run scripts.
{% endstep %}

{% step %}

## Collect

Collect screenshots, logs (syslog, crashlog, performance, server), and output files such as HAR and app profiles.
{% endstep %}

{% step %}

## Release

The session is stopped when you're done so the device frees up for others.
{% endstep %}
{% endstepper %}

## Install errors

{% hint style="warning" %}
If an install reaches the device but fails with `INSTALL_FAILED_VERSION_DOWNGRADE`, `INSTALL_FAILED_NO_MATCHING_ABIS`, or similar, that's the device or build—not the upload. The assistant will report it and can try another device.
{% endhint %}

## Recording into a test run

Just like Optics, you can say *"Run TR-8 with Appium"* and the assistant will mark each step and attach evidence in TCM as it goes.

## Related tools

| Category        | Tools                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Session**     | `appium_list_devices` · `appium_list_free_devices` · `appium_start_session` · `appium_get_session` · `appium_stop_session` · `appium_health_check` · `appium_hub_status`                                                                                                                                                                                                                                                                                                                                                                     |
| **Apps**        | `appium_get_app_upload_command` · `appium_upload_app` · `appium_install_app` · `appium_activate_app` · `appium_terminate_app`                                                                                                                                                                                                                                                                                                                                                                                                                |
| **Interaction** | `appium_find_element` · `appium_find_elements` · `appium_click_element` · `appium_set_element_value` · `appium_clear_element` · `appium_get_element_text` · `appium_get_page_source` · `appium_execute_script` · `appium_navigate_to` · `appium_navigate_back` · `appium_navigate_forward` · `appium_refresh` · `appium_get_url` · `appium_get_orientation` · `appium_set_orientation` · `appium_get_context` · `appium_get_contexts` · `appium_set_context` · `appium_get_settings` · `appium_update_settings` · `appium_apple_cdp_execute` |
| **Evidence**    | `appium_take_screenshot` · `appium_add_step_evidence` · `appium_list_screenshots` · `appium_list_assets` · `appium_list_outputs` · `appium_get_logs` · `appium_get_log_types`                                                                                                                                                                                                                                                                                                                                                                |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mozark.ai/mcp/mozark-mcp-docs/guides/automate-devices-with-appium.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
