Starting an activity listed under "Settings" from terminal (or adb shell) I would like to start this activity from terminal: com.android.settings.Settings$PowerUsageSummaryActivity

I tried

am start -S com.android.settings/.Settings$PowerUsageSummaryActivity


and this is what I get:

Stopping: com.android.settings
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.android.settings/.Settings }


The problem is am start command omits the $PowerUsageSummaryActivity part, so basically I'm just getting standard "Settings" menu open.
how can I open that specific "power usage summary" page from terminal?
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:


command: am
parameter 1: start
parameter 2: -S
parameter 3: com.android.settings/.Settings$PowerUsageSummaryActivity


has a $, interpreting: variable $PowerUsageSummaryActivity is not set, so empty
conclusion: parameter 3 is com.android.settings/.Settings



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'