Skip to content
Back to skills

Test On Device

ASecurity

Verify an Android app change on the user's real Android phone - build, install, open, drive the changed screens with CodeDroid, check logcat for crashes, run instrumentation tests, and report what was seen. Use after changing Android app code, when asked to test, reproduce or verify something on a device, or before saying an Android change works.

  • 9 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 13, 2026
developmentgoshelltestingdebugging

Security analysis

A100/100

Scanned December 1, 2026

npx -y skills add codedroid-team/codedroid-mcp --skill test-on-device --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Test On Device?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Test On Device
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/codedroid-team-test-on-device/badge)](https://www.skillsdirectory.com/skills/codedroid-team-test-on-device)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: test-on-device
description: Verify an Android app change on the user's real Android phone - build, install, open, drive the changed screens with CodeDroid, check logcat for crashes, run instrumentation tests, and report what was seen. Use after changing Android app code, when asked to test, reproduce or verify something on a device, or before saying an Android change works.
---

# Testing an Android change on the phone

CodeDroid's tools (`get_screen`, `tap`, `type_text`, `wait_for`, `take_screenshot`, ...) see and
drive the screen exactly as it is; the codedroid-phone skill covers them. adb, from the Android
SDK on this computer, installs, starts and inspects the app. Use adb to install and inspect; use
CodeDroid to look and act.

When `adb` is not in your tool list (CodeDroid's hosted server has none), run the adb commands
below with your own shell tool when the phone is on this computer's adb (`adb devices -l` says),
ask the user to run them otherwise, and read the steps that follow as what to do rather than
which tool. Without adb, CodeDroid's tools still drive and check the app: say in the report
which checks adb would have made.

## 1. Know the phone

CodeDroid reaches the phone through the CodeDroid server; adb needs it on this computer, over USB
or Wireless debugging. Call `codedroid_devices`, then `device_info` for the phone's model and
Android `user`, and `adb` `devices -l` to find the same model there. If adb lists none, go on
without it, or ask the user to connect it for logs and instrumentation tests; if it lists several, pass `-s <serial>`. On a phone with
several users (a Googlebook runs as user 10), adb's `settings`, `content`, `pm grant` and
`appops` default to user 0: add `--user <user>` to them. `adb install` covers every user.

## 2. Build and install

1. Build with the project's own task, e.g. `./gradlew :app:assembleDebug` (check the module and
   variant names in the project first).
2. Install `app/build/outputs/apk/debug/app-debug.apk`. On a phone attached to adb, `adb`
   `install -r -g <apk>` keeps the app's data and grants its runtime permissions: run it yourself if the phone is on this computer's adb,
   or ask the user to. A signature mismatch means the phone has another build: ask the user before
   removing it, which deletes the app's data.
3. If the phone is on adb, `adb` `logcat -c` to clear the logs, so what you read later is from this run.

## 3. Open it and drive the change

1. `open_app` with the package, or `adb` `shell am start -W -n <package>/<activity>`. For a deep
   link: `shell am start -W -a android.intent.action.VIEW -d "<uri>" <package>`.
2. `wait_for` text on the first screen, rather than sleeping.
3. Walk to the changed screen with `get_screen` and `tap` / `type_text` / `swipe`, reading
   `after` each time.
4. Check what the change should show: the text and state in `get_screen` (a switch is `checked`
   or `unchecked`, a field shows its text), and `take_screenshot` for anything visual.
5. Try the edges the change touches: empty input, rotation (`adb` `shell settings put system
   user_rotation 1` after `shell settings put system accelerometer_rotation 0`), dark theme
   (`shell cmd uimode night yes`), back navigation. Put settings back afterwards.

## 4. Check the logs

- Crashes: `adb` `logcat -d -b crash`. A crash kills the process, so read the crash buffer
  rather than filtering by process id.
- Errors: `logcat -d -t 300 *:E`; one app's lines: `shell pidof <package>`, then
  `logcat -d --pid=<pid>`.
- ANRs: `shell logcat -d -b system | grep -A5 "ANR in"` (after `shell`, the pipe runs on the phone).

## 5. Instrumentation tests

`adb` `shell am instrument -w -r -e class <fully.qualified.TestClass> <test-package>/androidx.test.runner.AndroidJUnitRunner`
(install the test APK first:
`./gradlew :app:installDebugAndroidTest`). If the run itself did not finish (a crash, a timeout, no tests ran), read the
crash buffer as in section 4. Tests that use UiAutomator suspend CodeDroid's accessibility
while they run: call `device_info` before using its tools again.

## 6. Report

Say what you checked and what you saw, step by step, and whether the change works. Include a
screenshot when the change is visual (`take_screenshot`; if CodeDroid is suspended, `adb`
`exec-out screencap -p` into a file), and the crash's stack trace (from `logcat -d -b crash`)
when there was one. If something could not be checked (the phone was locked, a screen could not
be reached), say so rather than guessing.

## Never

- Force-stop, clear, uninstall or `am instrument` com.codedroid.agent: it switches CodeDroid off.
- Uninstall an app, clear its data, reboot or delete files without asking the user first.
- Stream: `logcat` without `-d` and `screenrecord` without `--time-limit` run until the call
  times out.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.