在命令提示符中使用ADB执行命令时遭遇“unknown command SHELL”错误
Fixing the "adb: usage: unknown command SHELL" Error
Hey there, let's get this ADB command working for you. The error you're seeing stems from simple syntax missteps, plus a few setup checks you'll want to confirm. Here's how to resolve it step by step:
1. Fix the Command Syntax
Your original command uses uppercase SHELL and RM, which is why ADB throws the "unknown command" error—ADB expects its subcommands to be lowercase, and Linux shell commands (like rm) are case-sensitive on Android's file system.
Correct Command
adb shell rm /data/system/password.key
adb shell: Lowercaseshelltells ADB to execute a command directly on your connected Android device.rm /data/system/password.key: Lowercaserm(the Linux "remove" command) targets the proper lowercase system path (Android's file system won't recognize uppercase paths here).
2. Verify Prerequisites
Before running the command, make sure these boxes are checked:
- USB Debugging Enabled: On your Android device, go to Settings > Developer Options > USB Debugging and toggle it on. If you don't see Developer Options, go to Settings > About Phone and tap Build Number 7 times to unlock it.
- Device Connected & Authorized: Run
adb devicesin your command prompt—you should see your device listed with "device" next to it. If it says "unauthorized", check your device's screen for a permission prompt and grant access to your computer. - Root Access or Recovery Mode: This command requires your device to be rooted, or you need to run it from recovery mode. If using recovery, you may first need to mount the
/datapartition withmount /databefore deleting the file.
3. Post-Execution Steps
After running the correct command:
- Reboot your device. The lock screen password will be cleared, but note that you'll need to re-setup biometric unlocks (fingerprint, face recognition) since they’re tied to the password data you just removed.
内容的提问来源于stack exchange,提问作者Deven
相关产品推荐
相关产品推荐

