Add your description here
Project description
iOS Device Control (chuk-mcp-ios)
Comprehensive iOS device control system supporting both simulators and real devices. Available as both a standalone CLI tool and MCP (Model Context Protocol) server.
Features
- Unified Device Management: Control both iOS simulators and real devices through a single interface
- Session Management: Create and manage device sessions for organized automation
- App Management: Install, launch, and manage iOS applications
- UI Automation: Tap, swipe, type, and interact with device UI
- Media & Location: Add photos/videos, simulate GPS locations
- Debugging: Access logs, crash reports, and debugging tools
- MCP Server: Use with AI assistants via Model Context Protocol
- CLI Tool: Standalone command-line interface for direct control
Requirements
For Simulators
- macOS with Xcode installed
- Xcode Command Line Tools (
xcode-select --install)
For Real Devices (Optional)
- iOS device with developer mode enabled
- Valid Apple Developer account (for app installation)
- One or more of:
idb(Facebook's iOS Development Bridge)devicectl(Xcode 15+)instruments(Legacy Xcode tool)
Installation
# Clone the repository
git clone https://github.com/yourusername/chuk-mcp-ios.git
cd chuk-mcp-ios
# Install in development mode
pip install -e .
# Or install from PyPI (when published)
pip install chuk-mcp-ios
Quick Start
CLI Usage
# Check system status
ios-control status
# List available devices
ios-control device list
# Quick start with auto-setup
ios-control quick-start
# Create a session
ios-control session create --device "iPhone 15"
# Take a screenshot
ios-control ui screenshot SESSION_ID -o screenshot.png
# Launch an app
ios-control app launch SESSION_ID com.apple.Preferences
MCP Server Usage
- Start the MCP server:
ios-mcp-server
-
Configure your AI assistant to connect to the MCP server
-
Use natural language commands:
- "Take a screenshot of the current screen"
- "Launch the Settings app"
- "Set location to San Francisco"
Python API Usage
from chuk_mcp_ios.core.device_manager import UnifiedDeviceManager
from chuk_mcp_ios.core.session_manager import UnifiedSessionManager
from chuk_mcp_ios.core.ui_controller import UnifiedUIController
# Initialize managers
device_manager = UnifiedDeviceManager()
session_manager = UnifiedSessionManager()
ui_controller = UnifiedUIController()
# Create a session
session_id = session_manager.create_automation_session()
# Take a screenshot
ui_controller.take_screenshot(session_id, "screenshot.png")
# Tap at coordinates
ui_controller.tap(session_id, 100, 200)
# Clean up
session_manager.terminate_session(session_id)
Examples
Run Quick Demo
# Basic demo
python -m chuk_mcp_ios.examples.quick_demo
# Interactive demo
python -m chuk_mcp_ios.examples.quick_demo --interactive
Automation Example
from chuk_mcp_ios.examples.automation_demo import AutomationDemo
demo = AutomationDemo()
demo.run_test_scenario()
Architecture
├── core/ # Core functionality (device-agnostic)
├── devices/ # Device-specific implementations
├── mcp/ # MCP server implementation
├── cli/ # Command-line interface
└── examples/ # Usage examples
Supported Operations
Device Management
- List devices (simulators and real devices)
- Boot/shutdown simulators
- Connect/disconnect real devices
- Get device information and capabilities
App Management
- Install apps (.app bundles or .ipa files)
- Launch and terminate apps
- List installed apps
- Manage app permissions
UI Automation
- Tap, swipe, pinch, zoom gestures
- Type text
- Press hardware buttons
- Take screenshots and record videos
Media & Location
- Add photos and videos to device
- Set GPS location
- Simulate location routes
Debugging
- View system and app logs
- Access crash reports
- Manage debug server
Development
Setup Development Environment
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black src/
# Type checking
mypy src/
Adding New Features
- Add interfaces to
core/base.py - Implement in appropriate module
- Add MCP tool in
mcp/tools.py - Add CLI command in
cli/commands/ - Add tests and examples
Troubleshooting
Simulator Issues
- Ensure Xcode is installed:
xcode-select -p - Reset simulators:
xcrun simctl erase all
Real Device Issues
- Enable developer mode on device
- Trust computer when prompted
- Check USB/WiFi connection
Tool Detection
Run ios-control status to see which tools are available
Contributing
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push branch (
git push origin feature/amazing-feature) - Open Pull Request
License
MIT License - see LICENSE file for details
Acknowledgments
- Apple for iOS Simulator and development tools
- Facebook for idb
- MCP community for protocol standards
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chuk_mcp_ios-0.1.0.tar.gz.
File metadata
- Download URL: chuk_mcp_ios-0.1.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18d59ad88ede3db6f41efe0c703617019f81c5d1af5da71ae11b6b0a71337f2c
|
|
| MD5 |
d2c7d59bd41d666b4743bb0562fb0663
|
|
| BLAKE2b-256 |
fc23ce4affc59e74b05bd2d8e957a5265c6645e9d02de30f53b9f2c46ba27045
|
File details
Details for the file chuk_mcp_ios-0.1.0-py3-none-any.whl.
File metadata
- Download URL: chuk_mcp_ios-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df9c17f60ec7113af7a9f31baeb70693b6933b446fd97627372778bba80fc0dc
|
|
| MD5 |
71e37e65fdca3ed5d6e989b4941819f2
|
|
| BLAKE2b-256 |
d24690bb71ac7b6c2426ab103c1d52803aad6e26f0f7bf0f137c227a9aa58df4
|