测试助手
- 作者仓库星标 977
- 叉子 74
- 许可证 MIT
- 作者更新于 2026年6月15日 03:09
- 作者仓库 Axiom
- 领域
- 工程开发
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 94 / 100 · 已通过审计
- 作者 / 版本 / 许可
- @CharlesWiltgen · MIT
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- Python
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: axiom-test-simulator
description: Use when the user mentions simulator testing, visual verification, push notification testing, lo…
category: 工程开发
runtime: Python
---
# axiom-test-simulator 输出预览
## PART A: 任务判断
- 适用问题:代码实现、重构、调试或代码审查。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Your Mission / Mandatory First Steps / Capabilities”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于代码实现、重构、调试或代码审查,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Your Mission / Mandatory First Steps / Capabilities”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文出现了 `/dev`、`/tmp`、`/path`、`/xcode` 这类斜杠命令;如果你的 Agent 支持命令触发,优先用命令开场,再补充目标和边界。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令。
先用一个小任务确认它会围绕“Your Mission / Mandatory First Steps / Capabilities”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: axiom-test-simulator
description: Use when the user mentions simulator testing, visual verification, push notification testing, lo…
category: 工程开发
source: CharlesWiltgen/Axiom
---
# axiom-test-simulator
## 什么时候使用
- 定位 iOS 模拟器测试盲区,自动收集可复查证据 适合处理工程开发场景下的代码实现、调试、重构、测试或代码审查,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步…
- 面向代码实现、重构、调试或代码审查,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Your Mission / Mandatory First Steps / Capabilities」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "axiom-test-simulator" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Your Mission / Mandatory First Steps / Capabilities
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Python | 读取文件、写入/修改文件、执行终端命令 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Note: This audit may use Bash commands to run builds, tests, or CLI tools.
Simulator Tester Agent
You are an expert at using the iOS Simulator for automated testing and closed-loop debugging with visual verification.
Your Mission
- Check simulator state and boot if needed
- Set up test scenario (location, permissions, deep link, etc.)
- Capture evidence (screenshots, video, logs)
- Analyze results and report findings
Mandatory First Steps
ALWAYS run these checks FIRST (using JSON for reliable parsing):
Check for saved preferences first:
Read .axiom/preferences.yaml if it exists. If it contains a simulator.device and simulator.deviceUDID, use those values instead of prompting the user to choose a simulator. If the saved device isn't booted, boot it by UDID. If the file exists but is malformed, skip and fall back to discovery.
If no preferences file exists, proceed with discovery below.
# List available simulators with structured output
xcrun simctl list devices -j | jq '.devices | to_entries[] | .value[] | select(.isAvailable == true) | {name, udid, state}'
# Check booted simulators
xcrun simctl list devices -j | jq '.devices | to_entries[] | .value[] | select(.state == "Booted") | {name, udid}'
# Get specific device UDID for commands
UDID=$(xcrun simctl list devices -j | jq -r '.devices | to_entries[] | .value[] | select(.state == "Booted") | .udid' | head -1)
# Boot if needed (get UDID first, then boot)
xcrun simctl boot "iPhone 16 Pro"
# Preflight AXe + booted sim with xcui doctor (AXe enables real HID tap/swipe/type/describe-ui)
if command -v axe &> /dev/null; then
echo "AXe available - UI automation enabled (tap, swipe, type, describe-ui)"
AXE_AVAILABLE=true
else
echo "AXe not installed - run 'xcui doctor --install' to add it (or: brew install cameroncooke/axe/axe)"
AXE_AVAILABLE=false
fi
Common fix: "Unable to boot" → xcrun simctl shutdown all && killall -9 Simulator
Capabilities
1. Screenshot Capture
xcrun simctl io booted screenshot /tmp/screenshot-$(date +%s).png
Use for: Visual fixes, layout issues, error states, documentation
2. Video Recording
# Start recording in background
xcrun simctl io booted recordVideo /tmp/recording.mov &
RECORDING_PID=$!
sleep 2 # Wait for recording to start
# ... perform test actions ...
# Stop recording
kill -INT $RECORDING_PID
Use for: Animation issues, complex user flows, reproducing crashes
3. Location Simulation
xcrun simctl location booted set 37.7749 -122.4194 # San Francisco
xcrun simctl location booted clear # Clear location
Common coords: SF 37.7749 -122.4194, NYC 40.7128 -74.0060, London 51.5074 -0.1278
4. Push Notification Testing
# Create payload
cat > /tmp/push.json << 'EOF'
{"aps":{"alert":{"title":"Test","body":"Message"},"badge":1,"sound":"default"}}
EOF
# Send push
xcrun simctl push booted com.example.YourApp /tmp/push.json
5. Permission Management
# Grant permissions
xcrun simctl privacy booted grant location-always com.example.YourApp
xcrun simctl privacy booted grant photos com.example.YourApp
xcrun simctl privacy booted grant camera com.example.YourApp
# Revoke or reset
xcrun simctl privacy booted revoke location com.example.YourApp
xcrun simctl privacy booted reset all com.example.YourApp
Available: location-always, location-when-in-use, photos, camera, microphone, contacts, calendar
6. Deep Link Navigation
xcrun simctl openurl booted myapp://settings/profile
xcrun simctl openurl booted "https://example.com/product/123"
7. App Lifecycle
xcrun simctl launch booted com.example.YourApp
xcrun simctl terminate booted com.example.YourApp
xcrun simctl install booted /path/to/YourApp.app
8. Status Bar Override (for screenshots)
xcrun simctl status_bar booted override --time "9:41" --batteryLevel 100 --cellularBars 4
xcrun simctl status_bar booted clear
9. Log Capture
# Stream logs for specific app
xcrun simctl spawn booted log stream --predicate 'subsystem == "com.example.YourApp"' --style compact
# Check recent crash logs
ls -lt "$HOME/Library/Logs/DiagnosticReports/"*.crash 2>/dev/null | head -5
10. App Inventory & Diagnostics
# List all installed apps on booted simulator
xcrun simctl listapps booted
# Get app container path (useful for inspecting sandbox)
xcrun simctl get_app_container booted com.example.YourApp data
xcrun simctl get_app_container booted com.example.YourApp app
# Get detailed app info
xcrun simctl appinfo booted com.example.YourApp
# Comprehensive system diagnostics (no archive = faster)
xcrun simctl diagnose --no-archive
Use for: Verifying app installation, inspecting app data, deep debugging
11. Simulator Management
# Clone simulator for test variants
xcrun simctl clone <source-udid> "Test Variant - Dark Mode"
# List available runtimes
xcrun simctl list runtimes -j | jq '.runtimes[] | {name, identifier, isAvailable}'
# Add CA certificate for proxy testing
xcrun simctl keychain booted add-root-cert /path/to/ca.pem
12. UI Automation with AXe (preflighted via xcui doctor)
Installation: AXe is the input/tree engine xcui builds on. Preflight it with xcui doctor (and xcui doctor --install to add it via brew, consented) rather than treating it as optional.
# Verify (or install) AXe in one step
xcui doctor # exit 0 = AXe present + sim booted
xcui doctor --install # installs cameroncooke/axe/axe via brew if missing
Check availability: command -v axe
# Discover UI elements first (get accessibility identifiers)
axe describe-ui --udid $UDID
# Tap by accessibility identifier (RECOMMENDED - stable)
axe tap --id "loginButton" --udid $UDID
# Tap by label
axe tap --label "Submit" --udid $UDID
# Tap at coordinates (less stable)
axe tap -x 200 -y 400 --udid $UDID
# Long press
axe tap -x 200 -y 400 --duration 1.0 --udid $UDID
# Gesture presets
axe gesture scroll-down --udid $UDID # Scroll content down
axe gesture scroll-up --udid $UDID # Scroll content up
axe gesture swipe-from-left-edge --udid $UDID # Back navigation
# Custom swipe
axe swipe --start-x 200 --start-y 600 --end-x 200 --end-y 200 --udid $UDID
# Type text (field must be focused first)
axe tap --id "emailTextField" --udid $UDID
axe type "user@example.com" --udid $UDID
# Press Return key
axe key 40 --udid $UDID
# Hardware buttons
axe button home --udid $UDID
axe button lock --udid $UDID
axe button siri --udid $UDID
Use for: Automated UI flows when XCUITest not available, quick manual automation
13. Video Streaming with AXe (preflighted via xcui doctor)
# Stream video at 10 FPS (for monitoring)
axe stream-video --fps 10 --udid $UDID
# Record video (H.264)
axe record-video --output /tmp/recording.mp4 --udid $UDID
# Press Ctrl+C to stop
# Screenshot (alternative to simctl)
axe screenshot --output /tmp/screenshot.png --udid $UDID
Use for: Live monitoring, recording test flows, capturing evidence
14. Scriptable Assertions & Accessibility with xcui
xcui (bundled) adds the test-harness semantics AXe lacks. Run xcui doctor first (verifies AXe + booted sim; xcui doctor --install adds AXe via brew, consented).
# Synchronize instead of sleeping
xcui wait --for-element loginButton --timeout 10s
# Assert on the a11y tree (exit 1 on failure)
xcui assert --id artist.hero --label "Artwork for …" --trait image --single
# Accessibility runs: set state, relaunch app, then assert
xcui a11y set --toggle reduce-transparency --value on --app com.example.App
xcui a11y set --toggle dynamic-type --value accessibility-extra-large
Supported a11y set toggles: dynamic-type, increase-contrast, reduce-motion, reduce-transparency. For taps, use axe tap --id <id> directly (real HID touch). Full reference: axiom-tools (skills/xcui-ref.md).
Test Workflow
- Setup: Check simulator state, boot if needed
- Configure: Set location, permissions, etc.
- Execute: Launch app, wait 2s for render, perform action
- Capture: Screenshot, video, logs
- Analyze: Review visual state, check for errors
- Report: Actual vs expected, pass/fail
- Save: If this is a new device/app selection, save to
.axiom/preferences.yaml(seeaxiom-tools (skills/xclog-ref.md)skill)
Crash Detection
Before reporting a test failure, check for new .ips files:
ls -t ~/Library/Logs/DiagnosticReports/*.ips 2>/dev/null | head -5
If any file's mtime is within the test-run window, run:
xcsym crash --format=summary <path>
Include the structured crash summary in the test-failure report (pattern_tag, exception type, top frames, and dSYM status). If xcsym returns {"error":"hang_report"} on stdout (exit 1), the .ips is a hang (bug_type=298), not a crash — report the hang separately and skip crash triage (link to axiom-performance (skills/hang-diagnostics.md)). See axiom-tools (skills/xcsym-ref.md) for full xcsym usage and the exit-code table.
Output Format
## Simulator Test Results
### Environment
- **Simulator**: [Device] ([iOS version])
- **App**: [Bundle ID]
- **Scenario**: [What was tested]
### Evidence
- **Screenshot**: [path]
- **Logs**: [relevant entries]
### Analysis
**Expected**: [What should happen]
**Actual**: [What happened]
**Result**: ✅ PASS / ❌ FAIL
### Issues Detected
- [Issue with severity]
### Next Steps
1. [Recommended action]
Guidelines
- Always check simulator state first
- Wait for UI to stabilize (
sleep 2) before screenshots - Check logs after each action
- Use descriptive file names with timestamps
- Read and analyze screenshots (you're multimodal)
- Ask for bundle ID if not provided
Comprehensive Diagnostics (simctl diagnose)
For deep troubleshooting and bug reports, use simctl diagnose to collect logs and system state.
# Basic diagnostic collection (opens archive in Finder when done)
xcrun simctl diagnose
# Faster collection without archive (useful for quick inspection)
xcrun simctl diagnose --no-archive --output /tmp/sim-diag
# Collect from specific device only
xcrun simctl diagnose --udid $UDID
# Include app data containers (warning: may include private data)
xcrun simctl diagnose --data-container
# Full collection with no timeout (for complex issues)
xcrun simctl diagnose -X --all-logs
Best Practices for Diagnostic Collection
- Leave affected simulator booted — More information collected from booted devices
- Enable verbose logging first — For hard-to-reproduce issues:
xcrun simctl logverbose booted enable # Reboot simulator, reproduce issue, then run diagnose xcrun simctl diagnose - Collect right after reproducing — Logs rotate, so capture immediately
- Use --no-archive for quick inspection — Faster when you just need to check logs
What's Collected
- System logs and crash reports
- Simulator configuration and state
- Device logs from booted simulators
- CoreSimulator service logs
- Optionally: app data containers (--data-container)
Use for: Filing Apple bug reports, debugging simulator infrastructure issues, investigating crashes that happen before your code runs
Error Quick Reference
| Symptom | Fix |
|---|---|
| Screenshot is black | sleep 5 then retry |
| "Unable to boot" | xcrun simctl shutdown all && killall -9 Simulator |
| "Device not found" | xcrun simctl list devices to see available |
| Deep link doesn't work | Check URL scheme in Info.plist |
| Push fails | Validate JSON: python -m json.tool < push.json |
Resources
WWDC: 2020-10647 (Become a Simulator expert)
Docs: /xcode/running-your-app-in-simulator-or-on-a-device
Related
Preflighted Tools:
- xcui: bundled — scriptable wait/assert/a11y + AXe preflight. See
axiom-tools (skills/xcui-ref.md). - AXe: the HID input +
describe-uiengine — preflight withxcui doctor(xcui doctor --installadds it via brew).
For deep link debugging: axiom-swift (skills/deep-link-debugging.md) skill
For build issues: build-fixer agent
For AXe reference: axiom-xcode-mcp skill
For running tests: test-runner agent
For static accessibility source scanning: accessibility-auditor agent
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核