ByteScope

settings get

read-only

Reads one value out of the phone's settings provider.

Command
adb shell settings get
Commands
Settings provider
Risk
read-only

Syntax

settings get <system|secure|global> <key>

Flags and arguments

TokenMeaning
system | secure | globalWhich namespace the key lives in. There are three, they are separate tables, and reading the wrong one returns nothing rather than an error.

Examples

  • settings get global http_proxy

    Check whether the phone is pointed at a debugging proxy.

  • settings get global window_animation_scale

    Read a value before you change it, so you have something to put back.

  • settings get system show_touches

    A `system` key, to show that the namespace is not always `global`.

Reading the output

Sample output

null

One line: the value, or the four characters `null`. `null` is a real answer and not a failure — most developer switches are simply unset on a fresh phone, and their effective value is the platform default rather than anything stored. Anything longer than one line is not a value; it is an error the shell merged into the output.

Output fields

FieldMeaning
<value>What is stored, as text.
nullThe key is not set. The platform default applies.
(a stack trace)The read was refused. Not a value.

What access it needs

No root, and no `adb root`. `settings` is a one-line shell script that runs `cmd settings "$@"` (AOSP `cmds/settings/settings.sh`), so the read is answered with the identity of the `shell` user at the other end of an authorised `adb` connection, and reading is by far the cheap half of this family's permission story: the write side leans on `android.permission.WRITE_SECURE_SETTINGS`, while a plain read of a `system`, `secure` or `global` key needs nothing the shell is short of. Nothing here sits behind a developer-options toggle beyond USB debugging itself. Two details decide whether you can trust a short answer. The value is printed with `pout.println(...)` on the out stream, while every complaint the argument parser makes — a mistyped namespace, one stray extra word — is printed on the err stream and the command returns -1 without reading anything at all; discard stderr and a rejected command becomes a blank line that looks exactly like an unset key. And the user is resolved before the read: with no `--user`, the command asks the activity manager for the current user and reads that user's tables, so a phone with a work profile can answer the same `secure` key two different ways depending on who is in the foreground.

Failure messages, decoded

MessageMeaning
Invalid namespace 'globl'The first positional argument was not `system`, `secure` or `global`. The comparison is case-insensitive, so `Global` is fine and only a real typo lands here. Parsing stops and the command returns -1, so nothing was read — this is not the same as a key that is missing, even though both leave you with no value. The line goes to stderr.
Invalid command: gettThe verb was not one of `get`, `put`, `delete`, `list` or `reset`. Also what you get if you put an option in the wrong place, because the parser expects the verb before anything except `--user`. Nothing was read.
Bad argumentsThe parser reached the end of the command line without ever having assembled a complete request — `settings get global` with no key is the everyday cause. It is the catch-all: it names nothing, so re-read the whole line rather than the last word.
Too many argumentsFor `get`, the key is the last thing accepted; anything after it is refused outright. This is what an unquoted key containing a space produces, and it is a mercy — the alternative would have been reading the first word and calling it an answer.
cmd: Can't find service: settings`cmd` could not find the `settings` service to hand the subcommand to, because `settings.sh` is only a wrapper around `cmd settings`. Expected while the device is still booting, before `system_server` has published it — wait for boot to finish rather than treating it as a missing key.

Version and vendor notes

  • Getting the namespace wrong is silent: the key is simply absent in the table you asked. There is no error to notice.
  • Read before you write. The platform does not remember the previous value for you, so this command is the only way to know what to restore.

We have a UI for this

Android ADB Toolbox runs this command over USB and parses what comes back — a Chromium browser, no SDK, nothing uploaded.

Open Android ADB Toolbox

Related commands

Commands that turn up in the same session as settings get.

CommandWhat it does
settings putWrites a value into the settings provider — the mechanism behind most developer-options tricks.
getpropPrints the system properties — the phone's own answer to what it is.
am broadcastSends a broadcast intent, which is how SystemUI demo mode and other platform receivers are driven from a shell.

Running these commands, when they need root, why output differs between phones and running them from a browser are covered once in the adb shell command reference.