Getting a full backup of an iOS device (iPhone etc) and extracting any file

; Date: Wed May 29 2024

Tags: iPhone

The data we put on our iPhone/iPad should be readily available both on the device, and on our desktop computer. But, Apple makes the backup process extremely inscrutable, preventing access to our data files.

Apple makes it difficult to retrieve files from iOS devices (iPhone, iPad, etc). Instead of a file system to browse, the files are held by the application. Connecting the device by USB to another computer doesn't let us simply browse the filesystem.

Many applications implement the Sharing button. With that button, your data can be shared to somewhere else, such as a cloud data service like Dropbox, or via e-mail. With Air Drop, files can be shared to a participating computer like a macOS laptop.

That's great for sharing one file at a time. What if you need to share a hundred files? Selecting all those files individually to share them somewhere else can be tedious.

More important is data created using applications, like Griffin iTalk, which are no longer supported and the application icon is totally frozen. If we cannot run the application we cannot access the sharing button and cannot access the files. I've made a number of audio recordings using iTalk, and want to retrieve those files.

We have the right to extract any file from a backup of our iOS devices. We should be able to extract any file we desire from our iOS devices. Those files are rightfully ours, and they belong to us. We should not be obstructed from accessing our data.

Instead, it is difficult to even do an iPhone backup. In my experience the simple act of connecting my iPhone to my macOS laptop using a USB cable was tricky. Often, macOS would not even see the device. Sometimes macOS did see the device, then it would often lose the connection. If it didn't lose the connection, simply moving the phone a little might cause the USB cable to shift a little, and lose the connection. This behavior happened not only on macOS, but on Windows and Linux.

Further, even if one is able to backup their device to a laptop, they're not easily able to access the files. The directory hierarchy produced from an iOS backup is inscrutable. The files and directories are named with hexadecimal characters, with no relation to anything on the device, making it difficult to find what's what.

We should be able to easily browse all data in an iOS backup, and extract any file from that backup. On macOS, the Finder has a special mode for interacting with an iOS device. This special Finder mode was tricky to get running, and would often fail. More importantly, why doesn't the Finder also have a special mode for exploring and extracting files in an iOS backup?

What follows is an exploration of solutions for iOS device backup (focusing on iPhone backup) on Windows, macOS, and Ubuntu Linux. This includes free solutions from Apple, commercial 3rd party solutions, and even open source tools.

The phones in our possession are two iPhone 6s's and an iPhone SE. Our macOS machine is a mid-2012 MacBook Pro running macOS Catalina. While all these devices are "old", they still function very well. The Ubuntu machine is on 22.04, and the Windows machine is on Windows 10.

iPhone Backup on macOS Catalina

Apple makes it look fetchingly simple with a (support.apple.com) Support page telling us to use a USB-Lightning cord to connect the phone to the macOS machine. In Catalina (and probably later releases), the iPhone is supposed to be recognized right away and the Finder will switch into a mode dealing with iOS device backup and generally browsing what's available on the device. It will even autostart the backup for you, requiring you to enter your PIN code to approve the backup.

In my experience this was flaky. The phone was not always recognized - the key result being whether the phone goes to charging mode, and stays in that mode. Often if it was recognized, and the connection would drop either immediately, or some time later. For example, the simple act of moving the phone carried a risk of the connection dropping.

Nothing is available to help debug this. There is nothing in the Settings app to control recognizing iOS devices. Supposedly this can be done over WiFi. Wouldn't it be helpful to have a Settings panel related to configuring iOS device recognition over WiFi?

The time I managed to backup the device - I left the phone disconnected for an hour or so, then carefully selected a secure resting location for both laptop and phone, and only then connecting the phone. That way I could fiddle with the phone with the least jostling, and managed to get a complete backup. I discuss attempting to use that complete backup later in the article.

iPhone Backup on Ubuntu Linux

An open source open source project, (libimobiledevice.org) https://libimobiledevice.org/, is a programmer-friendly tool for accessing iOS devices. The documentation discusses APIs rather than tools. There are some command-line utilities, but they're programmer-friendly and would fail the Mom Test right away.

Connecting an iOS device to my Ubuntu laptop does result in a degree of usefulness. It shows the Camera Roll as a DCIM directory which is great for some use cases. But, I wanted to access other files.

After installing:

$ sudo apt-get install usbmuxd libimobiledevice6 libimobiledevice-utils

I was able to run this command:

$ idevicebackup2 backup --full ~/backups/iphone-david

This took awhile and resulted in a directory looking like this:

$ ls ~/backups/iphone-david/12ff2efxea3medp5l1ea8EXAMPLEf77af2a44c8f/
00  10  20  30  40  50  60  70  80  90  a0  b0  c0  d0  e0  f0  Info.plist
01  11  21  31  41  51  61  71  81  91  a1  b1  c1  d1  e1  f1  Manifest.db
02  12  22  32  42  52  62  72  82  92  a2  b2  c2  d2  e2  f2  Manifest.plist
03  13  23  33  43  53  63  73  83  93  a3  b3  c3  d3  e3  f3  Status.plist
04  14  24  34  44  54  64  74  84  94  a4  b4  c4  d4  e4  f4
05  15  25  35  45  55  65  75  85  95  a5  b5  c5  d5  e5  f5
06  16  26  36  46  56  66  76  86  96  a6  b6  c6  d6  e6  f6
07  17  27  37  47  57  67  77  87  97  a7  b7  c7  d7  e7  f7
08  18  28  38  48  58  68  78  88  98  a8  b8  c8  d8  e8  f8
09  19  29  39  49  59  69  79  89  99  a9  b9  c9  d9  e9  f9
0a  1a  2a  3a  4a  5a  6a  7a  8a  9a  aa  ba  ca  da  ea  fa
0b  1b  2b  3b  4b  5b  6b  7b  8b  9b  ab  bb  cb  db  eb  fb
0c  1c  2c  3c  4c  5c  6c  7c  8c  9c  ac  bc  cc  dc  ec  fc
0d  1d  2d  3d  4d  5d  6d  7d  8d  9d  ad  bd  cd  dd  ed  fd
0e  1e  2e  3e  4e  5e  6e  7e  8e  9e  ae  be  ce  de  ee  fe
0f  1f  2f  3f  4f  5f  6f  7f  8f  9f  af  bf  cf  df  ef  ff

Each of the two-hex-character things are directories where each contain a few dozen files also named with hex characters. Browsing this hierarchy I can open a Preview of the files and see that the information I want is there. But, inscrutable is the word. The .plist files are binary encoded, and the Manifest.db is an SQLITE3 database which is not entirely clear how to navigate.

It seems probably one could write some software that uses the .plist and .db files to browse the files in this directory hierarchy. As an experienced software engineer I could likely work out what to do. But, I have better things to do with my life than create a wheel that Apple should have provided.

iPhone backup on Windows

For Windows we're told on the Apple (support.apple.com) Support page to install the Apple Devices for Windows application. This is available through the (apps.microsoft.com) Microsoft Store.

Clicking the Download button downloads an installer. But, running the installer results in a window telling us it is downloading further information, which did not change even after waiting for 2 hours.

Bottom line is we did not test this application.

We did get an excellent solution for Windows which is discussed later.

Browsing/exploring an iOS device backup made on macOS

We did manage to make a backup of an iOS device on macOS. But does Apple bother to tell us where the backup is stored? Nope.

Instead of a special Finder mode, I would expect Apple to provide an application that a) does backups, b) lets one explore the backups.

An Apple (support.apple.com) Support page fortunately says where to find the backup directory.

First, in the Finder while the device is connected there is a button Manage Backups. This lists the available backups but does not say where they are, nor does it let you do very much.

The Support page does give this directory: ~/Library/Application Support/MobileSync/Backup/. This directory path is normally hidden from view. That means you must open a Finder window, then select the Go to Folder menu choice, and enter that path in the dialog which pops up.

That directory has some directories with hex-coded names, each of which is an iOS device backup. Go into one of those directories and you find a structure identical to what showed earlier on Linux. In other words, the backup directory structure is not a byproduct of geek-friendly open source software, but is how Apple delivers an iOS device backup.

I found several applications for browsing iOS device backups on macOS. One of them is excellent enough that I paid for a commercial license.

This shows an example of using iBackup Extractor to view the files in a backup:

The applications I tested all work similarly. They allow the user to browse a tree structure organized by a domain name referring to the application.

In this case I've navigated to the directory containing files recorded by Griffin iTalk. On my device that application is inoperable because Griffin Technologies stopped supporting it years ago. Those files were trapped and could not be accessed. With the backup program, you can see here that the files are now available.

There was a fourth application I tried, and its behavior is so much better that I paid for a license to unlock its full feature-set. It will be discussed later.

Browsing/exploring an iOS device backup on Ubuntu Linux

On Ubuntu/Linux one uses idevicebackup2 to backup the iOS device to a local directory. It produces the backup directory as shown earlier. On macOS the backup directory structure was identical, so this inscrutable hierarchy is simply how Apple provides an iOS device backup. How, then, do we then browse those files?

While the phone is plugged-in and recognized by Ubuntu, try this command:

$ idevicebackup2 list ~/backups/iphone-david/

There's a lot of details in the output but it does not help to find files of interest.

The ideviceinfo and lsusb commands are useful for learning some details.

The (github.com) ifuse utility uses the FUSE framework to mount a filesystem from the iOS device.

Before using this it is useful to run these commands:

$ sudo mkdir /media/iPhone
$ sudo chown $USER /media/iPhone/
$ chmod 777 /media/iPhone/

Also in /etc/fuse.conf add lines saying user_allow_other and allow_other.

These steps allow regular user IDs to mount an iOS device, and creates a directory for this purpose.

$ ifuse /media/iPhone --root
Failed to start AFC service 'com.apple.afc2' on the device.
This service enables access to the root filesystem of your device.
Your device needs to be jailbroken and have the AFC2 service installed.

This attempts to mount the iOS device but the --root option fails unless the device is jailbroken and has this AFC service installed.

To save you a lot of reading, leave off --root and the filesystem is mounted from the iOS device, just not at the root.

It's interesting to browse the resulting directory hierarchy, but nothing useful can be found. That leaves the only thing to do:

$ umount /media/iPhone 

Some untested resources:

  • (github.com) iOSBackup is Python code for getting information out of an iOS backup, including decrypting the backup. You need to know the encryption key, since it doesn't attempt to break the encryption.
  • (github.com) iphone-backup-decrypt is Python code which attempts to break the encryption of an iOS device backup.
  • (github.com) iTunes Backup Explorer is a Java GUI application for browsing either encrypted or unencrypted iOS device backups.
  • (github.com) mount-ios-backup is a Python tool for mounting an iOS backup as a FUSE filesystem.
  • (stackoverflow.com) How to decrypt an encrypted Apple iTunes iPhone backup? is a Stack Overflow discussion where the answers go deep into how iOS device backups work.

Each of those have links to additional resources. Bottom line is that some folks have spent the time necessary to understand iOS backups and written tools for this purpose. Maybe one of them works. I did not feel encouraged enough by any of them to proceed.

iMazing - the aMazing way of dealing with iOS device backup and file extraction

Of the 3rd party commercial applications I looked at, iMazing is the best.

It is available for both Windows and macOS. My initial testing was on macOS and it worked so well I bought a commercial license. I then installed a copy on the Windows laptop, where it worked great as well.

The application shows everything of interest. It is easy to run a backup using iMazing. And, it has a mode for exploring all files retrieved via backup, as well as directly exploring all files in the iOS device. While using iMazing, the connection to the iPhone was solid and reliable rather than the finicky experience using the macOS support.

There are a wide range of actions you can take including transferring files, performing a backup, accessing photos, music, messages, and so forth.

The user is able to browse archived backups as shown here:

In every way the user experience with iMazing is much better than the other applications named earlier. In browsing the web for information, time after time I saw comments that one should just buy the iMazing commercial license since it's so good. I have to agree.

Summary

Apple is doing iOS device owners a disservice by making it so difficult to perform backups, to access files on their devices, and to access files archived in backups.

The data in question is our data, not Apple's data. It is Apple's duty to make it easy for us to access and interact with that data. We should be able to easily use any application to interact with any file, as we can do on a desktop computer.

An issue may be that Apple wants to steer customers to using iCloud. If it's easy to backup an iOS device to a desktop computer, and then directly interact with the files in the backup, then customers might not have an incentive to buy iCloud services.

From my point of view, I do not want to pay money for a cloud service which I can easily perform on my own hardware. While I'm happy to have found the iMazing application, and am happy with what it does, it should not be necessary. Apple should be providing something similar.

It would also be useful for the open source world to develop tools with at least minimal usability. The available open source tools in this space are expert-friendly and do not serve the needs of regular people.

Bottom line is that, while the iMazing application should not have to exist, it is, uh, an amazing solution and is highly recommended.

About the Author(s)

(davidherron.com) David Herron : David Herron is a writer and software engineer focusing on the wise use of technology. He is especially interested in clean energy technologies like solar power, wind power, and electric cars. David worked for nearly 30 years in Silicon Valley on software ranging from electronic mail systems, to video streaming, to the Java programming language, and has published several books on Node.js programming and electric vehicles.