dart_mobile_device 1.0.0 copy "dart_mobile_device: ^1.0.0" to clipboard
dart_mobile_device: ^1.0.0 copied to clipboard

iOS device transport for Dart: pymobiledevice3 wrappers, RSD tunnels, port forwarding, and GDB remote debug proxy.

dart_mobile_device #

iOS device transport for Dart: pymobiledevice3 wrappers, RSD / userspace tunnels, port forwarding, and a minimal GDB-remote client.

Used by xcross for iOS 17+ launch, install, and hot-reload over a device tunnel. Requires Python 3 and pymobiledevice3 on the host.

Install #

dart pub add dart_mobile_device

Prerequisites #

# Linux
sudo pip3 install --break-system-packages pymobiledevice3

# Windows
py -m pip install -U pymobiledevice3

Kernel RSD tunnels need root (Linux) or an Administrator shell (Windows). Userspace tunnel mode works over usbmux without a TUN device.

Usage #

List devices and install #

import 'package:dart_mobile_device/dart_mobile_device.dart';

final devices = await PymdDevices.devices();
for (final d in devices) {
  print('${d.name}  ${d.udid}  ${d.type}');
}

await PymdDevices.install('/path/to/App.app', udid: devices.first.udid);

Prepare host + resolve transport #

// Mount DDI, ensure tunneld, start lockdown RSD tunnel (elevated).
await DevicePrepare.prepare();

final transport = await DeviceTransportResolver.resolve(udid: udid);
try {
  final debug = await transport.debugproxyEndpoint();
  final vm = await transport.devicePortEndpoint(8181);
  // …
} finally {
  await transport.close();
}

Set XCROSS_TUNNEL_MODE to auto (default), kernel, or userspace to control which transport is built.

Discover an existing RSD tunnel #

final tunnel = await TunnelDiscovery.discoverTunnel(udid: udid);
print('${tunnel.address}:${tunnel.port}');

Loopback port forward #

final forwarder = await PortForwarder.start(
  deviceHost: tunnel.address,
  devicePort: 8181,
);
print('local port: ${forwarder.localPort}');
await forwarder.close();

API surface #

Type Role
Pymd / PymdDevices Resolve and invoke pymobiledevice3
DevicePrepare / TunnelDaemon Mount DDI, keep tunneld alive
TunnelDiscovery Poll tunneld REST API for an RSD tunnel
DeviceTransportResolver Kernel vs userspace transport
PortForwarder Advertise a device TCP port on 127.0.0.1
GdbRemoteClient Attach / resume / drain GDB-remote stdout

Part of the xcross monorepo. Depends on cli_kit.

0
likes
145
points
29
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

iOS device transport for Dart: pymobiledevice3 wrappers, RSD tunnels, port forwarding, and GDB remote debug proxy.

Repository (GitHub)
View/report issues

Topics

#ios #device #tunnel #pymobiledevice3

License

MIT (license)

Dependencies

cli_kit, meta, path

More

Packages that depend on dart_mobile_device