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?
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.
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 .
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.
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.
adb shell am start -a android.settings.APPLICATION_DETAILS_SETTINGS -d package:<package-name>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With