Skip to content

lana-20/android-package-name

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 

Repository files navigation

Android App Package Name - 5 Ways to Retrieve It

Alternative 1 - Use aapt util

Screenshot 2023-03-02 at 10 15 31 PM

With access to the app source code, the package name can be found in the AndroidManifest.xml. If only the compiled .apk file is available, mobile testers can use the Android Asset Packaging Tool (aapt) to get the package name from the app.

appt is located in the build-tools folder of the installed Android SDK version.

The path to aapt may look as follows /Users/lana/Android/sdk/build-tools/33.0.1.

The following command reads out the package name from the .apk file:

% ./aapt d badging ~/TheApp.apk | grep 'pack'
package: name='com.appiumpro.the_app' versionCode='2003' versionName='2.0' platformBuildVersionName='11' platformBuildVersionCode='30' compileSdkVersion='30' compileSdkVersionCodename='11'

Alternative 2 - Use adb shell pm util

  • adb shell pm list packages - returns a list of packages installed on the device
  • adb shell pm list packages -f <app_name> - returns the package for the specific app
  • adb shell pm list packages -3 - returns 3rd-party packages that were installed from the Play Store or as an .apk (not pre-installed/pre-loaded by OEMs)

Alternative 3 - Use adb shell dumpsys util

First start the app to ensure that it's running on the foreground, then execute this command:

% adb shell dumpsys window windows | grep 'mCurrentFocus'
mCurrentFocus=Window{2c0df8a u0
com.my_app.standalone.test2/com.the_app.standalone.features.auth.AuthActivity}

Alternative 4 - Use apkanalyzer util

% apkanalyzer -h manifest application-id ./ApiDemos.apk
io.appium.android.apis

Alternative 5 - Download the Apk Info app from the Play Store. Use it to view the AUT's package and activity names.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published