Receiving "Unknown id: disable" from ADB

by Slurms   Last Updated May 16, 2018 14:11 PM

I attempted to apply the following command through ADB...

adb shell su -c pm disable$Receiver

But when I enter the command, I receive the following "Unknown id: disable"

What does this mean?

Tags : adb

Answers 1

I didn't test that, but you didn't quote the command – so su -c just got the command pm to execute, while everything behind that got passed as additional parameters to adb shell. And shell doesn't know anything about "disable".

adb shell su -c "pm disable$Receiver"

should fix that – and pass the complete command (-c stands for "execute command") to su as one parameter.

Notes from the comments:

Despite of using quotes, you might still get some "unknown id" errors here or there – e.g. as m0skit0 reports (in now deleted comments) for adb shell su -c "mkdir /system/priv-app/CoreService" the error Unknown id: /system/priv-app/CoreService. In such cases, play with the quotes: some systems prefer double-quotes, other single quotes, again other are impartial.

And in some cases it seems necessary to use a kind of "section quoting" – so m0skit0's solution was adb shell "su -c 'mkdir /system/priv-app/CoreService'" (with the sections mkdir /system/priv-app/CoreService (the command to run – parameter to su) single-quoted, the su -c plus that section double-quoted (parameter to adb shell)).

July 07, 2014 13:07 PM

Related Questions