Fastmonkey iOS Monkey Testing Tool: Setup, Configuration, and Usage Guide
This article introduces Fastmonkey, an open‑source iOS Monkey testing tool, outlines its key advantages, provides step‑by‑step environment setup, explains bundle‑id and runtime configuration, details optional and custom actions, and describes how to execute tests and view logs.
Fastmonkey is an open‑source iOS Monkey testing tool built on XCTestWD and swiftMonkey, offering a lightweight and efficient way to perform random UI actions on iOS applications.
Advantages: 1) No instrumentation required; 2) High efficiency with 4‑5 actions per second; 3) Minimal configuration and quick start.
Runtime environment setup: 1. Install Carthage: brew install carthage . 2. Install usbmuxd (for iproxy): brew install usbmuxd . 3. Clone the Fastmonkey repository from https://github.com/zhangzhao4444/Fastmonkey . 4. Navigate to the XCTestWD‑master directory and run carthage update --no-use-binaries to fetch dependencies. 5. Configure certificates and bundle identifier in the Fastmonkey project.
Project configuration: - Modify the bundle ID in server/XCTestWDMonkey.swift to match the target app. - Set the desired test duration (seconds) by editing elapsedTime in server/Controller/Monkey.swift . - Optional checks: enable or comment out addXCTestCheckCurrentApp (background/app exit detection) and addXCTestTapAlertAction (alert handling). - Choose which actions to include via addDefaultXCTestPrivateActions (e.g., element taps, random taps, long‑press, pinch, swipe, etc.).
Custom actions: To exclude a specific button (e.g., “Force Crash”), add a conditional check in addXCTestElementTapAction . Random tap points can be generated with randomPoint() , randomPointAvoidingPanelAreas() , or randomPoint(inRect: CGRect) , and tap areas can be limited by modifying the code in addXCTestTapAction .
Executing Fastmonkey: Install the target app on a physical iPhone, connect the device via USB, use iproxy for port mapping, select the XCTestWDUITests scheme, then run Product → Test . Test logs appear continuously in the Xcode log window.
Viewing logs: After the test finishes or is stopped, the log file path is displayed in the Xcode console; the logs can be opened with Visual Studio Code for analysis.
References: CSDN article , TesterHome discussion .
360 Quality & Efficiency
360 Quality & Efficiency focuses on seamlessly integrating quality and efficiency in R&D, sharing 360’s internal best practices with industry peers to foster collaboration among Chinese enterprises and drive greater efficiency value.
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.