Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: launch app info dialog via adb shell am

I'm trying to write a script which will launch the "app info" system dialog via adb for an app I'm testing.

I have done some investigation and came up with this command, which will launch "app info" but fails with a force close (NullPointerException in logcat):

adb shell am start -a android.intent.action.VIEW -n com.android.settings/.applications.InstalledAppDetails -es com.android.settings.ApplicationPkgName com.my.app -es pkg com.my.app

Seems that the package name isn't being properly passed.

What is the correct way to pass the package name parameter to the am command in this case?

like image 512
André Fernandes Avatar asked Sep 03 '13 10:09

André Fernandes


People also ask

What is adb shell am?

Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you can use to run a variety of commands on a device.

How do I launch adb shell?

Open a command window in the folder by holding shift and right-clicking in an empty spot in the folder and selecting "Open command prompt/PowerShell here" in the menu. Then you can start using ADB — connect your phone and try .

How do I start an activity from command prompt?

You can use the start command from Activity Manager (am) a.k.a the adb shell am start -n command (via adb) specifying the app package name and the component name as defined in the manifest. You can add other parameters like ACTION (-a android. intent. action.

How do I access adb shell on Android?

To use ADB with your Android device, you must enable a feature called “USB Debugging.” Open your phone's app drawer, tap the Settings icon, and select “About Phone”. Scroll all the way down and tap the “Build Number” item seven times. You should get a message saying you are now a developer.


1 Answers

adb shell am start -a android.settings.APPLICATION_DETAILS_SETTINGS -d package:<package-name>
like image 162
Anton Rutkevich Avatar answered Sep 24 '22 13:09

Anton Rutkevich