IOSDriver API Reference
IOSDriver
get_date()- Not available (returns empty string)drag()- Not supported (not insupportedset)press_key()- Only HOME is mapped; BACK and ENTER have no iOS equivalentinput_text()-clearparameter is ignored
IOSDriver.__init__
urlstr - iOS Portal app URL (e.g., “http://192.168.1.100:8080”)bundle_identifiersList[str] | None - Optional list of custom app bundle identifiers
- Install Droidrun iOS Portal app on device
- Launch Portal app (starts HTTP server)
- Connect device and computer to same network
- Use displayed URL to initialize IOSDriver
Lifecycle Methods
IOSDriver.connect
IOSDriver.ensure_connected
Input Action Methods
IOSDriver.tap
xint - X coordinateyint - Y coordinate
- Stores tap coordinates internally for
input_text()targeting
IOSDriver.swipe
x1int - Starting X coordinatey1int - Starting Y coordinatex2int - Ending X coordinatey2int - Ending Y coordinateduration_msfloat - Duration in milliseconds (ignored on iOS)
- iOS uses directional swipes, not precise coordinates
- Direction calculated from coordinate delta (largest axis wins)
duration_msparameter is ignored by iOS API
IOSDriver.input_text
textstr - Text to input (supports Unicode)clearbool - Not supported on iOS (ignored)
bool- True if input succeeded, False otherwise
- Must tap text field before calling this method
- Uses last tapped coordinates for targeting
clearparameter is ignored on iOS
IOSDriver.press_key
3(Android HOME) maps to iOS HOME button
keycodeint - Android-style keycode (translated to iOS internally)
App Management Methods
IOSDriver.start_app
packagestr - Bundle identifier (e.g., “com.apple.MobileSMS”)activitystr | None - Ignored on iOS (for API compatibility)
str- Result message
- Messages:
com.apple.MobileSMS - Safari:
com.apple.mobilesafari - Settings:
com.apple.Preferences - Mail:
com.apple.mobilemail - Calendar:
com.apple.mobilecal - Photos:
com.apple.mobileslideshow - Maps:
com.apple.Maps - Contacts:
com.apple.MobileAddressBook
IOSDriver.list_packages
include_systembool - Include system apps (default: False)
List[str]- List of bundle identifiers
- Returns union of
bundle_identifiers+ system apps (if included) - Does not query device for installed apps
IOSDriver.get_apps
include_systembool - Include system apps (default: True)
List[Dict[str, str]]- List of dicts with ‘package’ and ‘label’ keys (both set to bundle identifier)
State and Observation Methods
IOSDriver.screenshot
hide_overlaybool - Unused on iOS (for API compatibility)
bytes- Raw PNG image data
IOSDriver.get_ui_tree
a11y_raw- The raw accessibility tree text from the portalphone_state- Dict withcurrentAppandkeyboardVisible
IOSDriver.get_date
Unsupported Methods
The following DeviceDriver methods are not insupported and will raise NotImplementedError:
drag()
Not supported on iOS. Not declared insupported set.
install_app()
Not supported on iOS. Not declared insupported set.
Instance Properties
iOS vs Android Differences
| Feature | IOSDriver | AndroidDriver |
|---|---|---|
| Back button | Not available | Full Android keycodes |
| Swipe | Direction-based | Coordinate-based |
| Drag | Not supported | Declared (not yet implemented) |
| App IDs | Bundle identifiers | Package names |
| Key codes | HOME only | Full Android keycodes |
| Connection | HTTP (Portal app) | ADB over USB/TCP |
| get_date() | Returns empty | Via ADB shell |
| input_text() clear | Ignored | Supported |
adb connect + Portal APK
iOS: Portal app + same network + HTTP connection
Example Usage
ActionContext (see DroidAgent) rather than calling the driver directly.
See Also
- AndroidDriver - Android device driver with full functionality
- DeviceDriver Base Class - Base class and architecture reference

