You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在命令提示符中使用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: Lowercase shell tells ADB to execute a command directly on your connected Android device.
  • rm /data/system/password.key: Lowercase rm (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 devices in 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 /data partition with mount /data before 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 10:12:50