As I wrote in my comment, there are some special characters needing extra care when working at the shell prompt (or in shell scripts). One of them is the
$ sign, which usually indicates a variable. If that should be taken literally, you need to escape it (or enclose the entire string by single quotes). Similar rules for quotation marks.
How your command should look like with an escaped
$, you can already find in eldarerathis' answer:
shell@android:/ # am start -n com.android.settings/.Settings\$PowerUsageSummaryActivity
Note the "back-slash" in front of the
$ -- that's the escape sign. Use the same for quotation marks or blanks, if your command includes some to be taken literally, e.g.
myscript.sh first\ parameter\!
myscript.sh "first parameter!"
both would do the same: Making the string a single parameter. In the example of your
am start command, this is what happened on parsing:
- parameter 1:
- parameter 2:
- parameter 3:
- has a
$, interpreting: variable
$PowerUsageSummaryActivity is not set, so empty
- conclusion: parameter 3 is
Note also that if you run this directly via
adb shell, the command goes through shell parsing twice, so you need to escape or quote the command again, like this:
user@desktop:~$ adb shell am start -n 'com.android.settings/.Settings\$PowerUsageSummaryActivity'