What is the use of -n while starting activity using adb shell am start command

Issue

We can able to launch activity using the following adb shell command.

adb shell am start -n <PackageName>/<ActivityName>

But some of apps the above command is not working, we need to remove “-n” option from the above command. Like following.

adb shell am start <PackageName>/<ActivityName>

What is the use of “-n” option? why sometimes we can not able to launch app using “-n” option?

Solution

According to Specification for intent arguments:

-n component

Specify the component name with package name prefix to create an explicit intent, such as com.example.app/.ExampleActivity.

Answered By – tcardoso

Leave a Comment