Is there any regex to find package name

1k views Asked by At

I want to run monkey on game 2048 using adb

So, i need package name of 2048, i used

adb shell pm list packages -f

to list packages.

I could not find 2048 in it, but the application is installed on my device. Is there any regex by which i can look for package name using keyword 2048

2

There are 2 answers

2
Viral Thakker On BEST ANSWER

Using the same command just look for /data/app/ in the list. And if you are using and Linux destro or MAC then you can use grep/egrep command on output to find it easily

3
Jared Rummler On

Just because the app name is "2048" does not mean it is used in the package name. However, I looked up the most popular Google Play game and it does have 2048 in the package name.

You could use grep to get the package. The following example will get the path to the APK file:

adb shell pm list packages -f | grep 2048 | cut -d: -f2 | cut -d= -f1
...
/data/app/com.estoty.game2048-1.apk

An easy way to find out the package name of an app on Google Play is to just search on the Google Play Store and look at the last part of the URL:

https://play.google.com/store/apps/details?id=com.presselite.the2048game