Starting an activity via adb (2024)

With adb (Android Debug Bridge) you can perform several tasks on a connected device (or emulator).

Today we are having a look at how you can start an activity from command line.

You can use the start command from Activity Manager (am) a.k.a the adb shell am start -n command (via adb) specifying the app package name and the component name as defined in the manifest.

For instance suppose the component name is .MainActivity and the package name is it.sendto.android.client

The complete command will be:

adb shell am start -n it.sendto.android.client/.MainActivity

You can add other parameters like ACTION (-a android.intent.action.MAIN) and CATEGORY (-c android.intent.category.LAUNCHER).

For a complete list of parameters refer to the official docs.

This story is also available on xabaras.it (in Italian)

Starting an activity via adb (2024)
Top Articles
Latest Posts
Article information

Author: Terrell Hackett

Last Updated:

Views: 5825

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Terrell Hackett

Birthday: 1992-03-17

Address: Suite 453 459 Gibson Squares, East Adriane, AK 71925-5692

Phone: +21811810803470

Job: Chief Representative

Hobby: Board games, Rock climbing, Ghost hunting, Origami, Kabaddi, Mushroom hunting, Gaming

Introduction: My name is Terrell Hackett, I am a gleaming, brainy, courageous, helpful, healthy, cooperative, graceful person who loves writing and wants to share my knowledge and understanding with you.