How to Launch an Activity via ADB Commands

In this guide, we will show you the steps to launch an activity via ADB Commands. It’s no hidden secret that the easiest way to launch an activity is via a third-party app like Activity Launcher. Just choose the app from the list and tap on the desired activity and it will be opened right away. Well, you can even create its shortcut on the home screen and launch the activity as an app in just a single tap.

So why would anyone then use an ADB Command? Well, glad you asked this question, but to be frank, even I don’t have a concrete reason for the same, apart from the fact that it’s always better to have an alternate method at hand. Moreover, if you are not a fan of using third-party apps for these tasks, then this CLI approach is your go-to method. So, on that note, let’s show you the steps to get this job done right away.

How to Launch an Activity via ADB Commands

launch activity adb commands - 1
  1. First off, download and extract Android SDK Platform Tools on your PC.
  2. Then enable USB Debugging and connect the device to the PC via a USB.
  3. After that, get hold of the app package name using any of these methods .
  4. If you don’t know the Activity Name, then use the Activity Launcher app.
  5. Now open Command Prompt inside the platform-tool folder and type in adb shell am start -n app.package.name/Activity_Name
  6. Make sure to replace app_package_name and Activity Name accordingly.

For example, I want to launch the Phone Information menu, then it’s App package name is com.android.settings and its active name will be its class [see above image], which is com.android.settings.Settings$TestingSettingsActivity. So, putting these values in the above command, it transforms to:

 adb shell am start -n com.android.settings/com.android.settings.Settings$TestingSettingsActivity
  • How to Prevent an Android Device from Sleeping via ADB Command
  • How to Enable Allow From Unknown Sources via ADB Commands
  • Edit Touch and Hold Delay Timings on Android via ADB Commands
  • Expand and Collapse Notifications on Android via ADB Commands
Google preferred - 2 Google preferred - 3

(Cancel Reply)

Δ