English | 中文
Auto Fish is an Android device control service with a deterministic CLI client (af).
Download and install the latest APK from GitHub Releases:
https://github.com/memohai/Auto-Fish/releases
Open the app, then:
- Enable accessibility permission for Auto Fish.
- In Home page, turn on Service.
- Note the service connection info shown in app:
- Device IP
- Port
- Token
npm i -g @memohjs/afThen verify:
af --helpSet environment variables:
export AF_URL="http://<DEVICE_IP>:<PORT>"
export AF_TOKEN="<TOKEN>"
export AF_DB="./af.db"Run first commands:
af health
af observe top
af observe screen --max-rows 80 --fields id,text,desc,resId,flags
af observe refs --max-rows 80
af act tap --x 540 --y 1200
af act tap --by text --value "Settings"If you want to build APK or CLI from source, prepare:
- JDK 17
- Android SDK (with
adb) - Rust toolchain (
cargo) just
Recommended environment:
ANDROID_HOMEpoints to your Android SDK path
Local source build example:
just build
just install
cd cli
cargo build --releaseaf observe screenshot --annotate --max-marks 120
af act swipe 100,1200,900,1200 --duration 300
af act tap --by resid --value "com.android.settings:id/title" --exact-match
af observe refs --max-rows 120
af act tap --by ref --value @n3
af verify text-contains --text "Settings"
af verify node-exists --by text --value "Settings"
af recover back --times 2Notes:
- If
AF_URLorAF_TOKENis not set, pass--url/--tokenexplicitly. - Command output is JSON (single line per command).
just check
just build
cd cli && cargo testMore docs: