Skip to content

Instantly share code, notes, and snippets.

@bf4648
Forked from duncansmart/ios-sms.sql
Created January 29, 2021 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bf4648/6a51a0ccd6b1aec558a77430a0213153 to your computer and use it in GitHub Desktop.
Save bf4648/6a51a0ccd6b1aec558a77430a0213153 to your computer and use it in GitHub Desktop.
Query to extract iOS Messages from backup
-- Do a backup to iTunes and open "%APPDATA%\Apple Computer\MobileSync\Backup\*\3d0d7e5fb2ce288813306e4d4636395e047a3d28" as a SQLite database
SELECT chat.chat_identifier, message.is_from_me, datetime(message.date + 978307201, 'unixepoch') as date, message.text
FROM chat
JOIN chat_message_join on chat.ROWID = chat_message_join.chat_id
JOIN message on message.ROWID = chat_message_join.message_id
order by message.date
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment