Sign in Get 3 free credits

Try a job or a niche: tiktok captions, study notes, excel formulas. Press Esc to close.

Android cross app tests

Drives cross app and system UI flows with UiAutomator, so Android tests get past dialogs and other apps.

Claude's review

7/10 Accurate UiAutomator guidance with stale object recovery, cluttered by internal source line citations.

We asked Claude the question you would ask: would I be glad I installed this? We only sell skills it rates 7 or higher.

In detail

Use this skill to drive cross-app and system-UI flows from instrumentation tests using UiAutomator 2.3.0 — `UiDevice`, `BySelector` / `UiObject2` (modern), `UiSelector` / `UiObject` (legacy), `Until` conditions, and `Configurator` global timeouts. Covers the singleton acquisition (`UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())`), `pressBack/pressHome/pressRecentApps`, `device.findObject(By...)` cached-node refresh and `StaleObjectException` recovery, the `executeShellCommand` `@Discouraged` path vs `Context.startActivity` plus `<queries>`, and the full `By` factory catalog. Use when the user reports `StaleObjectException`, `Espresso InjectEventSecurityException`, `findObject returns null`, asks "how do I open Settings from a test", "toggle Wi-Fi", "dismiss notification shade", or "test that spans my app and another".

How you use it

  1. Add it to your pack, then download your pack (1 credit).
  2. In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
  3. Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide

Safety check

Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.

An automated scan lowers risk but cannot promise zero risk. How we check skills

Preview

The first lines of SKILL.md
---
name: cross-app-tests-with-uiautomator
description: Use this skill to drive cross-app and system-UI flows from instrumentation tests using UiAutomator 2.3.0 — `UiDevice`, `BySelector` / `UiObject2` (modern), `UiSelector` / `UiObject` (legacy), `Until` conditions, and `Configurator` global timeouts. Covers the singleton acquisition (`UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())`), `pressBack/pressHome/pressRecentApps`, `device.findObject(By...)` cached-node refresh and `StaleObjectException` recovery, the `executeShellCommand` `@Discouraged` path vs `Context.startActivity` plus `<queries>`, and the full `By` factory catalog. Use when the user reports `StaleObjectException`, `Espresso InjectEventSecurityException`, `findObject returns null`, asks "how do I open Settings from a test", "toggle Wi-Fi", "dismiss notification shade", or "test that spans my app and another".
license: Apache-2.0. See LICENSE for complete terms.
metadata:
  author: Jaewoong Eum (skydoves)
  keywords:
  - uiautomator
  - UiDevice
  - BySelector
  - UiObject2
  - UiSelector
  - Until
  - Configurator
  - StaleObjectException
  - cross-app-test
  - system-ui-test
  - pressHome
  - executeShellCommand
---

# Cross-App Tests with UiAutomator — Drive System UI and Other Apps

UiAutomator is the only AndroidX test framework that can drive UI **across process boundaries** — Settings, the dialer, system notifications, another app's activity. Espresso refuses (`InjectEventSecurityException`) when an event would cross to a foreign window. UiAutomator works against the platform `AccessibilityNodeInfo` tree, so it sees every window. This skill encodes the modern `BySelector` / `UiObject2` API, the singleton acquisition, the `StaleObjectException` recovery pattern, and the cross-app launch path.

## When to use this skill

- The test must drive system UI (Settings, dialer, system notifications, quick settings, recents).
- The test spans the developer's app and another app (share sheet, contacts picker, camera).
- Espresso threw `InjectEventSecurityException` because the test reached a foreign window.
- The user reports `StaleObjectException` and is debugging cached-node lifetime.
- The user asks how to send the device home, press recents, or toggle airplane mode in a test.
- The user mixes `BySelector` and `UiSelector` in the same test and is confused which is current.

## When NOT to use this skill

- The UI is entirely inside the developer's app — Espresso (Views) or Compose tests are faster and more reliable. See `../../espresso/writing-espresso-tests/SKILL.md` for Views.
- The runner stack is not yet set up — start with `../../runner/running-instrumented-tests-with-androidjunit4/SKILL.md`.
- The user only needs to push device-side state changes (animations off, intent stub) — see `../../../adb/control/injecting-input-and-state/SKILL.md`.
- The test only needs to scrape logs after a run — see `../../../adb/observability/extracting-logs-with-logcat/SKILL.md`.
...

From skydoves's repository, Apache-2.0 licence.

Related skills

  • Checked

    React Native tests

    Writes and fixes React Native component tests with Testing Library v13 and v14, using the right API for each.

    by callstackincubator 1.7k
    7/101 credit
  • Checked

    JUnit and Mockito tests

    Writes and fixes Java tests with JUnit, AssertJ and Mockito that are deterministic and keep failures visible.

    by github 42k
    8/101 credit
  • Checked

    Test code review

    Reviews new or changed tests in pytest, Jest, Go and more, so weak tests are caught before merge.

    by amElnagdy 1.3k
    8/101 credit
  • Checked

    Test scope decisions

    Decides which tests a change needs and how to judge their quality, for unit, integration and UI tests.

    by shinpr 725
    8/101 credit
  • Checked

    Playwright accessibility tests

    Writes Playwright and axe tests for WCAG, focus and ARIA, so accessibility bugs fail the build early.

    by fugazi 273
    7/101 credit
  • Checked

    Go table driven tests

    Writes Go tests with table cases, fakes, fuzzing, benchmarks and golden files that stay fast and reliable.

    by ericrisco 691
    8/101 credit

Secure checkout

Credits

AUD

  1. 1Choose
  2. 2Pay on Square
  3. 3Credits added