Asi onesec-wda
Automate "one sec" app-blocking setup on iOS via Shortcuts automations using WebDriverAgent (WDA). Use when the user wants to bulk-configure one sec for multiple apps on a connected iPhone.
install
source · Clone the upstream repo
git clone https://github.com/plurigrid/asi
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/plurigrid/asi "$T" && mkdir -p ~/.claude/skills && cp -r "$T/plugins/asi/skills/onesec-wda" ~/.claude/skills/plurigrid-asi-onesec-wda && rm -rf "$T"
manifest:
plugins/asi/skills/onesec-wda/SKILL.mdsource content
one sec WDA Automation
Bulk-create iOS Shortcuts automations that trigger "one sec" when apps are opened, driven by WebDriverAgent.
Prerequisites
- iPhone connected via USB with developer mode enabled
- WebDriverAgent running via xcodebuild:
xcodebuild test-without-building \ -xctestrun <path-to>/WebDriverAgentRunner_iphoneos*.xctestrun \ -destination id=<DEVICE_UDID> \ -allowProvisioningUpdates - WDA accessible at
(usehttp://localhost:8100
+ port forward if needed)pymobiledevice3 remote start-tunnel - one sec app installed on the device with Shortcuts integration enabled
Usage
# Test with one app first python3 /path/to/onesec_setup.py --test # Run for all apps python3 /path/to/onesec_setup.py
The script is at:
<skill-dir>/scripts/onesec_setup.py
Workflow per App
- Tap "+" on Shortcuts Automation tab
- Select "App" trigger
- Search for and select the target app
- Confirm "Is Opened" trigger, tap Done
- Search for "one sec" action
- Select "Activate one sec (when app opens)"
- Tap Done to save
Screenshots are saved to
/tmp/onesec_step* and /tmp/onesec_fail* for debugging.
Customization
Edit
APPS_TO_PROTECT list in the script. Move completed apps to ALREADY_DONE to skip them on re-runs.
WDA Helpers
The script provides reusable WDA functions (no pip dependencies):
— raw HTTP to WDAwda(method, path, data)
/find(using, value)
— element lookupfind_one(using, value)
/tap(element_id)
/tap_name(name)
— tap elementstap_label(label)
— type into active elementtype_text(text)
— drag gestureswipe(x1, y1, x2, y2)
— save screenshot as PNGscreenshot(path)
Troubleshooting
- WDA connection refused: Ensure xcodebuild test is running and port 8100 is reachable
- pymobiledevice3 tunnel timeout: Restart tunnel with
sudo pymobiledevice3 remote start-tunnel - Element not found: Check screenshots in
to see actual UI state/tmp/onesec_fail_* - App not in picker: App name must match exactly as shown on device home screen