npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

idevicekit

v0.3.3

Published

NodeJs wrapper for libimobiledevice

Downloads

13

Readme

NodeJs wrapper for libimobiledevice

Requirements

  • [Node.js][nodejs] >= 6.0
  • libimobiledevice & ideviceinstaller
brew install libimobiledevice
brew install ideviceinstaller

Getting started

Install via NPM:

npm install --save idevicekit

API

idevicekit.listDevices()

Gets the list of currently connected devices.

  • Returns: Promise
  • Resolves with: devices An array of device's serial

idevicekit.getProperties(serial, [option])

Retrieves the properties of the device identified by the given serial number. This is analogous to ideviceinfo.

  • serial The serial number of the device. Corresponds to the device ID in idevicekit.listDevices().
  • option Optional. The following options are supported, use ideviceinfo --help to learn more
    • simple When true, use a simple connection to avoid auto-pairing with the device, Default: false
    • domain set domain of query to NAME. Default: None
  • Returns: Promise
  • Resolves with: properties An JSON Object of device's properties.

idevicekit.getPackages(serial, [option])

Retrieves the list of packages present on the device. This is analogous to ideviceinstaller.

  • serial The serial number of the device. Corresponds to the device ID in idevicekit.listDevices().
  • option Optional. The following options are supported, use ideviceinstaller --help to learn more
    • list List apps, possible options:
      • user: list user apps only (this is the default)
      • system: list system apps only
      • all: list all types of apps
  • Returns: Promise
  • Resolves with: packages An array of app package

idevicekit.screencap(serial)

Takes a screenshot in PNG format using idevicescreenshot.

  • Returns: Promise
  • Resolves with: screencap An PNG stream.

idevicekit.install(serial, ipa)

Installs the IPA on the device, This is analogous to ideviceinstaller -i <ipa>

  • Returns: Promise
  • Resolves with: output output of install command

idevicekit.syslog(serial)

Retrieves syslog on the device, This is analogous to idevicesyslog

  • serial The serial number of the device. Corresponds to the device ID in idevicekit.listDevices().
  • Returns: Promise
  • Resolves with: emitter emit "log" event when log come

idevicesyslog will continue running until a 'close' event emit to emitter

idevicekit.reboot(serial)

reboot using idevicediagnostics restart.

  • Returns: Promise
  • Resolves with: success True if success

idevicekit.shutdown(serial)

reboot using idevicediagnostics shutdown.

  • Returns: Promise
  • Resolves with: success True if success

shortcut API

idevicekit.getBasicInformation(serial, [option])

Basic device information from Apple, such as CPU, RAM, Official Name

getResolution(serial)

getStorage(serial)

getBattery(serial)

Example

let co = require('co');
let idevicekit = require('./index');
let fs = require('fs');

co(function* () {
    let devices = yield idevicekit.listDevices();
    for (let device of devices) {
        let properties = yield idevicekit.getProperties(device);
        let battery = (yield idevicekit.getBattery(device)).level;
        let resolution = yield idevicekit.getResolution(device);
        let status = yield idevicekit.getDeveloperStatus(device);
        console.log(`${device}: ${properties['DeviceName']}`);
        console.log(`    model: ${properties['ProductType']}`);
        console.log(`    battery: ${battery}`);
        console.log(`    resolution: ${resolution['width']}x${resolution['height']}`);
        console.log(`    status: ${status}`);
        let screenshotStream = yield idevicekit.screencap(device);
        screenshotStream.pipe(fs.createWriteStream(device + '.png'));
        idevicekit.syslog(device).then((emitter) => {
            emitter.on('log', (data) => {
                console.log(JSON.stringify(data));
            });
            setTimeout(() => {
                emitter.emit('close');
            }, 10000);
        });
    }
}).catch((err) => {
    console.log(err);
});