When you change a lot of preferences on a new Android phone – display size, ringtone, developer options, notification channels – you quickly realize there’s no single “export settings” button. The next time you flash a new ROM or reset the device, you have to recreate those tweaks manually.
settings database using the Android Debug Bridge (ADB), edit it on a PC, and push it back – all without rooting the phone.ADB runs with the android.permission.DUMP privilege when you enable USB debugging. That privilege lets the bridge read the settings provider (the SQLite database that stores system, secure, and global settings). Because the provider is exposed through a content URI, ADB can query it and write a copy to the local filesystem. No super‑user rights are required, but you do need to be careful: overwriting the database with an incompatible version can render the device unbootable.
adb executable is the only required binary.adb devices. You should see the device listed as device, not unauthorized.adb shell "mkdir -p /data/local/tmp/settings_backup && cp /data/data/com.android.providers.settings/databases/* /data/local/tmp/settings_backup/"
adb pull /data/local/tmp/settings_backup ./android-settings-backup
This creates a folder android-settings-backup containing settings.db, settings.db-wal, and settings.db-shm.
ls ./android-settings-backup
You should see the three files listed.
What you should see: The folder now holds a faithful copy of the device’s settings database. You can open settings.db with any SQLite viewer (e.g., DB Browser for SQLite).
Most users simply back up the file and restore it later, but the real power comes from editing specific keys.
settings.db in your SQLite viewer.system, secure, and global. Each row is a name / value pair.
value column and save the file. Example: set screen_off_timeout from 30000 (30 s) to 120000 (2 min).
UPDATE system SET value='120000' WHERE name='screen_off_timeout';
adb shell settings put directly (see the “quick edit” box below) instead of editing the DB file.ADB already provides a settings command that can read or write individual keys. Use this when you know exactly which setting you want to change.
# Read a value
adb shell settings get system screen_off_timeout
# Write a new value (value must be a string or integer)
adb shell settings put system screen_off_timeout 120000
This method is faster but does not give you a full backup.
adb shell "pm disable com.android.providers.settings"
This disables the provider temporarily; it will be re‑enabled later.
adb push ./android-settings-backup/settings.db /data/local/tmp/settings_backup/
Repeat for the -wal and -shm files if you edited them.
adb shell "cp /data/local/tmp/settings_backup/* /data/data/com.android.providers.settings/databases/ && chown system:system /data/data/com.android.providers.settings/databases/* && chmod 660 /data/data/com.android.providers.settings/databases/*"
adb shell "pm enable com.android.providers.settings"
adb shell "am broadcast -a android.intent.action.ACTION_SETTINGS_CHANGED"
adb reboot
What you should see after reboot: All the settings you edited should be applied. For example, the screen timeout will now stay on for two minutes, and any secure flag you changed (e.g., allowing installations from unknown sources) will reflect the new state in the Settings UI.
adb shell settings get command to read back a specific key:
adb shell settings get system screen_off_timeout
If the cp or chmod commands fail with “Permission denied”, your device may be running a hardened OEM ROM that blocks access to /data/data/com.android.providers.settings even with ADB. In that case, you have two options:
settings put command for each key instead of pushing the whole DB.android.permission.WRITE_SECURE_SETTINGS permission via adb shell pm grant on devices that allow it (usually only on userdebug builds).Detach and re‑attach the USB cable, then accept the RSA fingerprint prompt on the phone. If the prompt does not appear, go to Settings → Developer options and toggle USB debugging off and on.
This usually means the DB file is corrupted or the SQLite version on the device differs from the one you edited with. To recover:
adb shell rm /data/data/com.android.providers.settings/databases/settings.db to delete the faulty file.adb shell settings put instead of a full DB push.Some values are cached in memory. After pushing the DB, you can clear the cache for the Settings app:
adb shell pm clear com.android.providers.settings
Then reboot.
android_id in the secure table if you plan to keep the same Google account, then import on the new device.settings.db in version control. When you flash a fresh ROM, push the profile to get your preferred UI instantly.adb_enabled or development_settings_enabled can expose your device to unintended remote control.settings.db on your PC. If something goes wrong, you can restore it using the same push procedure.With the steps above you now have a reliable, no‑root workflow to back up, tweak, and restore Android system settings using ADB. The method works on most stock Android devices from Android 7 (Nougat) onward, and it can be adapted for OEM skins with minor path adjustments. By keeping a personal settings backup, you eliminate the tedious manual re‑configuration after a factory reset, ROM flash, or device migration – saving time and preserving your preferred user experience.









