Android: launch app info dialog via adb shell am

倖福魔咒の 提交于 2019-12-10 15:22:29

问题


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?


回答1:


adb shell am start -a android.settings.APPLICATION_DETAILS_SETTINGS -d package:<package-name>



回答2:


Also, check this: https://stackoverflow.com/a/4567928/4409113

adb shell am start -n com.package.name/com.package.name.ActivityName

http://developer.android.com/tools/help/shell.html#am

You can also issue an activity manager command directly from adb without entering a remote shell.

For example:

adb shell am start -a android.intent.action.VIEW

Seems like, start -a is a good way.



来源:https://stackoverflow.com/questions/18589910/android-launch-app-info-dialog-via-adb-shell-am

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!