亚行壳上的'aapt dump badging'

Ben*_*Ben 3 android adb aapt

我正在尝试从命令行获取应用程序列表及其可启动活动.我知道

aapt dump badging
Run Code Online (Sandbox Code Playgroud)

会给我这个信息.我只是想知道我是否可以从ADB shell的上下文中获取此信息.我意识到我可以把文件拉到本地机器,但是有些APK相当大,所以我更愿意直接从设备上获取这些信息......

Mar*_*lts 6

adb shell dumpsys将为您提供大量信息,包括可启动的活动.例如,输出将列出对操作做出反应的活动android.intent.action.MAIN:

  android.intent.action.MAIN:
    423fff90 com.android.bluetooth/.bpp.BluetoothBppActivity filter 42400218
    424003d0 com.android.bluetooth/.bpp.BluetoothBppSetting filter 42400608
    42400758 com.android.bluetooth/.bpp.BluetoothBppPrintPrefActivity filter 424009b8
    42400b08 com.android.bluetooth/.bpp.BluetoothBppStatusActivity filter 42400d60
    42400f10 com.android.bluetooth/.bpp.BluetoothBppAuthActivity filter 42401158
    42408bb8 com.google.android.apps.books/.app.BooksActivity filter 42408e88
    42414f50 com.android.providers.calendar/.CalendarContentProviderTests filter 42415270
    42415a38 com.android.providers.calendar/.CalendarDebug filter 42415c28
    42415df0 com.android.providers.calendar/.CalendarDebugActivity filter 42416048
    ...
Run Code Online (Sandbox Code Playgroud)

请注意,输出很大; 你可能想限制输出.您可以在输出顶部看到dumpsys知道哪些子类:

Currently running services:
  SurfaceFlinger
  accessibility
  account
  activity
  alarm
  ...
  package
  ...
Run Code Online (Sandbox Code Playgroud)

在你的情况下,你可能只对输出感兴趣adb shell dumpsys package.