Using ADB to Determine Package Name and Launchable Activity

Article ID: 92392356

Issue / Question

How to find out the Android Package (APK) or application package name to configure in Enterprise Home Screen auto-launch?

How do I determine Android application launchable activity?

How do I determine the APK name for StageNow package deployment?

Applicable To

Android Devices

Resolution / Answer

Overview

Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you can use to run a variety of commands on a device. Refer to Android Debug Bridge (adb) User Guide for more information.
 

Package name

Procedure:
 

  1. Setup and configure ADB. Refer to the article: Setup and configure to use ADB for Zebra Android devices for more information.
  2. Type in the following command to list all packages and their associated files. 
adb shell pm list packages
  1. If you wish to export the list for easy viewing, use the following command.
adb shell pm list packages > your_text_file_name.txt
  1. To filter the output based on the package name, use the command shown below.
adb shell [enter]
pm list packages |grep zebra
  1. To list only 3rd party applications, use the following command.
adb shell pm list packages -3

 


Class name

Once the package name has been found, for example, com.symbol.wfc.voice, the class name of the main activity has to be determined.

Procedure:
 

  1. To find all activities published by a package, use the following command and replace com.symbol.wfc.voice by the name of the package to process.
adb shell [enter]
dumpsys package | grep -Eo "^[[:space:]]+[0-9a-f]+[[:space:]]+com.symbol.wfc.voice/[^[:space:]]+" | grep -oE "[^[:space:]]+$"
  1. The output may list one or more activities. If multiple activities are listed, try to guess the main activity or test one by one using the am start command.
adb shell [enter]
am start -n com.symbol.wfc.voice/.CallStarterActivity

+ Applicable Products

  • MC3300
  • MC40
  • MC67 NA Mobile Computer
  • MC9200 Mobile Computer
  • TC20
  • TC25
  • TC51
  • TC55 Touch Computer
  • TC56
  • TC70x
  • TC75
  • TC75x
  • TC8000
  • VC80X
  • WT6000 Wearable Terminal