How to Export Android SMS and Call Logs to CSV Using ADB (No Root)

11 min read Learn how to safely extract SMS messages and call logs from any Android phone to CSV files using ADB, without rooting the device. October 13, 2026 19:30 How to Export Android SMS and Call Logs to CSV Using ADB (No Root)

Before you start

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.

  • Computer running Windows, macOS, or Linux.
  • USB‑C or micro‑USB cable (the one that came with the phone works best).
  • Android device with Developer options enabled.
  • At least 100 MB of free disk space for the CSV files.

Step 1 – Install the Android SDK Platform‑Tools

  1. Visit the official Android developer page for Platform‑Tools and download the ZIP for your OS.
  2. Extract the ZIP to a folder you can remember, e.g., C:\adb on Windows or ~/adb on macOS/Linux.
  3. Optional but recommended: add the folder to your system PATH so you can run adb from any terminal window.

Step 2 – Enable Developer options and USB debugging

  1. Open Settings on the phone.
  2. Scroll down to About phone (or System > About phone on some OEM skins).
  3. Find Build number and tap it seven times. You should see a toast saying “You are now a developer!”.
  4. Return to the main Settings screen; a new entry called Developer options will appear.
  5. Enter Developer options and toggle USB debugging on. Confirm any security prompt that appears.
  6. If you see a “USB debugging is enabled” dialog, tap OK. On Android 12+ you may also need to enable USB debugging (Security settings) for full access.

Step 3 – Verify the ADB connection

  1. Connect the phone to the computer with the USB cable.
  2. On the phone, you may be asked to Allow USB debugging for this computer. Tick “Always allow from this computer” and tap Allow.
  3. Open a terminal (Command Prompt, PowerShell, Terminal, etc.) and run:
    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.
  4. If no devices are listed, try a different cable or USB port, and make sure the phone is in “File Transfer” (MTP) mode rather than “Charging only”.

Step 4 – Pull the raw SQLite databases

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.

  1. In the terminal, create a temporary folder to hold the raw files:
    mkdir ~/adb-export && cd ~/adb-export
  2. Run the following commands to pull the databases. The exact package names are the same on all Android versions:
    adb 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
  3. On devices that enforce stricter SELinux policies, you may need to prepend 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.

Step 5 – Convert the databases to CSV

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.

  1. If you are on Windows and don’t have sqlite3.exe, download it from sqlite.org and place the executable in the same folder as the pulled .db files.
  2. Open a terminal in the folder containing sms.db and contacts2.db.
  3. Export SMS messages:
    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.
  4. Export call logs (they live in the 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.

Step 6 – Human‑readable formatting

The raw CSV files contain timestamps in milliseconds and numeric type codes. A quick spreadsheet or a tiny Python script can make them readable.

  1. Open the CSV files in LibreOffice Calc, Microsoft Excel, or Google Sheets.
  2. Create a new column called Readable Date and use a formula to convert the epoch. In Excel:
    =(((A2/1000)/60)/60)/24+DATE(1970,1,1)
    Replace A2 with the cell containing the raw date value.
  3. Replace the numeric type column with text using a lookup table (e.g., 1 → “Received”, 2 → “Sent”).
  4. Save the cleaned version as sms_exported.csv and calls_exported.csv. You now have portable, searchable records of your messages and call history.

Alternative method – Using a temporary backup (no root, no run‑as)

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.

  1. Run the backup command (you will see a confirmation dialog on the phone):
    adb backup -noapk -nosystem -f sms_backup.ab com.android.providers.telephony com.android.providers.contacts
  2. Install the open‑source abe tool (GitHub) to unpack the .ab file:
  3. java -jar abe.jar unpack sms_backup.ab sms_backup.tar
  4. Extract the tar archive:
    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.

Troubleshooting common issues

  • “Permission denied” when pulling /data/... files – Verify that USB debugging is allowed for this computer. If the device runs Android 10+ with “Scoped storage”, run-as may be disabled. Use the backup method above.
  • Device shows as “unauthorized” – Re‑plug the cable, revoke USB debugging authorizations in Developer options > Revoke USB debugging authorizations, then reconnect and accept the prompt again.
  • CSV file is empty or missing columns – Ensure you are pulling the correct database file. Some manufacturers rename the SMS DB (e.g., mmssms.db vs sms.db). Use adb shell ls /data/data/com.android.providers.telephony/databases/ to list available files.
  • SQLite command fails: “no such table: sms” – The database schema changed on Android 11+. Try querying the sms view instead:
    sqlite3 sms.db "SELECT address, date, type, body FROM sms_view;"
  • Phone battery drains quickly after enabling USB debugging – Disable USB debugging when you are done. It is a good security habit to keep it off unless needed.

Safety and privacy considerations

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.

What to do with the exported data

Once you have clean CSV files you can:

  • Import them into a personal finance or CRM system to track communication.
  • Search for a specific message or call without scrolling through the phone UI.
  • Archive them for legal or compliance reasons (e.g., for small businesses).
  • Port the data to a new device by importing the CSV into a messaging app that supports import (rare, but some third‑party apps do).

Wrap‑up

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.

User Comments (0)

Add Comment
We'll never share your email with anyone else.