Salesforce

Using ADB to Determine Package and Class Name

« Go Back

Information

 
Issue / QuestionHow 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 ToAndroid Devices
Resolution / Answer
NOTE Workforce Connect (WFC) is now known as Workcloud Communication. While efforts have been made to update references in this article, specific screen captures, paths and commands may still bear the former name.

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
URL NameUsing-ADB-to-Determine-Package-Name-and-Launchable-Activity
TitleUsing ADB to Determine Package and Class Name

Powered by