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.

Checked against AOSP, toybox and kernel sources while writing the parsers behind our Web ADB tools. Where a behaviour genuinely varies by Android version or manufacturer, this page says so instead of giving a number that would be wrong on half the phones out there.

Frequently asked questions

How do I run an adb shell command?

Switch on developer options and USB debugging on the phone, plug it in, then run adb shell <command> from a machine with platform-tools installed — or run adb shell on its own to get an interactive prompt and type the command without the prefix. If the command produces binary output, such as a screenshot, use adb exec-out instead of adb shell: the plain shell service attaches a terminal, which rewrites newline bytes and corrupts the data.

Do adb shell commands need root?

Not the ones on this reference. They run as the shell user, which can manage packages for its own Android user, read most dumpsys services, write the settings provider, inject input and read shared storage. Root is only needed for things this reference deliberately avoids — reading another app's private data (except through run-as on a debuggable build), writing system partitions, or reading /data/anr directly.

Why does the output look different on my phone?

Either the Android version or the manufacturer. Some flags and fields arrived in a specific release, and those are noted per command. The rest is OEM patching, which hits dumpsys hardest: a dump is debug output whose text is whatever the service author last printed, and manufacturers change it and backport their changes. Read fields by name rather than by position, and treat an unfamiliar shape as a difference rather than as a failure.

Can I run this from a browser instead of a terminal?

For many commands, yes — the Web ADB tools on this site talk to a phone over WebUSB from a Chromium-based desktop browser, with no SDK installed and nothing uploaded. Each page links to the tool that runs its command, when one exists. Two limits are worth knowing: only one program can hold the ADB interface at a time, so a desktop adb server has to be stopped first, and adb forward and adb reverse cannot work in a browser at all.

Would rather click than type? The Web ADB Toolkit runs commands like this from a browser over USB. Or browse every command.