获取当前Activity
adb shell dumpsys activity activities
Display #0 (activities from top to bottom):
* Task{39ce36e #3998 type=standard A=10695:com.bps.APMQADemo U=0 visible=true visibleRequested=true mode=fullscreen translucent=false sz=1}
isSleeping=false
topResumedActivity=ActivityRecord{6f56770 u0 com.bps.APMQADemo/com.unity3d.player.UnityPlayerActivity} t3998}
* Hist #0: ActivityRecord{6f56770 u0 com.bps.APMQADemo/com.unity3d.player.UnityPlayerActivity} t3998}
packageName=com.bps.APMQADemo processName=com.bps.APMQADemo
launchedFromUid=10122 launchedFromPackage=com.android.launcher launchedFromFeature=null userId=0
app=ProcessRecord{38ab488 21460:com.bps.APMQADemo/u0a695}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.bps.APMQADemo/com.unity3d.player.UnityPlayerActivity bnds=[1523,617][1889,864] mCallingUid=10122 }
rootOfTask=true task=Task{39ce36e #3998 type=standard A=10695:com.bps.APMQADemo U=0 visible=true visibleRequested=true mode=fullscreen translucent=false sz=1}
taskAffinity=10695:com.bps.APMQADemo
mActivityComponent=com.bps.APMQADemo/com.unity3d.player.UnityPlayerActivity
baseDir=/data/app/~~-glfb346JnMFcLKPKiVzbw==/com.bps.APMQADemo-otMllfqB65of3aFIG7vj7w==/base.apk
dataDir=/data/user/0/com.bps.APMQADemo
stateNotNeeded=false componentSpecified=false mActivityType=standard
compat={440dpi always-compat} labelRes=0x7f030005 icon=0x7f020000 theme=0x7f040001
mLastReportedConfigurations:
mGlobalConfig={1.0 ?mcc?mnc [zh_CN,ar_EG,th_TH,en_US,zh_HK,zh_TW,in_ID] ldltr sw356dp w698dp h356dp 440dpi nrml hdr widecg land finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 357 - 1920, 1436) mAppBounds=Rect(0, 456 - 1920, 1436) mMaxBounds=Rect(0, 357 - 1920, 1436) mDisplayRotation=ROTATION_0 mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=standard mAlwaysOnTop=undefined mRotation=ROTATION_0} s.15923 fontWeightAdjustment=0mThemeChanged= 0, mThemeChangedFlags= 0, mFlipFont= 0, mAccessibleChanged= -1, mUxIconConfig= 3468078958223818784, mMaterialColor= 0, mUserId= 0, mFontUserId= 0, mFontVariationSettings= 226, mFoldingAngle = -1.0, mIconPackName= , mDarkModeBackgroundMaxL= 8.0, mDarkModeDialogBgMaxL= 27.0, mDarkModeForegroundMinL= 100.0, mOplusConfigType= 1, mOplusChangedConfigs= 0, OpSans= 0, mFlag= 0}
mOverrideConfig={1.0 ?mcc?mnc [zh_CN,ar_EG,th_TH,en_US,zh_HK,zh_TW,in_ID] ldltr sw356dp w698dp h356dp 440dpi nrml hdr widecg land finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 357 - 1920, 1436) mAppBounds=Rect(0, 456 - 1920, 1436) mMaxBounds=Rect(0, 357 - 1920, 1436) mDisplayRotation=ROTATION_0 mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=standard mAlwaysOnTop=undefined mRotation=ROTATION_0} s.1 fontWeightAdjustment=0mThemeChanged= 0, mThemeChangedFlags= 0, mFlipFont= 0, mAccessibleChanged= -1, mUxIconConfig= 3468078958223818784, mMaterialColor= 0, mUserId= 0, mFontUserId= 0, mFontVariationSettings= 226, mFoldingAngle = -1.0, mIconPackName= , mDarkModeBackgroundMaxL= 8.0, mDarkModeDialogBgMaxL= 27.0, mDarkModeForegroundMinL= 100.0, mOplusConfigType= 1, mOplusChangedConfigs= 0, OpSans= 0, mFlag= 0}
CurrentConfiguration={1.0 ?mcc?mnc [zh_CN,ar_EG,th_TH,en_US,zh_HK,zh_TW,in_ID] ldltr sw356dp w698dp h356dp 440dpi nrml hdr widecg land finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 357 - 1920, 1436) mAppBounds=Rect(0, 456 - 1920, 1436) mMaxBounds=Rect(0, 357 - 1920, 1436) mDisplayRotation=ROTATION_0 mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=standard mAlwaysOnTop=undefined mRotation=ROTATION_0} s.4 fontWeightAdjustment=0mThemeChanged= 0, mThemeChangedFlags= 0, mFlipFont= 0, mAccessibleChanged= -1, mUxIconConfig= 3468078958223818784, mMaterialColor= 0, mUserId= 0, mFontUserId= 0, mFontVariationSettings= 226, mFoldingAngle = -1.0, mIconPackName= , mDarkModeBackgroundMaxL= 8.0, mDarkModeDialogBgMaxL= 27.0, mDarkModeForegroundMinL= 100.0, mOplusConfigType= 1, mOplusChangedConfigs= 0, OpSans= 0, mFlag= 0}
ResolvedOverrideConfiguration={0.0 ?mcc?mnc ?localeList ?layoutDir sw356dp w698dp h356dp ?density nrml ?ldr ?wideColorGamut land ?uimode ?night ?touch ?keyb/?/? ?nav/? winConfig={ mBounds=Rect(0, 357 - 1920, 1436) mAppBounds=Rect(0, 456 - 1920, 1436) mMaxBounds=Rect(0, 357 - 1920, 1436) mDisplayRotation=undefined mWindowingMode=undefined mDisplayWindowingMode=undefined mActivityType=undefined mAlwaysOnTop=undefined mRotation=undefined} s.4 ?fontWeightAdjustmentmThemeChanged= 0, mThemeChangedFlags= 0, mFlipFont= 0, mAccessibleChanged= 0, mUxIconConfig= 0, mMaterialColor= ffffffffffffffff, mUserId= -1, mFontUserId= -1, mFontVariationSettings= 0, mFoldingAngle = -1.0, mIconPackName= , mDarkModeBackgroundMaxL= -1.0, mDarkModeDialogBgMaxL= -1.0, mDarkModeForegroundMinL= -1.0, mOplusConfigType= 0, mOplusChangedConfigs= 0, OpSans= -1, mFlag= 0}
获取启动activity信息
指令
adb shell dumpsys activity recents|find "intent={"
结果
C:\Users\73916>adb shell dumpsys activity recents|find "intent={"
intent={act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=tv.danmaku.bili/.MainActivityV2}
intent={act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10800100 cmp=com.miui.home/.launcher.Launcher}