Many times we need to get the APK file of an application that has a cool feature on the Play Store but it is not available on APK download sites like APKCombo, APKPure ? In this article, I will show you tips to get these files.
Where are the APK files of the installed application located? All APK files of the apps that you install on your phone, whether from the official Google, Samsung, Huawei store or from an internet source will be saved in the /data/app folder. This directory is completely accessible without root privileges. The permissions on this directory are specified as rwxrwx–x. Does this mean you can read content from it but lack the ability to see what directories and subfiles it has? So to access it, you need to know the names of the files you want to access. Android package manager will help you get the name of the APK files that are saved for each package.
Get a list of package names ?
These package names are the package names of the application. To get a list of the package names of all the applications installed on the device, run the following command
1 2 | adb shell pm list packages |
Note: For simplicity, only one device is allowed to be connected to the computer and debug mode is enabled.
Now a list of package names will appear:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ❯ adb shell pm list packages package:com.google.android.networkstack.tethering package:com.google.omadm.trigger package:com.google.android.carriersetup package:com.android.cts.priv.ctsshim package:com.google.android.youtube package:com.vzw.apnlib package:com.android.internal.display.cutout.emulation.corner package:com.android.settings.overlay.pixel2018 package:com.google.android.ext.services package:com.google.android.apps.mediashell package:com.android.internal.display.cutout.emulation.double package:com.google.android.overlay.pixelconfig2018 package:com.android.providers.telephony package:com.android.dynsystem package:com.android.sdm.plugins.connmo package:com.google.android.googlequicksearchbox package:com.google.android.cellbroadcastservice package:com.verizon.mips.services package:com.android.providers.calendar package:com.android.providers.media package:com.rb.rashanbazzar <span class="token punctuation">..</span> . |
The package name of the application will appear in this list of package names.
Get the path to the APK file?
Assuming you need to get the APK of the package name com.google.android.youtube
, then you can type the command:
1 2 | adb shell pm path com.google.android.youtube |
Now the APK of the application will appear. Usually you only pay attention to the base.apk
file, which is the first file, the following files are related to config such as SoC structure, language, screen resolution:
1 2 3 4 5 6 | ❯ adb shell pm path com.google.android.youtube package:/data/app/~~JZJ7O-128UkMPyO4wEa5Iw==/com.google.android.youtube-S52tY5BXzpAY6gmZRGWKxA==/base.apk package:/data/app/~~JZJ7O-128UkMPyO4wEa5Iw==/com.google.android.youtube-S52tY5BXzpAY6gmZRGWKxA==/split_config.arm64_v8a.apk package:/data/app/~~JZJ7O-128UkMPyO4wEa5Iw==/com.google.android.youtube-S52tY5BXzpAY6gmZRGWKxA==/split_config.en.apk package:/data/app/~~JZJ7O-128UkMPyO4wEa5Iw==/com.google.android.youtube-S52tY5BXzpAY6gmZRGWKxA==/split_config.xxhdpi.apk |
Drag the APK file to the computer?
Now that you know the path of the APK, you can simply drag it to the terminal’s current directory with the following command:
1 2 | adb pull /data/app/JZJ7O-128UkMPyO4wEa5Iw <span class="token operator">==</span> /com.google.android.youtube-S52tY5BXzpAY6gmZRGWKxA <span class="token operator">==</span> /base.apk |
Ok, now try to type ls base.apk
command. Tada, it’s already on your computer.
Wish you success and find joy in your work.