Skip to content

Instantly share code, notes, and snippets.

@yanowitz
Forked from phx/sms-to-csv.sh
Created July 8, 2020 00:19
Show Gist options
  • Save yanowitz/2c3515e54b46322bd105bddc23ee1387 to your computer and use it in GitHub Desktop.
Save yanowitz/2c3515e54b46322bd105bddc23ee1387 to your computer and use it in GitHub Desktop.
Dump iOS SMS/iMessage database to CSV.
#/bin/bash
# not an actual script - these are only commands, but the script would be basically the same.
# requires jailbroken iOS device
# get into the filesystem
ssh root:alpine@iphone
# update your package list, and install sqlite
apt-get update
apt-get install sqlite
# navigate to sms db directory
cd /var/mobile/Library/SMS
# drop the kids off at the pool
sqlite3 sms.db
# the following is for better illustration (the prompts will cause the "script" to fail):
sqlite> .mode csv
sqlite> .headers on
sqlite> .out message.csv
sqlite> select * from message;
# voila.
# write bash script using awk/grep and launchd (iOS/OSX crontab); sky's the limit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment