Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Application Name/ Label via ADB Shell or Terminal

I'm developing an application that uses ADB Shell to interface with android devices, and I need some way of printing out the application name or label of an application, given maybe their package name.

In short, I need a way of getting app names (i.e. "Angry Birds v1.0.0") for user installed applications through adb shell.

Any light on the matter? Any help is appreciated on this.

like image 950
hamsteyr Avatar asked May 20 '13 13:05

hamsteyr


People also ask

How do I find my current activity name adb?

You can find current activity name in activity stack.

How do I list files in adb shell?

Open cmd type adb shell then press enter. Type ls to view files list. At the DOS prompt, adb shell ls -R > junk lists all files and puts results into file junk which you can then edit via Notepad or whatever and see more than you'd want to, but your files, too!


2 Answers

adb shell pm list packages will give you a list of all installed package names.

You can then use dumpsys | grep -A18 "Package \[my.package\]" to grab the package information such as version identifiers etc

like image 152
rcbevans Avatar answered Oct 22 '22 10:10

rcbevans


just enter the following command on command prompt after launching the app:

adb shell dumpsys window windows | find "mCurrentFocus" 

if executing the command on linux terminal replace find by grep

like image 20
akshaykadam_100 Avatar answered Oct 22 '22 10:10

akshaykadam_100