How to identify Activity name and start the activity of installed app

This posts lets you identify name of the activity from the installed application and then use the package name and activity name to start the applications Activity.

List all the installed applications using

$ adb shell pm list packages -f

From this above command, you will get the path and apk name of application you want to analyse to find out the launchable activity name.

Pull the apk using path listed in above command,

$ adb pull "apk_path/apk_name.apk" . 
$ aapt dump badging apk_name.apk

You will see a message like, launchable-activity: name=’package_name.MainActivity’ in output of “aapt”

For example, if we consider our application apk

$ aapt dump badging myApplication.apk | grep launchable-activity
launchable-activity: name='com.example.myapplication.MainActivity'  label='' icon=''

As we can see, it printed the launchable activity as “com.example.myapplication.MainActivity” of which package name as “com.example.myapplication” and activity name is “MainActivity”

Now, we can use this same activity name from adb command line to launch the activity as,

$ am start -n com.example.myapplication/com.example.myapplication.MainActivity 
TeamViewer Install and Uninstall (P... x
TeamViewer Install and Uninstall (PowerShell)

Leave a Comment

Sign up to our newsletter!

ADB Commands Android Android Applications Android Build system Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development, Debugging and Performance Tools Development and Build Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia NDK / Middleware / HAL Operating System Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web Design and Development Website Hosting Wordpress Yocto Embedded Linux