Install
openclaw skills install @openlittlebear/pdd-android-adbAutomate end-to-end purchases on the Pinduoduo Android app via USB ADB using uiautomator2, RapidOCR, and a11y tree for search, spec selection, payment, and g...
openclaw skills install @openlittlebear/pdd-android-adbPDD-specific knowledge, workflows, and pitfalls, from a successful end-to-end purchase (2026-08-30, Realme RMX3350 1080x2400). App package: com.xunmeng.pinduoduo.
# venv (one-time, shared with 12306):
python3 -m venv ~/.openclaw/workspace/.venv-12306
~/.openclaw/workspace/.venv-12306/bin/pip install uiautomator2 rapidocr-onnxruntime opencv-python onnxruntime
PY=~/.openclaw/workspace/.venv-12306/bin/python
$PY -c "import uiautomator2 as u2; d=u2.connect(); d.app_start('com.xunmeng.pinduoduo')"
Same stack as 12306-android-adb: the OCR loop (ocr_bridge.py in appium-android-adb) for everything, a11y tree where screenshots fail. Appium is dead on Realme (WRITE_SECURE_SETTINGS blocked) — don't try it.
The search box may already hold text (PDD keeps the last query). Pasting over it concatenates — clear first, then clipboard + long-press 粘贴 (IME switching is blocked on Realme):
$PY ocr_bridge.py type 上海健生英语练习簿 --x 500 --y 180 # clears focused EditText, sets clipboard, long-presses
$PY ocr_bridge.py dump # find 粘贴
$PY ocr_bridge.py tap-text 粘贴 # paste
$PY ocr_bridge.py tap-text 搜索 # submit search
大英语簿【5本】¥5.9 / 20本装 — verify you're on the right quantity/size before proceeding.Verifying which chip is selected (OCR is ambiguous here):
img.getpixel) — the selected chip has a highlight border.selected="true":$PY ocr_bridge.py a11y-selected
screencap returns black/0-byte files. The a11y tree still works — it's the only eye here:$PY ocr_bridge.py a11y # page text + bounds
d.click per digit (user supplies the PIN), then check the tree again.PDD orders start as 拼团中 ("差1人"). The buyer can convert them directly:
$PY ocr_bridge.py a11y-tap 直接免拼 # click the button found in the a11y tree
Success state: 免拼成功 / 打包中 (seller packing). Report the order details (product, spec, price, shop, payment method) to the user.
OCR/a11y markers:
├─ search box + 搜索 → SEARCH — clear → paste → search
├─ 发起拼单 / 立即购买 → PRODUCT — tap to open spec panel
├─ spec chips + price → SPEC PANEL — select → verify a11y-selected
├─ PayConfirmActivity (a11y) → PAYMENT — PIN via pad clicks → fingerprint (user)
├─ 拼团中 / 差1人 → ORDER — a11y-tap 直接免拼
├─ 免拼成功 / 打包中 → SUCCESS — report
└─ unknown → OCR dump; on FLAG_SECURE pages use a11y
~/.cache/ocr-bridge) — see appium-android-adb for cleanup.ocr_bridge.py type clears by default.a11y/a11y-tap instead of OCR there.a11y-selected (selected="true"), optionally pixel-check borders with PIL.