Exporting SMS messages and call logs with ADB does not require root, but it does need a computer, a USB cable, and a little patience. The process works on Android 6.0 (Marshmallow) and newer, though the exact menu names can differ slightly between manufacturers. Make sure you have a stable USB connection and enough free space on your computer to store the CSV files.
Why ADB? ADB (Android Debug Bridge) is a command‑line tool that talks directly to the device over USB. It can pull data from the internal databases that store SMS and call logs, letting you export them in a readable format without touching the phone’s UI.
C:\adb on Windows or ~/adb on macOS/Linux.PATH so you can run adb from any terminal window.adb devices
You should see a line with the device’s serial number and the word device. If you see unauthorized, double‑check the prompt on the phone.
SMS and call logs are stored in SQLite files inside the protected /data/data/ directory. ADB can copy them out because the run-as command lets us act as the system user for read‑only access.
mkdir ~/adb-export && cd ~/adb-exportadb pull /data/data/com.android.providers.telephony/databases/mmssms.db sms.db
adb pull /data/data/com.android.providers.contacts/databases/contacts2.db contacts2.db
run-as:
adb shell "run-as com.android.providers.telephony cat /data/data/com.android.providers.telephony/databases/mmssms.db" > sms.db
adb shell "run-as com.android.providers.contacts cat /data/data/com.android.providers.contacts/databases/contacts2.db" > contacts2.db
If you get a “Permission denied” error, try the run-as variant; if that also fails, your device may have disabled run-as. In that case, proceed to the alternative method in the troubleshooting section.We will use the free command‑line tool sqlite3, which is bundled with the Platform‑Tools on macOS/Linux and can be installed on Windows via the official SQLite package.
sqlite3.exe, download it from sqlite.org and place the executable in the same folder as the pulled .db files.sms.db and contacts2.db.sqlite3 sms.db "SELECT address, date, type, body FROM sms;" > sms_raw.csv
The address column holds the phone number, date is a Unix epoch in milliseconds, type indicates inbound/outbound (1 = received, 2 = sent), and body is the message text.calls table of contacts2.db):
sqlite3 contacts2.db "SELECT number, date, duration, type FROM calls;" > calls_raw.csv
The type values map as follows: 1 = incoming, 2 = outgoing, 3 = missed, 4 = voicemail, 5 = rejected.The raw CSV files contain timestamps in milliseconds and numeric type codes. A quick spreadsheet or a tiny Python script can make them readable.
=(((A2/1000)/60)/60)/24+DATE(1970,1,1)
Replace A2 with the cell containing the raw date value.
type column with text using a lookup table (e.g., 1 → “Received”, 2 → “Sent”).sms_exported.csv and calls_exported.csv. You now have portable, searchable records of your messages and call history.Some OEMs lock down run-as. If you cannot pull the databases directly, you can create a temporary backup with adb backup and extract the files from the resulting .ab archive.
adb backup -noapk -nosystem -f sms_backup.ab com.android.providers.telephony com.android.providers.contacts
abe tool (GitHub) to unpack the .ab file:java -jar abe.jar unpack sms_backup.ab sms_backup.tar
tar -xf sms_backup.tar
You will find the same mmssms.db and contacts2.db files inside the extracted folder. Continue with Step 5 to convert them to CSV.run-as may be disabled. Use the backup method above.mmssms.db vs sms.db). Use adb shell ls /data/data/com.android.providers.telephony/databases/ to list available files.sms view instead:
sqlite3 sms.db "SELECT address, date, type, body FROM sms_view;"Exported SMS and call logs contain personal contact information. Store the CSV files in an encrypted folder or a password‑protected archive if you intend to keep them for a long time. Deleting the original .db files from your computer does not affect the phone’s data; they are copies.
Once you have clean CSV files you can:
Using ADB you can safely export SMS and call logs to CSV without rooting your Android phone. The workflow—install Platform‑Tools, enable USB debugging, pull the SQLite databases, and convert them with sqlite3—works on the vast majority of devices. When direct access is blocked, the adb backup fallback lets you achieve the same result. Always keep the exported files secure, and remember to turn off USB debugging when you’re finished.









