Bulk Actions — Create & Use JSON Configs
How to create a Bulk Actions JSON config, load it in the app, and run it via ADB.
1. Create a JSON Config
A config is a JSON file with two parts: an optional header and a required run object.
Minimal config
{
"output-file": "~/blkacts_single_ping_success.txt",
"run": {
"ping_google": "ping -c 2 google.com"
}
}Config header fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
output-file | string | No | — | Path where results are saved after execution. ~ expands to the app's private directory. |
output-as-csv | string | No | "false" | Set to "true" for CSV output instead of the plain text report. |
timeout | integer | No | 30 | Per-command timeout in seconds. Overridden by inline -t N. |
url-proxypac | string | No | — | PAC URL for proxy routing (applies to checkcert and google-timesync). |
file-proxypac | string | No | — | PAC file path for proxy routing (mutually exclusive with url-proxypac). |
log-proxy | boolean | No | — | When true, overrides the global proxy logging setting. |
The run object
A map of command names (any string key) to command strings:
{
"run": {
"ping-google": "ping -c 4 google.com",
"dig-cloudflare": "dig @1.1.1.1 example.com",
"wait": "sleep 5",
"port-scan": "port-scan -p 80,443 google.com"
}
}Supported commands
| Prefix | Example | Description |
|---|---|---|
ping | ping -c 4 google.com | ICMP ping |
dig | dig @8.8.8.8 google.com | DNS lookup |
ntp | ntp pool.ntp.org | NTP time query |
port-scan | port-scan -p 80,443 google.com | TCP port scan |
checkcert | checkcert -p 443 google.com | HTTPS certificate check |
device-info | device-info | Device identity info |
tracert | tracert -t 20 google.com | Traceroute |
google-timesync | google-timesync | Google Time Sync |
lan-scan | lan-scan | LAN device discovery |
sleep | sleep 5 | Coroutine delay (1–3600s) |
Unknown prefixes fall through to raw shell execution.
Timeout precedence
Highest → lowest:
- Inline
-t Nin the command string - Config-level
"timeout"field - Default 30 seconds
Output file paths
| Path format | Example | Expands to |
|---|---|---|
~/path/to/file.txt | ~/blkacts_output.txt | App private dir: /data/user/0/<pkg>/files/blkacts_output.txt |
~/subdir/file.txt | ~/files/output.txt | App private dir + subdir: /data/user/0/<pkg>/files/files/output.txt |
/abs/path/file.txt | /sdcard/Download/out.txt | Absolute path (SAF path — may require write permission) |
2. Use in the App UI
Open the app → navigate to Bulk Actions (under More):
- Tap Load JSON Config → select your JSON file from the SAF picker
- The config is parsed and validated — command count, timeout, and output file status are displayed
- Tap Run All Commands → commands execute sequentially with live progress
- Results are auto-saved to
output-fileif defined (green card shows the path)
Optional:
- Toggle CSV output to export results in CSV format (persisted preference)
- Tap Write to File to save results manually to a custom location via SAF picker
3. Use via ADB (Manual)
Three-step pattern for headless execution:
Step 1 — Push config
APP_ID="io.github.mobilutils.ntp_dig_ping_more"
PRIVATE_DIR="/data/user/0/$APP_ID/files"
cat blkacts_single_ping_success.json \
| adb shell "run-as $APP_ID sh -c 'cat > $PRIVATE_DIR/blkacts_single_ping_success.json'"Step 2 — Launch with auto-run
# IMPORTANT: use --ez (boolean), NOT --es (string)
adb shell am force-stop "$APP_ID"
adb shell am start \
-n "$APP_ID/.MainActivity" \
-d "file://$PRIVATE_DIR/blkacts_single_ping_success.json" \
--ez auto_run trueStep 3 — Pull results
sleep 60 # adjust based on your config timeout
adb shell "run-as $APP_ID cat $PRIVATE_DIR/blkacts_single_ping_success.txt" \
> ./test-results/output.txtKey rules:
- Use
run-aspipe (cat file \| adb shell "run-as ... sh -c 'cat > path'") —adb pushcannot write to app private dir - Use
--ez auto_run true(boolean extra) —--es auto_run truepasses a String and the app won't auto-run - Use
run-as catto pull results —adb pullcannot read from app private dir
4. Use via Automation Script
For batch/CI execution, use the provided script:
# Single config (default emulator)
./scripts/BULKACTIONS-ADB-SCRIPT.sh -f blkacts_single_ping_success.json
# Real device mode (no emulator)
./scripts/BULKACTIONS-ADB-SCRIPT.sh -f blkacts_multi_all9_success.json --real-device --no-interact
# Absolute path to config
./scripts/BULKACTIONS-ADB-SCRIPT.sh -f ~/Downloads/my-config.json --no-interactThe script handles emulator management, file push/pull, execution polling, and result collection automatically.