Get application version name using adb

后端 未结 5 2007
一整个雨季
一整个雨季 2021-01-30 02:20

Is there an easy way to get the version name of an application on an Android device using adb shell?

I found the application version number (not the version name) in /d

5条回答
  •  余生分开走
    2021-01-30 02:48

    In case someone needs all apps versions for comparing purposes then here is my oneliner:

    for p in `adb shell pm list package | awk -F"package:" '{print $2}'`; do echo -n "$p: "; adb shell dumpsys package $p | grep -i versionName | awk -F"=" '{print $2}'; done
    

    Maybe it will be helpful for somebody but please note that I use versionName and ignore versionCode, so use with care.

提交回复
热议问题