1

When we click on apk file on android phone (assuming allowed installation from unknown sources), Application name appears.

Example screen-shot for jackpal.androidterm-1.apk:

screen-shot

Now, If I want to get this Application Name "Terminal Emulator" from apk file (jackpal.androidterm-1.apk) without installation prompt, then How do I do that?

So, My question is How do I get Application name from an .apk file?

As you know (from screen-shot) I use terminal, also I've installed busybox. So, Is there any command (like: foo /path/to/.apk) with the help of which I can get application name?

If I've to use application to do that, then I recommend to suggest FLOSS type application.

Note:- This is not about getting package name but application name. Also I am not talking about application that is already installed.

4

Works only on Cyanogenmod or forks that base on CM:

aapt may not be present on your device. It's suspected that this binary is part of CyanogenMod (and its forks). Confirmed to be present on my S3 running Resurrection Remix (CM12.1), Izzy's Milestone² running CM11 and the LG P880 running CM11 as well.

You can use aapt (Android Asset Packaging Tool) to dump the data to your terminal.

Command:

aapt d badging <path to apk>

call aapt
     [d]ump the data
       print the badging (label and icon) of
               <the apk>

Your output will contain many lines beginning with application-label; those are localized labels so the one you are looking for is plain application-label:. Use grep to filter your output and you will end up with this command:

aapt d badging <path to apk> | grep "application-label:"

This gives you the localized application label for a given apk.

Update: Thanks to Izzy for providing aapt for all devices running Android 4.1+:

Izzy put together an archive containing the aapt binary for ARM devices (nearly all phones and tablets use ARM CPUs).
Get it from his website: http://android.izzysoft.de/downloads.

Note: the command to get the actual application label is slightly different, you need to use awk to isolate the application label from the rest of the output:

aapt d badging <path to apk> | grep "application: label" |awk '{print $2}'
  • currectly command aapt not found. how to install Android Asset Packaging Tool? – Pandya Jul 18 '15 at 13:30
  • 1
    @Pandya some apps seem to include it. Unfortunately, that's all I could find so far. – Izzy Jul 18 '15 at 14:55
  • 1
    @Izzy those are IDEs, that are mentioned. They need to include aapt to be able to pack apks. I just checked my S3's 4.4.4 stock image, but I haven't found aapt in it. Seems like it only comes with the development version of Android. – GiantTree Jul 18 '15 at 14:59
  • So that confirms my suspicion it might be a CM specific thing (one more edit to your answer?). And yes, I'm aware those are IDEs – otherwise, what for should they include aapt? ;) But if one can get hold of the .apk, (s)he may extract the aapt binary plus the required lib(s) from it (aapt at least requires libpng). – Izzy Jul 18 '15 at 15:10
  • 1
    @Izzy Thanks for providing aapt – Pandya Jul 19 '15 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.