How I Built an AI‑Powered iOS Automation Test Suite in One Afternoon (Step‑by‑Step Guide)
This article walks through setting up an AI‑driven iOS automation testing pipeline using CoPaw with a multimodal model, an iOS simulator Skill, and an iPhone 17 simulator, covering environment preparation, required dependencies, skill installation, and two real‑world test cases.
Solution Overview
Implementation combines three components:
CoPaw (or compatible multimodal model) – language model that can process screenshots (e.g., Kimi 2.6).
iOS simulator Skill – a skill that translates high‑level intents into simctl / idb commands for the iOS simulator.
iPhone 17 simulator on macOS – execution host; a real device can be substituted.
Environment Setup
1. Install iOS simulator Skill
Download the skill package from the Cocoloop skill store ( https://hub.cocoloop.cn/). If the domain https://dl.cocoloop.cn/ is unreachable, install the Molili agent ( https://www.molili.com.cn) and use its built‑in installer.
# Install Cocoloop manager
curl -L https://dl.cocoloop.cn/cocoloop-main.zip -o cocoloop.zip
unzip cocoloop.zip -d ~/.cocoloop
# Install iOS‑simulator skill
curl -L https://dl.cocoloop.cn/bss/skills/ios-simulator.zip -o ios-simulator.zip
unzip ios-simulator.zip -d ~/.cocoloop/skills2. Install UI‑automation dependencies
macOS with Xcode Command Line Tools (install or update with
sudo rm -rf /Library/Developer/CommandLineTools && sudo xcode-select --install)
Add Meta’s Homebrew tap: brew tap facebook/fb Install idb-companion and the Python library fb-idb:
brew install idb-companion
python3 -m pip install --upgrade fb-idbPython 3.12 is recommended to avoid compatibility issues.
3. Install iOS simulator runtimes
Open Xcode → Preferences → Components and download the required iOS runtime images for the target device version.
iOS Simulator Skill Details
The skill wraps simctl and idb to provide:
Simulator lifecycle: create, boot, shutdown, erase, delete
App management: install, uninstall, launch, terminate
UI automation via accessibility tree: find, tap, type
Screenshot and screen‑recording
Privacy permission control
Push‑notification simulation
Basic usage examples:
# Health check
node skills/tristanmanchester-ios-simulator/scripts/ios-sim.mjs health
# List simulators
node skills/tristanmanchester-ios-simulator/scripts/ios-sim.mjs list
# Select and boot a default simulator (e.g., iPhone 16)
node skills/tristanmanchester-ios-simulator/scripts/ios-sim.mjs select --name "iPhone" --runtime "iOS" --bootAutomation Test Cases
Case 1 – Safari Baidu Search
Using the iOS‑simulator skill, open Safari on the iPhone 17 simulator, navigate to https://www.baidu.com, and search for “TestHub”. The AI agent consumes tokens to invoke the skill, open the URL, and perform the search. The process succeeds once the prompt is clear.
Case 2 – TestHub Smoke Test & H5 Compatibility
Goal: verify top‑menu navigation on https://testhub.aisky.cloud/ and ensure H5 pages render correctly. The AI initially missed the hamburger menu required to reveal hidden buttons; after refining the prompt a few times, it successfully traversed all menu items, captured screenshots, and produced a final test report.
Conclusion
The workflow demonstrates that AI‑assisted iOS automation is feasible with minimal manual setup. Alternatives such as writing a real‑device skill or converting the workflow to an Appium‑based skill are possible, but the core idea remains: combine a powerful language model, a multimodal perception layer, and a skill that translates high‑level intents into simulator commands.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
