Skip to content

Lock Settings Management


Checks whether lock screen is disabled
adb shell cmd lock_settings get-disabled --old 1234
Clears the lock credentials
adb shell cmd lock_settings clear --old 1234 --user 0 
Gets whether synthetic password is enabled
adb shell cmd lock_settings sp --old 1234
Enables synthetic password
adb shell cmd lock_settings sp --old 1234 --user 0 1
Disables synthetic password
adb shell cmd lock_settings sp --old 1234 --user 0 0
Verifies the lock credentials
adb shell cmd lock_settings verify --old 1234 --user 0 
Removes cached unified challenge for the managed profile
adb shell cmd lock_settings remove-cache --user 0 
Sets the lock screen as password, using the given PASSWORD to unlock
adb shell cmd lock_settings set-password --old 1234 --user 0 'newPassword'
Sets the lock screen as PIN, using the given PIN to unlock
adb shell cmd lock_settings set-pin --old 1234 --user 0 'newPin'
Sets the lock screen as pattern, using the given PATTERN to unlock
adb shell cmd lock_settings set-pattern --old 1234 --user 0 'newPattern'
When true, disables lock screen
adb shell cmd lock_settings set-disabled --old 1234 --user 0 true
When false, enables lock screen
adb shell cmd lock_settings set-disabled --old 1234 --user 0 false
SQLite3 Update Locksetting
adb shell sqlite3 /data/system/locksettings.db "UPDATE locksettings SET value = '1' WHERE name = 'lockscreen.disabled'"
adb shell sqlite3 /data/system/locksettings.db "UPDATE locksettings SET value = '0' WHERE name = 'lockscreen.password_type'"
adb shell sqlite3 /data/system/locksettings.db "UPDATE locksettings SET value = '0' WHERE name = 'lockscreen.password_type_alternate'"
adb shell sqlite3 /data/system/locksettings.db "UPDATE locksettings SET value = '1' WHERE name = 'lockscreen.disabled'"
Resource(s)