OA

openatx/android-uiautomator-server-jar

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

21 stars 품질 60 트렌드 30MIT

github.com/openatx/uiautomator2에 대 한

개요

UIAutomator는 Android UI 테스트를 수행하는 훌륭한 도구이지만 java 코드를 작성해야하며 jar를 설치하고 실행합니다. 모든 테스터의 복잡한 단계입니다. 이 프로젝트는 Android 기기에서 경량 jsonrpc 서버를 구축하는 것입니다. UIAutomator 테스트를 작성하려면 PC 측 스크립트를 작성할 수 있습니다. 안드로이드 스튜디오 -> 빌드 -> 앱 번들/APK -> 빌드 APK 지금 APK 파일은 app/build/outputs/apk/debug/app-debug.apk에서 찾을 수 있습니다 포트가 제공되지 않으면 기본값은 9008입니다. use -h 모든 옵션을 볼 수 있습니다. 脚行 adb 앞으로 tcp:9008 tcp:9008,,。 方定法文文件 tools/methods.json UI AutomatorService.java 口 Auto生成,,有方法的名鶏、和、和和和。 当 AutomatorService.java 号口有新鶏、 方法世界,使 sync-methods 기술 新新 도구/methods.json。

개요(AI 번역)

한국어 |

목적

UIAutomator는 Android UI 테스트를 수행 할 수있는 훌륭한 도구이지만, 그것을 수행하려면 java를 작성해야합니다. 코드, 컴파일, jar를 설치, 실행. 그것은 모든 것을 위한 복잡한 단계입니다 테스터 …

이 프로젝트는 Android 기기에서 경량 jsonrpc 서버를 구축하는 것입니다. UIAutomator 테스트를 작성하려면 PC 측 스크립트를 작성할 수 있습니다.

건설하는 방법

빌드 APK

방법 1:

Android Studio -> Build -> [T2]] -> [T3]]

방법 2:

지금 APK 파일은에서 찾을 수 있습니다 app/build/outputs/apk/debug/app-debug.apk

APK 설치

신청 ID는 com.github.uiautomator2입니다. APK를 설치하면 번들 된 AdbKeyboard 입력 방법을 사용해야합니다.

실행 항만 서버

포트가 제공되지 않으면 기본값은 9008입니다. 사용 -h 모든 옵션을 볼 수 있습니다.

테스트 서버

JSON-RPC 테스트 도구

빠른 디버깅 및 RPC 방법을 검증하기위한 Interactive JSON-RPC 스크립트.

스크립트 실행 adb forward tcp:9008 tcp:9008 자동적으로, 수동 전달 필요 없음.

tools/methods.json]의 방법 정의는 AutomatorService.java] 인터페이스에서 생성되며, 각 방법의 이름, 매개 변수 유형, 설명 및 예값을 포함하여 생성됩니다.

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

English | 简体中文

Purpose

UIAutomator is a great tool to perform Android UI testing, but to do it, you have to write java code, compile it, install the jar, and run. It’s a complex steps for all testers…

This project is to build a light weight jsonrpc server in Android device, so that we can just write PC side script to write UIAutomator tests.

How to build

Build APK

Method 1:

In Android Studio -> Build -> Build App Bundle/APK -> Build APK

Method 2:

./gradlew assembleDebug

Now apk file can be found in app/build/outputs/apk/debug/app-debug.apk

Install APK

adb install -r app/build/outputs/apk/debug/app-debug.apk

The application ID is com.github.uiautomator2. Installing the APK is required to use the bundled AdbKeyboard input method.

Launch Jar server

adb push app/build/outputs/apk/debug/app-debug.apk /data/local/tmp
adb shell CLASSPATH=/data/local/tmp/app-debug.apk app_process / com.github.uiautomator2.Console [-p port]

If no port is provided, it defaults to 9008. Use -h to see all options.

Test server

adb forward tcp:9008 tcp:9008
curl -X POST -d '{"jsonrpc": "2.0", "id": "1f0f2655716023254ed2b57ba4198815", "method": "deviceInfo", "params": {}}' 'http://127.0.0.1:9008/jsonrpc/0'
# Expect output like
{'currentPackageName': 'com.smartisanos.launcher',
 'displayHeight': 1920,
 'displayRotation': 0,
 'displaySizeDpX': 360,
 'displaySizeDpY': 640,
 'displayWidth': 1080,
 'productName': 'surabaya',
 'screenOn': True,
 'sdkInt': 23,
 'naturalOrientation': True}

JSON-RPC Test Tool

Interactive JSON-RPC script for quickly debugging and verifying RPC methods.

# Interactive mode (pick a method from categorized menus, enter params, see results)
python3 tools/test_jsonrpc.py

# Direct invocation
python3 tools/test_jsonrpc.py ping
python3 tools/test_jsonrpc.py click 100 200
python3 tools/test_jsonrpc.py dumpWindowHierarchy false

The script runs adb forward tcp:9008 tcp:9008 automatically, no manual forwarding needed.

Method definitions in tools/methods.json are generated from the AutomatorService.java interface, including the name, parameter types, description and example values of every method.

Sync methods.json

Whenever a method in AutomatorService.java is added, removed or changed, use the sync-methods skill to update tools/methods.json.

Ask the AI in opencode:

sync methods

The AI will parse the Java sources → extract every method → generate methods.json → validate the JSON.

The skill lives at .opencode/skills/sync-methods/SKILL.md. It is entirely AI driven and needs no extra scripts.

AdbKeyboard (ATX Keyboard)

GitHub에서 전체 README 보기

추천 도구

다른 키워드를 입력하거나 필터를 제거해 보세요.

설치

npx skillfish add openatx/android-uiautomator-server-jar
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →