通过dumpsys package命令来获取Android中各个应用包的状态信息

1.命令

adb shell dumpsys package

2.获取的信息样式如下

Packages:
  Package [com.miui.screenrecorder] (752e1b3):
    userId=1000
    sharedUser=SharedUserSetting{e540b41 android.uid.system/1000}
    pkg=Package{a7cc8e6 com.miui.screenrecorder}
    codePath=/system/app/MiuiScreenRecorder
    resourcePath=/system/app/MiuiScreenRecorder
    legacyNativeLibraryDir=/system/app/MiuiScreenRecorder/lib
    primaryCpuAbi=null
    secondaryCpuAbi=null
    versionCode=59 minSdk=21 targetSdk=26
    versionName=1.5.9
    splits=[base]
    apkSigningVersion=2
    applicationInfo=ApplicationInfo{43bce27 com.miui.screenrecorder}
    flags=[ SYSTEM HAS_CODE ALLOW_CLEAR_USER_DATA ALLOW_BACKUP ]
    privateFlags=[ PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_UNRESIZEABLE ]
    dataDir=/data/user/0/com.miui.screenrecorder
    supportsScreens=[small, medium, large, xlarge, resizeable, anyDensity]
    usesLibraries:
      org.apache.http.legacy
    usesLibraryFiles:
      /system/framework/org.apache.http.legacy.boot.jar
    timeStamp=2009-01-01 00:00:00
    firstInstallTime=2009-01-01 00:00:00
    lastUpdateTime=2009-01-01 00:00:00
    signatures=PackageSignatures{f70d8d4 version:2, signatures:[6c02dd51], past signatures:[]}
    installPermissionsFixed=true
    pkgFlags=[ SYSTEM HAS_CODE ALLOW_CLEAR_USER_DATA ALLOW_BACKUP ]
    User 0: ceDataInode=1310867 installed=true hidden=false suspended=false stopped=false notLaunched=false enabled=0 instant=false virtual=false
  Package [com.android.cts.priv.ctsshim] (d151a7d):
    userId=10048
    pkg=Package{9bc8d72 com.android.cts.priv.ctsshim}
    codePath=/system/priv-app/CtsShimPrivPrebuilt
    resourcePath=/system/priv-app/CtsShimPrivPrebuilt
    legacyNativeLibraryDir=/system/priv-app/CtsShimPrivPrebuilt/lib
    primaryCpuAbi=arm64-v8a
    secondaryCpuAbi=armeabi-v7a
    versionCode=27 minSdk=24 targetSdk=24
    versionName=8.1.0-4396705
    splits=[base]
    apkSigningVersion=1
    applicationInfo=ApplicationInfo{8d25c3 com.android.cts.priv.ctsshim}
    flags=[ SYSTEM ALLOW_CLEAR_USER_DATA ALLOW_BACKUP ]
    privateFlags=[ PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION PRIVILEGED ]
    dataDir=/data/user/0/com.android.cts.priv.ctsshim
 .....

3. 从上述信息可以看出各个包的信息

例如从:

User 0: ceDataInode=1310867 installed=true hidden=false suspended=false stopped=false notLaunched=false enabled=0 instant=false virtual=false

hidden=false可以看出该包,未被隐藏;若为true则为被隐藏.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值