Skip to content

A pure-js Node.js library for communicating with iPhones over USB via usbmux

License

Notifications You must be signed in to change notification settings

httptoolkit/usbmux-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usbmux-Client Build Status Available on NPM Funded by NLnet - NGI Zero Entrust

Part of HTTP Toolkit: powerful tools for building, testing & debugging HTTP(S)

A pure-js Node.js library for communicating with iPhones over USB via usbmux, with a pure-JS solution for Node.js that works on all platforms.

This provides fully cross-platform access to iOS devices, supporting the usbmuxd daemon built into iTunes on Windows & Mac, and the libimobiledevice implementation on Linux.

This is used within HTTP Toolkit to connect to TCP ports on a connected iPhone via USB, primarily to communicate with Frida using Frida-JS. It's currently focused on the core features required for that use case, but PRs to add support for more features are welcome. Right now it supports:

  • Monitoring the list of connected devices
  • Querying the metadata for any connected device (to get the device name, device type, UDID, architecture, etc)
  • Opening a direct connection to any port on the device itself

Example

import { UsbmuxClient } from 'usbmux-client';

const client = new UsbmuxClient();

const devices = await client.getDevices();
// Returns a map from id to basic data like {
//   "1": { ConnectionType: "USB", DeviceId: "1", ... }
// }

const firstDeviceId = Object.keys(devices)[0];
const deviceMetadata = await client.queryAllDeviceValues(firstDeviceId);
// Returns detailed data like { DeviceClass: "iPhone", DeviceName: "Alice's iPhone", ... }

// Returns a net.Socket connected to the given port on the target device:
const conn = await client.createDeviceTunnel(firstDeviceId, 1234);

This library is part of a broader HTTP Toolkit project, funded through the NGI Zero Entrust Fund, established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more on the NLnet project page.

NLnet foundation logo NGI Zero Entrust Logo

About

A pure-js Node.js library for communicating with iPhones over USB via usbmux

Resources

License

Stars

Watchers

Forks

Packages

No packages published