A cross-platform FOSS library written in C to communicate with iOS devices natively.


... and a bunch of libraries and command-line utilities.

 Get Started

Features

Native Protocols

The library implements the native protocols needed to communicate with services running on iOS devices. Due to the reimplemention it does not depend on using or bundling any existing libraries from Apple.

Cross-Platform

The C programming language enables cross-platform use of the library. It has already been built and run on  Linux,  Mac,  Windows,  Android and embedded  ARM SoCs.

Architecture

The architecture of the library and dependencies has been designed with an OOP approach in mind. Thus bindings for other programming languages are easier to create and allow an OOP based API.

Motivation

Linux enthusiasts were not amused about great but incompatible hardware like the iPhone 2G. As iTunes was not available for Linux libiphone was born. This became libimobiledevice with the goal to bring freedom and "allow penguins to talk to fruits".

Command-Line

Many command-line utilities come bundled with the library that allow interacting with iOS device services already. This covers retrieving basic device information up to restoring official firmware images.

Network Support

Devices that have "Wifi Sync" enabled can be accessed wirelessly and do not require a wired USB connection anymore with iOS 11 and later.

Years of Research

Due to being in development since 2007 the library supports the range from the first to the latest iOS device. This is an achievement of many years of research and development.

Scalability

Being integrated by popular community projects as well as large implementations which interact with more than 10.000+ of devices provide a good reference point for high scalability and efficiency of this solution.

Native Protocols

Control devices running latest iOS firmware

The library has been architected for easy access to native device features using an object-oriented higher-level API.

This allows interacting with various native device service APIs to manage Apps, Backup, Filesystem, Debugging, Activation, Provisioning, SpringBoard, Syslog, Firmware Updates and much more.

You can also use the bundled command-line utilities for these if you do not actually develop an application.

 Get Started
...
#include <libimobiledevice/libimobiledevice.h>

/* Unique Device Identifier */
static char *udid = NULL;

/* Device Handle */
idevice_t device = NULL;

/* Try to connect to first USB device */
if (idevice_new_with_options(&device, NULL, IDEVICE_LOOKUP_USBMUX) != IDEVICE_E_SUCCESS) {
  printf("ERROR: No device found!\n");
  return -1;
}

/* Retrieve the udid of the connected device */
if (idevice_get_udid(device, &udid) != IDEVICE_E_SUCCESS) {
  printf("ERROR: Unable to get the device UDID.\n");
  idevice_free(device);
  return -1;
}

/* Outputs device identifier */
printf("Connected with UDID: %s\n", udid);

/* Cleanup */
idevice_free(device);
free(udid);
...
...
#include <libimobiledevice/lockdown.h>
#include <plist/plist.h>

/* Lockdown Service Handle */
lockdownd_client_t lockdown = NULL;

/* Handshake with lockdownd */
lockdownd_client_new_with_handshake(device, &lockdown, "myapp");

/* Use the plist format */
plist_t node = NULL;

/* Our result */
char *value = NULL;

/* Retrieve "DeviceColor" setting value from device */
if(lockdownd_get_value(lockdown, NULL, "DeviceColor", &node) != LOCKDOWN_E_SUCCESS) {
  lockdownd_client_free(lockdown);
  idevice_free(device);
  printf("ERROR: Unable to retrieve setting key DeviceColor from device.\n");
  return -1;
}

/* Get string value from node */
plist_get_string_val(node, &value);

/* Output device color value */
printf("%s value is: %s\n", "DeviceColor", value);

/* Cleanup */
plist_free(node);
free(value);
lockdownd_client_free(lockdown);
...
$ ideviceinfo -k ProductVersion
12.4
$ ideviceinfo -s
BasebandCertId: xxxxxxxxxx
BasebandKeyHashInformation:
 AKeyStatus: 2
 SKeyHash: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 SKeyStatus: 0
BasebandSerialNumber: xxxxxxxx
BasebandVersion: 7.80.04
BoardId: 4
BuildVersion: 16G77
ChipID: 28672
DeviceClass: iPhone
DeviceColor: #e1e4e3
DeviceName: iPhone 6 Plus
DieID: xxxxxxxxxxxxxxx
HardwareModel: N56AP
HasSiDP: true
PartitionType: GUID_partition_scheme
ProductName: iPhone OS
ProductType: iPhone7,1
ProductVersion: 12.4
ProductionSOC: true
ProtocolVersion: 2
TelephonyCapability: true
UniqueChipID: xxxxxxxxxxxxxxx
UniqueDeviceID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
WiFiAddress: xx:xx:xx:xx:xx:xx
$ ideviceactivation state
ActivationState: Activated
$ idevicediagnostics restart
Restarting device.

Download

Please select a component to view download, release, and dependency information of the latest release.

A cross-platform protocol library to communicate with iOS devices

Download (tar.bz2) LGPL-2.1 License
Depends on:

1.3.0 (2020-06-15)

Development release.

Breaking
  • Rename --enable-debug-code configure option to --enable-debug
  • Rename library and all related files by adding an API version resulting in libimobiledevice-1.0
Features
  • Add more lockdown error codes
  • Add new lockdownd_pair_with_options() function
  • Make sure sockets only listen locally due to security reasons
  • Plug various memory leaks
  • Optimize lockdown pair record handling
  • Store application information in Info.plist using idevicebackup2
  • Make idevicebackup2 reboot after restore the default to allow the device to migrate data correctly and thus improve the restored device data state
  • Improve console frontend information output in idevicebackup2
  • Extend ideviceprovision tool to allow retrieving and removing all provisioning profiles
  • Propagate lower level errors to callers instead of returning IDEVICE_E_UNKNOWN_ERROR
  • API: Add IDEVICE_DEVICE_PAIRED event type
  • Detect screenshot format to support png, tiff and dat formats using idevicescreenshot tool
  • API: Add mobileactivation service implementation
  • Wait for passcode entry if required using idevicesyslog
  • Add HDMI option to diagnostics command for idevicediagnostics
  • Remove 40-digit character limit for UDID in tools to support newer devices
  • Migrate latest improved common code from libusbmuxd
  • Convert README file to markdown format
  • API: Add preboard service implementation
  • Output hint to user to enter passcode when changing password using idevicebackup2
  • API: Add WiFi device support via new idevice_new_with_options() function
  • API: Add idevice_get_device_list_extended() to also list network devices
  • API: Add lockdown_strerror() helper to get error representation as string
  • Add network device support to idevicesyslog and ideviceinfo tools
  • Make debug output consistently output to stderr
  • Add new idevicesetlocation tool (requires mounted developer image)
  • Add option to exit if device disconnects in idevicesyslog
  • API: Add syslog_relay_start_capture_raw() for raw syslog capture
  • Add color output and process filter support to idevicesyslog
  • API: Add companion_proxy service implementation
  • Bump dependency to libusbmuxd 2.0.2
  • Bump dependency to libplist 2.2.0
  • Improve error handling and reporting in library and tools
  • Add --network and --version options to all tools
  • Cython: Rewrite version detection logic in configure.ac
  • Improve README.md with project description, installation, contributing and usage sections
  • Bump soname version
  • Update man pages
Bug Fixes
  • Fix Python 3 support
  • Cython: Fix and improve debugserver and diagnostics service bindings
  • Fix GnuTLS support with iOS 10
  • Fix SSL version negotiation for newer versions of OpenSSL
  • Return proper error code when a lockdown pair record is missing
  • Fix building with MingGW
  • Fix application backup handling to allow the device to restore applications that were installed using idevicebackup2
  • Fix parsing large provisioning profile using ideviceprovision
  • Fix receiving large property lists in property list service
  • Fix IORegistry command for iOS 11+ devices in idevicediagnostics
  • Fix broken validate command in idevicepair with iOS 11+
  • Fix OpenSSL version checks for configure target when using LibreSSL
  • Fix idevicecrashreport tool to work with iOS 13+
  • Fix various errors in SSL communication logic
  • Fix various memory leaks in library and tools
  • Fix socket_connect_addr() not connecting to network devices using IPv6 in some cases.
  • Allow OpenSSL >= 1.1.0 to use older/disallowed TLS versions fixing issues where pairing records were getting removed repeatingly
  • Improve IPv6 "scope id" detection to fix connecting to network devices with link-local adresses
  • Fix various inconsistent declarations in public headers
  • Fixed memory leaks

A socket daemon to multiplex connections from and to iOS devices

Download (tar.bz2) GPL-2.0 License
Depends on:

1.1.1 (2020-06-15)

Maintenance release.

Features
  • Make use of libusb hotplug events for device discovery
  • Get correct USB device speed instead of hardcoded value
  • Bump libusb dependency to 1.0.9
  • Use non-blocking sockets for client communication to avoid hanging
  • Use correct manual section (8) for manpage
  • Log pid of connecting clients if supported
  • Implement device discovery using libusb hotplug events
  • Log error message if writing a config file fails
  • Tag all udev events with systemd tag
  • Set socket options for client connections to improve performance
  • Implement ListListeners usbmux command handling
  • Bump libimobiledevice dependency to 1.3.0
  • Bump libplist dependency to 2.2.0
  • Add support for iPhone XS/XR UDID format
  • Add option to allow logging to dedicated logfile
  • Convert README file to markdown format
  • Add support for connecting with T2 chip
  • Show actual libusb version in debug message on startup
  • Enable libusb debugging output
  • Log client process name alongside pid if possible on Linux
  • Unify and improve log message output
  • Improve README.md with project description, installation, contributing and usage sections
Bug Fixes
  • Use clock_gettime() instead of gettimeofday() to avoid timing issues when calculating packet timeouts
  • Fix wrong timeout value in debug messages
  • Fix blocking by using libusb asynchronous I/O for getting initial device information
  • Fix occasional USB reconfiguration due to udev rules being run again
  • Fix wrong timestamps when running in foreground
  • Fix USB reconnection issues on virtual machines with iOS 11+ devices
  • Various memory leak, deadlock and invalid free fixes

Manage apps of iOS devices

Download (tar.bz2) GPL-2.0 License
Depends on:

1.1.1 (2020-06-15)

Maintenance release.

Features
  • Bump autoconf requirement to 2.64
  • Bump libzip dependency to 0.10
  • Ignore .DS_Store and hidden files when parsing ZIP files
  • Improve excessive progress output
  • Return non-zero exit status on errors
  • Remove length check on UDID argument to support newer devices
  • Add -n option to make waiting on install/uninstall notification optional
  • Add --network and --version options to ideviceactivation tool
  • Bump libimobiledevice dependency to 1.3.0
  • Bump libplist dependency to 2.2.0
  • Improve README.md with project description, installation, contributing and usage sections
Bug Fixes
  • Fix device removal detection triggering on any device unplug
  • Fix win32 build
  • Ignore SIGPIPE signal

Restore/upgrade firmware of iOS devices

Download (tar.bz2) LGPL-3.0 License
Depends on:

1.0.0 (2020-06-15)

First official public release!

Features
  • Restore firmware files to iOS devices
  • Use official IPSW firmware archive file or directory
  • Updates the device by default or allows full restore erasing all data
  • Download latest available firmware for device on demand
  • Cache downloaded firmware files
  • Restore using custom firmware files (requires bootrom exploit)
  • Skip NOR/Baseband upgrade
  • Fetch TSS records as .shsh files
  • Put devices in pwned DFU mode (limera1n devices only)
  • Use custom AP ticket from file
  • Developed since 2010

A fuse filesystem to access the contents of iOS devices

Download (tar.bz2) LGPL-2.1 License
Depends on:

1.1.4 (2020-06-15)

Maintenance release.

Features
  • Use automake silent rules if available
  • Add helpful message when mounting an app document folder fails
  • Add new --list-apps option to print list of apps with file sharing enabled
  • Remove length check on UDID argument to support newer devices
  • Add --network option to allow connecting to network devices
  • Add title row and use double quotes for --list-apps output
  • Drop support for older versions of libimobiledevice
  • Bump libimobiledevice dependency to 1.3.0
  • Bump libplist dependency to 2.2.0
  • Improve README.md with project description, installation, contributing and usage sections

A client library to multiplex connections from and to iOS devices

Download (tar.bz2) LGPL-2.1 License
Depends on:

2.0.2 (2020-06-15)

Maintenance release.

Breaking
  • Rename library and all related files by adding an API version resulting in libusbmuxd-2.0
Features
  • Handle USB and network devices with new options in tools
  • Make connecting sockets non-blocking
  • Switch from concurrent threads to loop with select()
  • Allow to specify source address for listening socket in iproxy
  • Allow to map multiple ports in iproxy
  • Add man pages for iproxy and inetcat tools
  • Improve socket_create() with proper use of getaddrinfo
  • Allow proper listening on localhost for IPv6 and IPv4 in iproxy
  • Bump dependency to libplist 2.2.0
  • Add new --version argument to output version information to tools
  • Improve README.md with project description, installation, contributing and usage sections
Bug Fixes
  • Fix compiler warnings
  • Fix win32 build
  • Fix crash when no UDID is provided

A library to handle Apple Property List format in binary or XML

Download (tar.bz2) LGPL-2.1 License

2.3.0 (2023-04-21)

Maintenance release.

Breaking
  • plist_from_memory() gets additional format parameter
Features

Rename PLIST_UINT to PLIST_INT and add plist_new_int() and plist_get_int_val()

  • Add support for JSON format
  • Add support for OpenStep format
  • Introduce error codes and format constants
  • Add return value to import/export functions to allow returning error codes
  • Add new plist_sort() function
  • Add several human-readable output-only formats
  • Add new plist_write_to_string/_stream/_file() functions
  • Add new plist_print() function
  • Add new plist_read_from_file() function
  • Add new plist_mem_free() function
  • Add a few C++ methods
  • Add C++ interface test
  • Add PLIST_NULL type
  • Some code housekeeping (mostly clang-tidy)
Bug Fixes
  • Fix multiple bugs in all of the parsers
  • Fix handling of PLIST_UID nodes

Library and utility to talk to iBoot/iBSS via USB on Mac OS X, Windows, and Linux

Download (tar.bz2) LGPL-2.1 License
Depends on:
  • libusb

1.0.0 (2020-06-15)

First public release.

Breaking
  • Rename library and all related files by adding an API version resulting in libirecovery-1.0
Features
  • Output basic device information after connecting
  • Remove obsolete "in-tree" copy of libusb-1.0
  • Improve source code directory structure
  • Clean up and update of build system files
  • Major code refactoring
  • Add getters to retrieve device model information
  • Change exploit related wording to more accurate limera1n
  • Add support for latest device models
  • Add requirement for autoconf 2.64
  • Support IOKit on OSX (removes dependency on libusb)
  • Add DFU mode error handling
  • Add udev rules to allow non-root device access
  • Support ECID in hex or decimal format
  • Add device add/remove event subscription interface
  • Convert README to markdown
  • Print PWND string if present
  • Add support for Apple T2 processors
  • Allow compiling without USB functionality
  • Support checkra1n DFU mode devices
  • Allow toggling debug level using LIBIRECOVERY_DEBUG_LEVEL environment variable
  • Add long argument name variants to irecovery
  • Add new --version argument to irecovery
  • Add support for Apple Watch 1st gen devices
  • Add support for missing iPad4,3 model
  • Improve README.md with project description, installation, contributing and usage sections
Bug Fixes
  • Fix wrong device information iPad7 variants
  • Various improvements/fixes for win32 build
  • Fix some memory leaks
  • Fix various compiler warnings

A library to handle the activation process of iOS devices

Download (tar.bz2) LGPL-2.1 License
Depends on:

1.1.1 (2020-06-15)

Maintenance release.

Breaking
  • Rename library and all related files by adding an API version resulting in libideviceactivation-1.0
Features
  • Add --network and --version options to ideviceactivation tool
  • Bump libimobiledevice dependency to 1.3.0
  • Bump libplist dependency to 2.2.0
  • Improve README.md with project description, installation, contributing and usage sections
Bug Fixes
  • Ignore SIGPIPE signal

A library with common code used by libraries and tools around the libimobiledevice project

Download (tar.bz2) LGPL-2.1 License
Depends on:

1.0.0 (2023-04-21)

First public release.

Get Started

Please choose your platform of choice below to see instructions on how to get started.

Open Terminal

Open a command-line terminal on your machine.

Install Dependencies

Enter the commands provided below.

$ sudo apt-get install \
    build-essential \
    checkinstall \
    git \
    autoconf \
    automake \
    libtool-bin \
    libplist-dev \
    libimobiledevice-glue-dev \
    libusbmuxd-dev \
    libssl-dev \
    usbmuxd

Build

Enter the commands provided below.

$ ./autogen.sh \
    --prefix=/opt/local \
    --enable-debug
$ make

Install

Enter the commands provided below.

$ sudo make install

Open Terminal

Open a command-line terminal on your machine.

Installation

Enter the commands provided below.

$ sudo apt-get install usbmuxd libimobiledevice6 libimobiledevice-utils

Open Terminal

Open a command-line terminal on your machine.

Installation

Enter the commands provided below.

$ sudo zypper install libimobiledevice6 usbmuxd

Open Terminal

Open a command-line terminal on your machine.

Installation

Enter the commands provided below.

$ sudo port install libimobiledevice

Open Terminal

Open a command-line terminal on your machine.

Installation

Enter the commands provided below.

$ brew install libimobiledevice

Open Terminal

Open a command-line terminal on your machine.

Install Dependencies

Enter the commands provided below.

$ sudo apt-get install \
    build-essential \
    checkinstall \
    git \
    autoconf \
    automake \
    libtool-bin \
    libplist-dev \
    libusbmuxd-dev \
    libssl-dev \
    usbmuxd

Build

Enter the commands provided below.

$ ./autogen.sh \
    --prefix=/opt/local \
    --enable-debug
$ make

Install

Enter the commands provided below.

$ sudo make install

Open Terminal

Open a command-line terminal on your machine.

Installation

Enter the commands provided below.

$ sudo apt-get install usbmuxd libimobiledevice6 libimobiledevice-utils

Latest News


Website up on GitHub

This website is now up on GitHub! As announced before we have made the move to allow public contributions from the community.

New Logo and Website

Welcome to our new project website! Finally the old paint is gone and a new state of art modern look is here.

Fresh Documentation

The API Documentation for libimobiledevice has been updated. A refresh of this website is planned next.

FAQ

To test if you installed everything correctly plug in your device and run "ideviceinfo" within a terminal. Congratulations if it prints a lot of details about your device. Feel free to checkout the documentation or dive into the source code.
Sorry, music synchronization with newer devices is currently not supported but if you are a keen developer why not contribute a new service implementation for the ATC Service?
iFuse is only useful if you want to mount the device manually and if you do not have GNOME and GVFS installed. Otherwise it is useless since GNOME's GVFS supports accessing the device directly and creates a fuse mount in "$XDG_RUNTIME_DIR/.gvfs", too.
The library has shown to be compatible with firmware releases going back to the 1.x series up to todays without issues. At rare times, bugs introduced by the firmware had to be worked around with simple fixes but nothing major prevented it from working. Thus in effect, the implementation proves very stable and compatible among firmware releases.

Team


nikias
Nikias Bassen
@nikias
FunkyM
Martin Szulecki
@FunkyM

Join the Community

We are thrilled that you would like to contribute to this project. Your help is essential for keeping it great.


Contribute on GitHub

Warm welcome for pull requests and technical stuff.


Discuss on Mailing List

The classic way by E-Mail.


Ask on Stackoverflow

Best for general questions and support.


Follow on Twitter

For latest updates in a birdly manner.


Chat on Telegram

Get hands on with developers.


Chat on IRC

Get hands on in ASCII style.

We'll miss you, Steve.