Browse files (including SQLite databases) on your iPhone with ifuse

I spotted an intriguing note in the release notes for osxphotos 0.51.7:

Added ability to read Photos.sqlite from iPhone

This lead me to osxphotos issue #745 which lead me to How to access iPhone files with a disk mount which lead me to ifuse and homebrew-fuse .

Here's what worked for me.

  1. Connect the iPhone to a Mac using a USB-C to Lightning cable
  2. Find the serial number of your iPhone, by running system_profiler SPUSBDataType -detailLevel mini | grep -e iPhone -e Serial and looking for the first number. It will look something like 00008110001631C105BA801E.
  3. Add a hyphen to that serial number after the 8th character: 00008110-001631C105BA801E - you will need this later
  4. brew install macfuse
  5. brew install gromgit/fuse/ifuse-mac
  6. A tricky bit: this has installed an unsigned binary, which macOS really doesn't want to execute. So...
  7. mkdir /tmp/iPhone
  8. ifuse /tmp/iPhone --udid 00008110-001631C105BA801E - using the serial number you figured out earlier
  9. This should fail with an error complaining about the unsigned binary
  10. Open System Preferences -> Security & Privacy and allow that binary to run. You may then need to restart your computer.
  11. After the reboot, mkdir /tmp/iPhone again.
  12. Now try ifuse /tmp/iPhone --udid 00008110-001631C105BA801E again - this time it should work

If everything goes right, you can run open /tmp/iPhone to open a Finder window showing at least some of the contents of your phone. You can also cd /tmp/iPhone to start poking around from the terminal.

Finding SQLite databases

The easiest way to find SQLite databases to explore is to run:

find /tmp/iPhone | grep 'wal'

This searches for files with names like downloads.28.sqlitedb-wal - which indicate a SQLite database that has been opened in WAL mode.

On my iPhone I get these:


You can then open them in Datasette by specifying the filename without the -wal extension. For example:

datasette /tmp/iPhone/Radio/Radio.db

Created 2022-09-13T21:03:15-07:00, updated 2022-09-13T21:33:31-07:00 · History · Edit