routeTraffic
Routes network traffic on the iOS device through a tunnel or proxy. Returns a cleanup function to restore normal network behavior.Parameters
List of app bundle IDs to route. Pass an empty array
[] to route all apps.Optional list of domains to route. If omitted, all domains are routed.
The tunnel configuration. Must be one of the following types:
{ type: "direct" }— Routes traffic directly with no proxy or VPN.{ type: "http-proxy", host, port, username?, password? }— Routes through an HTTP proxy.{ type: "wireguard", configPath }— Routes through a WireGuard VPN using a config file.{ type: "openvpn", configPath }— Routes through an OpenVPN connection using a config file.{ type: "relay", host, port, username, password, dialer?, secure? }— Routes through a relay server.
Optional SOCKS proxy host.
Optional SOCKS proxy port.
If
true, enables traffic inspection/logging.Returns
A cleanup function() => Promise<void>. Call it at the end of your test to restore normal network routing.
Example
getNetworkStatus
Returns the current network routing status of the device.Response
The currently active routing method.
A map of tunnel names to their current status. Each entry includes:
status:"down"|"starting"|"up"|"error"interface(optional): Network interface name.error(optional): Error message if status is"error".
Active routing table information, including the active table name and a map of table entries.
Traffic statistics broken down by route and network interface (packets and bytes).
Information about the VPN app on the device:
bundleId: App bundle identifier.installed: Whether the VPN app is installed.pid(optional): Process ID if running.
Bundle IDs of apps currently being routed.
Domains currently being routed.
simulateNetworkCondition
Simulates degraded network conditions such as throttled bandwidth or packet loss. Returns a cleanup function to restore normal conditions.Parameters
Bandwidth cap in kilobits per second.
Added latency in milliseconds.
Latency jitter in milliseconds.
Percentage of packets to drop (0–100).
Presets
| Preset | Description |
|---|---|
ios.NETWORK_2G_EDGE | 2G/EDGE conditions |
ios.NETWORK_3G | 3G conditions |
ios.NETWORK_4G_LTE | 4G LTE conditions |
ios.NETWORK_5G | 5G conditions |
ios.NETWORK_SATELLITE | Satellite connection |
ios.NETWORK_WIFI_CONGESTED | Congested WiFi |
ios.NETWORK_VERY_BAD | Very poor conditions |
ios.NETWORK_OFFLINE | No network connectivity |
Returns
A cleanup function() => Promise<void>. Call it to restore normal network conditions.
Example
getNetworkCondition
Returns the currently active simulated network condition, if any.Response
Whether network condition simulation is currently active.
The active condition config, if enabled. Includes optional fields:
bandwidthKbps, latencyMs, jitterMs, packetLossPercent.The network interface the condition is applied to.
subscribeNetworkLogs
Subscribes to real-time network traffic logs on the device.Returns
ANetworkLogSubscription object with two methods:
on(handler)— Registers a callback that receives eachRecordedEntryas it arrives.close()— Unsubscribes and stops receiving logs.
Example
RecordedEntry fields
Each log entry may include the following fields depending on the protocol:The originating service name.
Network type (e.g.,
wifi, cellular).Remote IP address.
Local IP address.
Hostname.
Protocol (e.g.,
tcp, udp).HTTP request/response details including method, URI, status code, headers, and body.
WebSocket frame details.
TLS handshake details including server name, cipher suite, and version.
DNS query/response details.
Session ID.
Timestamp of the log entry.
Duration in milliseconds.
calculateAudioFingerprint
Calculates a fingerprint from audio data for comparison or verification.Parameters
The WebDriverIO browser instance.
Raw audio data to fingerprint.
Response
Array of numeric values representing the audio fingerprint.
Duration of the audio in seconds.
startSpeakerRecording / stopSpeakerRecording / downloadSpeakerRecording
Records audio from the device speaker during a test.Example
listPhotos / savePhoto / deleteAllPhotos
Utilities for managing photos in the device’s photo library.deleteAllPhotos permanently removes all photos from the device’s photo library. Use with caution.installConfigurationProfile
Installs a.mobileconfig configuration profile on the device. Returns a cleanup function to remove the profile.
Parameters
The WebDriverIO browser instance.
The contents of the
.mobileconfig file as a string.