Skip to content

Instantly share code, notes, and snippets.

@mpwoz
Created July 27, 2026 18:05
Show Gist options
  • Select an option

  • Save mpwoz/78dea5c316632cf6ee553efd4a436f63 to your computer and use it in GitHub Desktop.

Select an option

Save mpwoz/78dea5c316632cf6ee553efd4a436f63 to your computer and use it in GitHub Desktop.
icloud message backup

on Windows:

run backup on icloud encrypt, since it gives more run .\imessage-exporter.exe -f html -c clone -a iOS -p "$env:USERPROFILE\Apple\MobileSync\Backup<device-id>" -o .\messages_export

on mac:

Install imessage exporter

either get latest release of imessage-exporter (apple version) https://github.com/ReagentX/imessage-exporter/releases/tag/4.2.0

or use Homebrew (easier, auto-updates): https://brew.sh/ brew install imessage-exporter

Create the backup file

make sure mac has enough disk space (~60GB) run df -h in a terminal Open Finder. Your iPhone appears in the left sidebar under Locations. Click it. On the General tab, choose "Back up all of the data on your iPhone to this Mac." Tick "Encrypt local backup" and set a password. Write it down/don't forget it, we'll need it later Click Back Up Now. This can take an hour or more and uses a lot of disk space

Give terminal permissions to read the backup directory

Open System Settings (the gear icon). Click Privacy & Security in the left sidebar. Scroll down and click Full Disk Access. Find Terminal in the list and switch it on. If Terminal isn't listed, click the + button, then go to Applications → Utilities → Terminal. It will ask you to quit and reopen Terminal. Do that — quit Terminal completely (Command + Q) and open it again.

Find the backup

Lists all backups, should hopefully be just one:

ls ~/Library/Application\ Support/MobileSync/Backup/ The name of this is the backup/device id, looks like 00008120-000A1B2C3D4E5F6G

Replace "PASTE-HERE" with your backup's id: imessage-exporter -f html -c clone -a iOS -o ~/Documents/My-Messages -p ~/Library/Application\ Support/MobileSync/Backup/PASTE-HERE

Read the backed up messages

There should now be a directory 'My-Messages' in your 'Documents' folder. Each thread is a separate file which opens in your browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment