Skip to content

Libimobiledevice

SarKaa edited this page Feb 7, 2024 · 18 revisions

Libimobiledevice

Previous versions of jailm8 used pre-compiled binaries for libimobiledevice tools, but these are no longer kept up to date. There was this fork that had a workflow for compiling the latest versions of libimobiledevice from the original repo.

This was perfect for what I needed, except for the fact that it released the package as a tar.xz file - a format that cannot be extracted natively on windows. I forked the libimobiledevicerepo myself and tweaked the workflow to better fit jailm8's requirements. This fork of the fork can be found here. This new source for libimobiledevcice also brought some other benefits, like fixing the idevicepair list function in the GUI, and added features like idevicedevmodectl and idevicesetlocation utilities.

Apple Mobile Device Support

Libimobiledevice uses functions normally provided by usbmuxd. This is a daemon for linux, and instead of porting it to windows, libimobiledevice uses Apple's own tool that provides the same functionality. Normally, Apple Mobile Device Support is installed with iTunes, but I understand not everyone has iTunes installed, or wants to install it. For that reason, Jailm8 gives you the option to download the iTunes installer and extract the Apple Mobile Device Support 64 installer. The same can be done to install iTunes as a whole or just Apple Software Update too. Jailm8 now checks if you have it installed when downloading libimobiledevice, and if you don't have it, jailm8 will ask you if you want to install it. If you say no, libimobiledevice is disabled. If you say yes, it will download the .msi file (in resources) and run it. After installing it, libimobiledevice should work perfectly.

NOTE: This will not be updated once installed unless you install itunes as a whole, so that is the recommended way to go.

Commands available

Number in menu command info
3. iproxy forward your devices local ssh server to a port on your computer
4. name check which devices are connected, outputs connected devices names
5. id see device udid
6. info outputs a long list of details regarding your device. This can also dump the details to a text file
7. pair idevicepair utility
8. provision ideviceprovision utility
9. date see device date
11. installer ideviceinstaller utility
12. irecovery recovery utilities
13. diy download libimobiledevice to working directory
diagnostics idevicediagnostics utility

Iproxy

Iproxy is normally used for ssh-ing to an ssh device over usb. More info can be found here

In jailm8.exe, the iproxy command (3) asks you for the port on your iDevice (to forward from) and the port on your machine (to forward to).

This then forwards the port. Regardless of whether a device is connected, the program returns "waiting for connection". This appears even if the forwarding has been successful, so don't worry if you see this.

If you have an ssh command installed, any one works, but the windows one is the official supported one (install it by running Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0 in windows powershell). If it is installed, jailm8 will automatically open a second command prompt window that connects to the forwarded device, and it should ask you for your password. The default password for root is "alpine", so enter that if you are unsure of your password.

As well as connecting to the device, jailm8 will also automatically forward the computer's ssh port (22) to the idevice. If you also have an ssh server installed on your computer (at port 22), you can ssh back to your computer from your idevice, at <username>@localhost -p 2222 while you are still connected to the ssh instance automatially opened by jailm8.

To allow you to use other things with the forwarded port, the iproxy connection is kept on until jailm8 is closed, so the only way to exit iproxy is to close the app altogether.

If you are using iproxy from a command prompt, you can use it like this:

jailm8 iproxy <host-port> <device-port>

Small libimobiledevice tools

Number in menu command info
4. name check which devices are connected, outputs connected devices names
5. id see device udid
6. info outputs a long list of details regarding your device
9. date see device date

ideviceinfo

This took a lot of time and effort to make, but the end product was something that worked and worked well. When you run this command, the details of your device are piped to more through batch. This allows you to scroll (down, not up). One problem this creates is the fact that when you press enter to go down a line, if you go too far, it will skip the dump screen. To work around this, you can use the space bar to skip entire pages instead of using the return key to do it line by line. After you scroll through the whole list, it will ask you if you want to dump these details to a text file. If you do, simply type Y or y. If you do not want to dump it, type n or N. (NOTE: typing anything apart from y or Y cancels the dump, so you can simply press enter instead of pressing n)

Built in terminals

Some of the tools require some extra options, so I have built in a small terminal prompt for each of the commands, namely "pair", "irecovery" and "provision".

In these, just type in what would come after the command name in terminal: E.G: If the command is idevicepair <udid> , only type in udid in the jailm8 prompt after selecting idevicepair in the menu.

Recovery

This is another "built-in terminal", but it also allows you to use ideviceenterrecovery (annoying to type), by typing recovery. Normally ideviceenterrecovery would require you to enter your device udid, but in jailm8, if you select the right option, it will automatically get the udid (with ideviceinfo) and forward it to ideviceenterrecovery. This means you can easily enter recovery mode without having to save any details.

DIY

A lot of the tools have some odd complications that prevent them from being integrated seamlessly into jailm8, so I added a diy command that downloads the libimobiledevice folder to the working directory (where jailm8.exe is), so you can cd to it in command prompt and use the commands yourself. This gives you more freedom, and also lets you use all of the libimobiledevice tools.

iDeviceinstaller

This tool lets you view, backup, install and remove apps from your idevice. All output is piped to more, as a lot of ideviceinstaller's output is bigger than the normal terminal screen size. Simply use the space bar to move pages, and enter to move lines