본문으로 건너뛰기
cccskills
무료GitHub에 공개

android-device-debug

ADB-based RIPDPI device/emulator debugging: build/install/launch, logcat filtering, fixture port-forwarding, instrumented tests, crash/ANR triage. Use when debugging on a real device or emulator.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md9.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Android Device Debug

ADB-based debugging for the RIPDPI app on physical devices and emulators. No third-party tools -- uses only adb, Gradle, and existing repo scripts.

Full test stack documentation: docs/testing.md. Do not duplicate it here -- read it when you need runner details, CI lanes, or fixture locations.

Device Discovery & Connection

For local emulator work, first read Local Android emulator pool. Run the full investigation or test command under scripts/ci/android-avd-pool.py. Use its exported ANDROID_SERIAL throughout the lease. The discovery commands below do not grant ownership of an existing device.

adb devices -l                        # list connected devices/emulators
adb wait-for-device                   # block until a device is available

Multi-device disambiguation:

export ANDROID_SERIAL=<serial>        # all subsequent adb commands target this device
adb -s <serial> <command>             # one-off targeting

Build, Install & Launch

Build

# Physical device (ARM)
./gradlew :app:assembleGithubFullDebug -Pripdpi.localNativeAbis=arm64-v8a

# Emulator (x86_64 -- fast path)
./gradlew :app:assembleGithubFullDebug -Pripdpi.localNativeAbis=x86_64

Install

adb install -r app/build/outputs/apk/githubFull/debug/app-github-full-debug.apk

Launch with Automation Extras

Source of truth: app/src/main/kotlin/com/poyka/ripdpi/automation/AutomationLaunchContract.kt

adb shell am start -n com.poyka.ripdpi/.activities.MainActivity \
  --ez com.poyka.ripdpi.automation.ENABLED true \
  --ez com.poyka.ripdpi.automation.RESET_STATE true \
  --ez com.poyka.ripdpi.automation.DISABLE_MOTION true \
  --es com.poyka.ripdpi.automation.START_ROUTE home \
  --es com.poyka.ripdpi.automation.PERMISSION_PRESET granted \
  --es com.poyka.ripdpi.automation.SERVICE_PRESET idle \
  --es com.poyka.ripdpi.automation.DATA_PRESET clean_home

Deep link equivalent:

adb shell am start -a android.intent.action.VIEW \
  -d "ripdpi-debug://automation/launch?enabled=true&reset_state=true&start_route=home"

Automation Preset Values

ExtraValues
PERMISSION_PRESETgranted, notifications_missing, vpn_missing, battery_review
SERVICE_PRESETidle, connected_proxy, connected_vpn, live
DATA_PRESETclean_home, settings_ready, diagnostics_demo
START_ROUTEonboarding, home, config, diagnostics, history, logs, settings, mode_editor, dns_settings, advanced_settings, biometric_prompt, app_customization, about, data_transparency

Route source of truth: app/src/main/kotlin/com/poyka/ripdpi/ui/navigation/Route.kt

Logcat Filtering

Native logcat tags (from Rust source):

TagSource
ripdpi-nativeProxy engine + diagnostics (ripdpi-android crate)
ripdpi-tunnel-nativeVPN tunnel (ripdpi-tunnel-android crate)
# Native layer only
adb logcat -s ripdpi-native:V ripdpi-tunnel-native:V

# App process only (all tags)
adb logcat --pid=$(adb shell pidof com.poyka.ripdpi)

# Broad filter
adb logcat | grep -i ripdpi

# Crash buffer
adb logcat -b crash -d

# Clear buffer, then reproduce and capture
adb logcat -c
# ... reproduce the issue ...
adb logcat -d > android-logcat.txt

Port Forwarding for Local Network Fixture

The fixture exposes TCP/UDP/TLS echo, DNS responders, DoH, SOCKS5 relay, and fault injection.

# Start fixture on host
bash scripts/ci/start-local-network-fixture.sh

# Forward ports to device
adb reverse tcp:46090 tcp:46090   # control/health
adb reverse tcp:46001 tcp:46001   # TCP echo
adb reverse tcp:46003 tcp:46003   # TLS echo
adb reverse tcp:46053 tcp:46053   # DNS
adb reverse tcp:46054 tcp:46054   # DNS secondary

# Verify
curl -fsS http://127.0.0.1:46090/health
curl -fsS http://127.0.0.1:46090/manifest | jq .
adb reverse --list

Stop: bash scripts/ci/stop-local-network-fixture.sh

For physical devices set RIPDPI_FIXTURE_ANDROID_HOST=127.0.0.1 before starting the fixture.

Instrumented Tests on Device

# Full suite
./gradlew :app:connectedGithubFullDebugAndroidTest -Pripdpi.localNativeAbis=arm64-v8a

# Integration tests only
./gradlew :app:connectedGithubFullDebugAndroidTest -Pripdpi.localNativeAbis=arm64-v8a \
  -Pandroid.testInstrumentationRunnerArguments.package=com.poyka.ripdpi.integration

# E2E tests only
./gradlew :app:connectedGithubFullDebugAndroidTest -Pripdpi.localNativeAbis=arm64-v8a \
  -Pandroid.testInstrumentationRunnerArguments.package=com.poyka.ripdpi.e2e

# Single test class
./gradlew :app:connectedGithubFullDebugAndroidTest -Pripdpi.localNativeAbis=arm64-v8a \
  -Pandroid.testInstrumentationRunnerArguments.class=com.poyka.ripdpi.e2e.NativeTelemetryGoldenSmokeTest

# Maestro smoke flows
bash scripts/ci/run-maestro-smoke.sh

# Coverage report
./gradlew :app:createGithubFullDebugAndroidTestCoverageReport -Pripdpi.localNativeAbis=x86_64

Use -Pripdpi.localNativeAbis=x86_64 for emulator, arm64-v8a for physical device.

Screenshot & Screen Recording

# Screenshot
adb exec-out screencap -p > screenshot.png

# Screen recording (Ctrl+C to stop, max 3 min)
adb shell screenrecord /sdcard/recording.mp4
adb pull /sdcard/recording.mp4 .
adb shell rm /sdcard/recording.mp4

App State Inspection

# Package info (permissions, components, version)
adb shell dumpsys package com.poyka.ripdpi

# Running services
adb shell dumpsys activity services com.poyka.ripdpi

# VPN and network state
adb shell dumpsys connectivity

# DataStore / shared prefs
adb shell run-as com.poyka.ripdpi ls shared_prefs/

# App ops (battery optimization, etc.)
adb shell cmd appops get com.poyka.ripdpi

# Force stop
adb shell am force-stop com.poyka.ripdpi

# Clear all app data
adb shell pm clear com.poyka.ripdpi

Network Debugging

# Check VPN tunnel interface
adb shell ip addr show tun0

# Routing table (all tables -- VPN creates its own)
adb shell ip route show table all

# Listening sockets (proxy port)
adb shell ss -tlnp

# Active reverse forwards
adb reverse --list

# Remove all reverse forwards
adb reverse --remove-all

# DNS resolution
adb shell nslookup example.com

Crash & ANR Debugging

Java/Kotlin Crash

adb logcat -b crash -d
adb shell dumpsys dropbox --print | grep -A 20 data_app_crash

Native Crash (Rust)

# Tombstone summary
adb logcat -s DEBUG:E

# Full tombstone files (may need root)
adb shell ls /data/tombstones/

# Complete bug report
adb bugreport bugreport.zip

Symbolicate with NDK addr2line:

$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/*/bin/llvm-addr2line \
  -e native/rust/target/<triple>/debug/libripdpi.so <address>

Debug .so files with symbols are under native/rust/target/<triple>/debug/. The stripped copies in core/engine/build/generated/jniLibs/ lack symbols.

ANR

# Main thread state
adb shell dumpsys activity processes com.poyka.ripdpi

# ANR traces (may need root)
adb pull /data/anr/traces.txt

Common RIPDPI ANR cause: JNI call blocking the main thread. The proxy jniStart is intentionally blocking -- see the rust-jni skill.

Emulator Management

Read the required API, ABI, and image tag from the current CI or test lane. Use the local pool for repeated tests, screenshots, and UI inspection:

python3 scripts/ci/android-avd-pool.py status
python3 scripts/ci/android-avd-pool.py run \
  --api 37 --arch arm64-v8a --target google_apis --profile pixel_10_pro_xl \
  -- zsh

This example uses the host ARM64 image. Adjust it to the selected lane. Keep all device operations inside the leased shell. A busy pool is a reason to serialize work. Use the documented temporary mode only for a test-specific requirement; the wrapper owns creation, stop, and deletion. Use its cleanup dry run before authorized cleanup. See the pool document for complete lifecycle rules.

Quick Reference

TaskCommand
List devicesadb devices -l
Install debug APKadb install -r app/build/outputs/apk/githubFull/debug/app-github-full-debug.apk
Launch app (clean)adb shell am start -n com.poyka.ripdpi/.activities.MainActivity --ez com.poyka.ripdpi.automation.ENABLED true --ez com.poyka.ripdpi.automation.RESET_STATE true
Native logsadb logcat -s ripdpi-native:V ripdpi-tunnel-native:V
Screenshotadb exec-out screencap -p > screenshot.png
Forward fixture portsadb reverse tcp:46090 tcp:46090 (repeat for 46001, 46003, 46053, 46054)
Run integration tests./gradlew :app:connectedGithubFullDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.package=com.poyka.ripdpi.integration
Force stopadb shell am force-stop com.poyka.ripdpi
VPN interface checkadb shell ip addr show tun0
Crash logsadb logcat -b crash -d

See Also

  • rust-performance -- CPU flamegraphs with simpleperf, HWASan memory debugging, offline symbolication
  • network-traffic-debug -- mitmproxy SOCKS5 inspection, tcpdump on TUN, PCAPdroid, log correlation
  • rust-jni -- JNI exports, lifecycle rules, and native crash triage

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

RIPDPI's own Compose conventions: ViewModel pattern, Route/Screen split, DataStore->StateFlow, RipDpiThemeTokens. Use for how this app does Compose, not generic Compose API questions (see compose).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

po4yka/RIPDPI812026년 10월 19일 업데이트

RIPDPI Appium launch-contract reference: start routes and permission/service/data presets. Use when a test launches to the wrong screen or a new automation route is added. General flakiness: appium-test-debug.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

po4yka/RIPDPI812026년 10월 19일 업데이트

RIPDPI Appium test authoring: page objects, resource-id locators, assertions, wait tiers. Use when writing a new Appium test or page object, or adding coverage for a new screen.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

po4yka/RIPDPI812026년 10월 19일 업데이트

RIPDPI Appium failure triage: flaky tests, locator/session/wait issues, screenshot and element-tree debugging. Use when an Appium test fails or is flaky.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

po4yka/RIPDPI812026년 10월 19일 업데이트

Add or modify a GitHub Actions job. Use when editing a file under .github/workflows/. Not for running a workflow locally (local-ci-act) or release signing (release-signing).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

po4yka/RIPDPI812026년 10월 19일 업데이트

Conservative review of end-user legal exposure from diagnostics targets and probe hosts, by jurisdiction. Use when shipping or editing diagnostics target lists, probe hosts, or bootstrap endpoints.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

po4yka/RIPDPI812026년 10월 19일 업데이트

po4yka의 스킬 모두 보기

이 스킬의 문제 신고