script to list/known package name of installed application

SH
steve halsberghe
PHI DATA (Belgium)

Hi community

Is there an easy way to find package name  of an installed application ?

Script command ?

What I need is to know the package name of an application.

Thx.

steve

5 years ago
Android Scripting
ANSWERS
MD
Matt Dermody Diamond Contributor
5 years ago

All of the Package Names for enabled applications should be listed under the Applications tab for a device:

There also is the identify_activity script that you can run while an app is in the foreground in order to identify the package name and activity name. 

SH
steve halsberghe
5 years ago

Thx but this is not sufficient.

I'm confugring a Unitech device. 

I need the package name of the camera app on the device.

No application installed contains word like camera, photo or other to be identifgied.

So having the possibility to run an app and use a script to retrieve specif package name of this app should be very nice !

steve

RC
Raymond Chan Diamond Contributor
5 years ago (edited 5 years ago)

Run  the camera in the foreground, and then send identify_activity script command to the device.  You can see the app/activity name in the logs tab for the device in your web-console.

SH
steve halsberghe
5 years ago

Device has been enrolled in Device Owner Mode (using afw#mobicontrol).

so some system app are disabled like the camera app.

So I can't laucnh camera app to use identify command

RC
Raymond Chan Diamond Contributor
5 years ago (edited 5 years ago)

If there is an Android+ device agent for your device,  you can enrol your device in Android+ mode and use the identify_activity script command approach mentioned in my previous post.  Alternatively, many free third-party utility app can be used to show the app/activity name of all applications installed/bundled on a device.

R
Rafael Gold Contributor
5 years ago (edited 5 years ago)

I see 3-4 different methods to get it:

  • Did you asked unitech already?
  • Or you can enroll it with "leave_system_apps_enabled"=true;, then it will stay.
  • Install it as a normal (customer) device, so the apps will stay. Then install mobicontrol after that, so you can read out the package name as Matt said from Mobicontrol.
  • Send an intent, look here: https://stackoverflow.com/questions/9665045/how-to-get-package-name-of-camera-application
SH
steve halsberghe
5 years ago

Thx for feedback. Will test this evening.

Rgds.

SH
steve halsberghe
5 years ago

Hi

Can you explain how/where you configure the "leave system app = true" feature ?

Thx.

Steve

MD
Matt Dermody Diamond Contributor
5 years ago (edited 5 years ago)

That parameter is called a DPC Extra and it is typically included within the enrollment configuration for the QR or NFC based AEDO enrollment methods. If you enroll the device using the DPC identifier / "hash tag method" (afw#mobicontrol in SOTI's case) then you cannot specify the DPC extras and you are left with the default enrollment behavior. To enroll the device with the system apps enabled by default you can factory reset it and then enroll it using the MobiControl Stage Programmer android app available in the Play Store. Note that you'll have to use a separate device, perhaps an Android phone if you have one, to help stage the devices with this app. 

This is explained more at the following link:

https://support.google.com/work/android/thread/57151724?hl=en

SH
steve halsberghe
5 years ago

Hi tested with Stage Programmer and ok... Btu Stage Programmer usage reqauires the need to manually enable all authorizations !

Thx.