The probe command is the user-defined readiness check. It runs before every project command when target.kind != local and is the gate the worker uses to refuse running probes against an unreachable target.
-
Read the current state.
python scripts/shared/target_runtime.py status
Show the user what is already configured.
-
Pick the execution mode. Ask:
Run commands locally, or via SSH to a remote host?
local — most game-RE work where the emulator runs on this machine.
ssh — when the build/test happens on a different host (rare in game-RE).
If ssh, gather ssh_host, remote_platform (posix|windows), remote_workdir, optional remote_python. Persist via:
python scripts/shared/target_runtime.py configure --mode=ssh --ssh-host=... --remote-platform=... --remote-workdir=...
-
Pick the target kind. Ask:
What is the runtime target for this repo's commands?
local — no emulator, no device, no specific window.
emulator — an emulator process this machine launches (LDPlayer, MuMu, BlueStacks, etc.).
device — an ADB-attached device (phone, emulator at a specific port, Frida session, raw bridge).
game_window — a specific desktop window identified by title or class.
-
Collect the kind-specific subobject.
For emulator:
python scripts/shared/target_runtime.py target set-emulator \
--name=ldplayer-9 \
--exec-path="C:/LDPlayer/LDPlayer9/dnplayer.exe" \
--arg=--instance --arg=0 \
--adb-port=5555 \
--probe-command="adb -s 127.0.0.1:5555 shell pidof com.YostarJP.BlueArchive"
For device:
python scripts/shared/target_runtime.py target set-device \
--id=127.0.0.1:5555 \
--kind=adb \
--transport=tcp \
--probe-command="adb -s 127.0.0.1:5555 get-state"
For game_window:
python scripts/shared/target_runtime.py target set-game-window \
--title-pattern=BlueArchive \
--pid-lookup-strategy=adb-focused-app \
--probe-command="adb shell dumpsys window windows | rg mCurrentFocus | rg BlueArchive"
For local:
python scripts/shared/target_runtime.py target set-local
-
Validate the probe. Run it once to make sure it works:
python scripts/shared/probe_target.py
Expect target=<kind> probe='<cmd>' exit=0. If non-zero, fix the probe before continuing.
-
Confirm.
python scripts/shared/target_runtime.py status
Show the user the resolved config and ask them to confirm before proceeding to other work.