
openatx/android-uiautomator-server-jar
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
github.com/openatx/uiautomator2 用
概要
UIAutomatorは、Android UIのテストを実行する素晴らしいツールですが、それを行うには、Javaコードを書き、コンパイルし、jarをインストールして実行する必要があります。 すべてのテスターのための複雑なステップです... このプロジェクトは、Androidデバイスで軽量なjsonrpcサーバーを構築することです。そのため、UIAutomatorテストを書くためにPCサイドスクリプトを書くことができます。 アンドロイドスタジオ → ビルド -> App Bundle/APK を作成 → ビルドAPK apk ファイルが app/build/outputs/apk/debug/app-debug.apk にあります。 ポートが提供されていない場合、デフォルトは9008です。 -h を使用して、すべてのオプションを確認します。 脚本自行行 adb フォワード tcp:9008 tcp:9008,非正規手动转. 方法定例文件 ツール/methods.json 由 AutomatorService.java 接口同封版 生成, 参数式, 出典例 AutomatorService.java 接口有新文字を解除し、修正方法, 同更新ツール/methods.json と同じ同期メソッドのスキル。
概要(AI 翻訳)
日本語 | English
目的
UIAutomatorは Android UIのテストを実行する素晴らしいツール, しかし、それを行うには, あなたはJavaを書く必要があります コード、コンパイル、jar をインストールし、実行します。 それはすべてのために複雑なステップです テスター…
このプロジェクトは、Androidデバイスで軽量のjsonrpcサーバーを構築することです。 PC 側のスクリプトを UIAutomator のテストに書き込むだけです。
ビルド方法
ビルドAPK
方法1:
[Android Studio→Build→[Build App Bundle/APK]→[[Build APK]]
方法2:
[app/build/outputs/apk/debug/app-debug.apk に apk ファイルが保存できるようになりました。
APKをインストール
アプリケーション ID は com.github.uiautomator2 です。 APKをインストールするには、バンドルされたAdbKeyboard入力メソッドを使用する必要があります。
起動ジャーサーバ
ポートが提供されていない場合、デフォルトは9008です。 -h を使用して、すべてのオプションが表示されます。
テストサーバー
##JSON-RPCテストツール
RPC メソッドを素早くデバッグ・検証するためのインタラクティブな JSON-RPC スクリプト。
スクリプトは自動的に adb forward tcp:9008 tcp:9008 を実行します。マニュアル転送は不要です。
tools/methods.json のメソッド定義は、[AutomatorService.java] インターフェイスから生成され、すべてのメソッドの名前、パラメータタイプ、説明、および例の値を含みます.
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
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)
推奨ツール
別のキーワードを試すか、フィルタを外してください。
インストール
npx skillfish add openatx/android-uiautomator-server-jar