For example, I want to start Gmail in code/command line, but I don\'t know its main activity name.
am start -n com.google.android.gm/.XXXXX
This can be found in the application's manifest.
The main activity is the activity with the intent-filter whose name is android.intent.action.MAIN.
activity
intent-filter
android.intent.action.MAIN