yuxiaole-bili/dsh-apk-vm ↗★ 1

dsh-apk-vm

Local AOSP Android VM for DeepSeek Harness: preview rooted APKs at up to 60 fps, automate UIAutomator flows, and give each Agent an isolated VM. 适合需要进行安卓APK预览、UI自动化测试及沙箱运行的开发者。

패키지
dsh-apk-vm
호환성
미검증
버전
0.3.13
라이선스
Apache-2.0
최근 업데이트
2026. 10. 25.

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:yuxiaole-bili/dsh-apk-vm

Configuration

All keys are optional; defaults are shown in the Default column.

KeyDefaultPurpose
emulatorPathauto-detectedPath to the Android emulator executable. Auto-discovered from the SDK / PATH.
avdName—AVD name to spawn. Required to spawn an AVD.
serial—Attach this adb serial instead of spawning an emulator.
port5558Emulator console port used when spawning.
sdkRootANDROID_HOME / ANDROID_SDK_ROOTAndroid SDK root for adb, aapt2, emulator-check, sdkmanager/avdmanager.
adbPath/platform-tools/adbExplicit adb executable.
systemImagesystem-images;android-34;default;x86_64System image required by the Environment card and used for AVD creation.
spawnEmulatortrueSet false to only attach (never spawn).
emulatorArgs[]Extra argv appended to the emulator command line.
roots[]Extra APK discovery roots. The DSH working directory, process.cwd() and the home directory are added automatically.
bootTimeoutMs1200000Max wait for the guest to report sys.boot_completed=1.
gpuModehosthost uses the real GPU; swiftshader_indirect is the software fallback for headless hosts.
accelautoauto detects AEHD/WHPX/KVM/HAXM/HVF; on/off force the decision.
requireAcceltrueFail fast with an explicit error when no hypervisor is found, instead of booting forever under TCG.
quickBoottrueRestore the saved AVD snapshot when present; false adds -no-snapshot.
snapshotNamedefault_bootSnapshot name to load/save.
saveSnapshotAfterBoottrueSave a snapshot after the first successful cold boot.
prewarmfalseBoot the VM in the background shortly after plugin activation.
prewarmDelayMs3000Delay before the prewarm start.
autoStarttrueStart the VM on the first /apk-vm/state or /apk-vm/frame request.
multiInstancetrueAllow isolated extra VMs for concurrent Agents.
maxInstances3Maximum number of extra instances (in addition to the default VM). Each running instance costs guest RAM/CPU.
instanceIdleMs900000Stop an extra instance after this long without panel frames, a video client, or an Agent command (AVD is kept).
instanceReapIntervalMs60000How often the idle reaper checks extra instances.
allowRemotefalseAllow non-loopback clients to reach /apk-vm/* and /apk-vm/ws (only behind your own authenticated proxy).
allowSetupDownloadsfalseAllow the Environment card's install-image action to run sdkmanager --install (large download).
frameFps2PNG fallback target frame rate, 1–10 (the H.264 path is not affected).
scrcpytrueEnable the H.264/WebCodecs transport.
scrcpyMaxSize960Encoder max size; 960 yields 540×960 video.
scrcpyMaxFps60Encoder frame-rate cap, 1–60.
scrcpyBitrate6000000Video bitrate in bits/s.
scrcpyPort27183Local adb-forward port for the scrcpy server tunnel.
scrcpyJarPathvendored JAROverride the scrcpy server JAR path.

The Environment report (GET /apk-vm/setup) returns ok, platform, sdkRoot, adbPath, emulatorPath, avdmanagerPath, sdkmanagerPath, emulatorVersion, systemImage + systemImagePresent, avdName + avdPresent + avdPath, accel { available, backend, detail }, hypervisorNotes, missing[] and actions[] with per-action availability.


Quick boot fails: "different AVD configuration", black screen, or no snapshot

  • The snapshot is only valid for the AVD configuration that created it. After changing the AVD (API level, ABI, resolution, GPU mode, -writable-system, …) delete the old snapshot and let the plugin create a new one: remove ~/.android/avd/.avd/snapshots/ (on Windows, %USERPROFILE%\.android\avd\.avd\snapshots\), then start cold again.
  • A snapshot directory with ram.img but no snapshot.pb is not a valid snapshot; the plugin ignores it. Delete it or set quickBoot: false once to force a clean cold boot.
  • If a stale offline adb emulator is attached, adb kill-server (or kill the leftover emulator/qemu-system-* process) and retry.