https://github.com/httptoolkit/usbmux-client
A pure-js Node.js library for communicating with iPhones over USB via usbmux
https://github.com/httptoolkit/usbmux-client
Last synced: 4 months ago
JSON representation
A pure-js Node.js library for communicating with iPhones over USB via usbmux
- Host: GitHub
- URL: https://github.com/httptoolkit/usbmux-client
- Owner: httptoolkit
- License: apache-2.0
- Created: 2024-05-16T15:43:33.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-21T16:49:48.000Z (over 1 year ago)
- Last Synced: 2024-05-22T17:04:40.066Z (over 1 year ago)
- Language: TypeScript
- Size: 19.5 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Usbmux-Client [](https://github.com/httptoolkit/usbmux-client/actions) [](https://npmjs.com/package/usbmux-client) [](https://nlnet.nl/project/AppInterception/)
> _Part of [HTTP Toolkit](https://httptoolkit.com): 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](https://github.com/httptoolkit/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
```javascript
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](https://httptoolkit.com/blog/frida-mobile-interception-funding/), funded through the [NGI Zero Entrust Fund](https://nlnet.nl/entrust), established by [NLnet](https://nlnet.nl) with financial support from the European Commission's [Next Generation Internet](https://ngi.eu) program. Learn more on the [NLnet project page](https://nlnet.nl/project/F3-AppInterception#ack).
[
](https://nlnet.nl)
[
](https://nlnet.nl/entrust)