Is it possible to use adb to detect whether a device is booted into "Safe Mode" or normal mode?

I've looked through the output of getprop and other command-line tools and haven't found any good indicator of safe mode, at least not on my N5/hammerhead device.

Update: I'm trying to check whether or not the device is in Safe Mode, not to force it into Safe Mode. Putting the device in Safe Mode programmatically is relatively straightforward and well-documented.

Any ideas?

  • 1
    I think this may help: android.stackexchange.com/q/131188/186278 – esQmo_ Jan 9 '17 at 18:13
  • Thanks, that explains how to force a device to be in Safe Mode using adb… but it doesn't explain how to detect if it's in Safe Mode. – Dan Jan 9 '17 at 20:35

Aha! This'll do the trick! Android's dumpsys display command:

$ adb shell dumpsys display|grep mSafeMode
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.