2

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?

2
  • 1
    I think this may help: android.stackexchange.com/q/131188/186278
    – esQmo_
    Commented Jan 9, 2017 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
    Commented Jan 9, 2017 at 20:35

1 Answer 1

3

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

$ adb shell dumpsys display|grep mSafeMode
 mSafeMode=true

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .