Mastering iOS device management with libimobiledevice and ideviceinstaller
Yassine Lafryhi , 31 Jul 2023Have you ever wondered how to manage, debug, or install applications on your iOS device directly from your macOS terminal? These tools are your answers. They allow interaction with iOS devices natively, a crucial ability for developers and tech-savvy users. Let’s dive right into it!
Installing libimobiledevice and ideviceinstaller
Before anything else, we need to install our tools. Here’s how you can do it on macOS:
brew install --HEAD usbmuxd
brew install --HEAD libimobiledevice
brew install --HEAD ideviceinstaller
Querying Device Information
Using ideviceinfo, we can retrieve all sorts of information from the device. Simply connect your iOS device to your computer and run:
ideviceinfo
File Transfer
With ifuse, we can mount the iOS device’s filesystem to our local system and transfer files:
mkdir ~/myiosdevice
ifuse ~/myiosdevice
Installing Applications
You can install IPA files to your device using ideviceinstaller:
ideviceinstaller -i /path/to/app.ipa
And also uninstall them:
ideviceinstaller -U <app_id>
Debugging Applications
With idevicedebug, we can start and stop the debugging process for an application:
idevicedebug start <app_id>
Screenshot
Taking a screenshot is easy with idevicescreenshot:
idevicescreenshot screenshot.tiff
Restarting Device
You can restart your device using idevicediagnostics:
idevicediagnostics restart
Managing Provisioning Profile
To add a provisioning profile to your device, use ideviceprovision:
ideviceprovision add /path/to/provisioning/profile
And More!
There’s a lot more you can do with these tools, like managing network links, setting device names, activating/deactivating devices, and checking device “heartbeat”. You can always learn more with:
idevicetool --help