使用adb命令查看最上层activity:
方法一 :
在Terminal命令中输入:adb shell dumpsys activity activities
ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities)
Display #0 (activities from top to bottom):
Stack #0:
mFullscreen=true
mBounds=null
Task id #763
mFullscreen=true
mBounds=null
mMinWidth=-1
mMinHeight=-1
mLastNonFullscreenBounds=null
* TaskRecord{cf3785f #763 I=com.jwipc.wochu/.MainActivity U=0 StackId=0 sz=2}
userId=0 effectiveUid=u0a45 mCallingUid=0 mUserSetupComplete=true mCallingPackage=null
intent={act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000100 cmp=com.jwipc.wochu/.MainActivity}
realActivity=com.jwipc.wochu/.MainActivity
autoRemoveRecents=false isPersistable=true numFullscreen=2 taskType=1 mTaskToReturnTo=1
rootWasReset=false mNeverRelinquishIdentity=true mReuseTask=false mLockTaskAuth=LOCK_TASK_AUTH_PINNABLE
Activities=[ActivityRecord{dea55db u0 com.jwipc.wochu/.MainActivity t763}, ActivityRecord{913d5c u0 com.jwipc.wochu/.AppActivity t763}]
askedCompatMode=false inRecents=true isAvailable=true
lastThumbnail=null lastThumbnailFile=/data/system_ce/0/recent_images/763_task_thumbnail.png
stackId=0
hasBeenVisible=true mResizeMode=RESIZE_MODE_RESIZEABLE isResizeable=false firstActiveTime=1697685757669 lastActiveTime=1697685757669 (inactive for 91s)
* Hist #1: ActivityRecord{913d5c u0 com.jwipc.wochu/.AppActivity t763}
packageName=com.jwipc.wochu processName=com.jwipc.wochu
launchedFromUid=10045 launchedFromPackage=com.jwipc.wochu userId=0
app=ProcessRecord{ad162ac 1089:com.jwipc.wochu/u0a45}
Intent { cmp=com.jwipc.wochu/.AppActivity }
frontOfTask=false task=TaskRecord{cf3785f #763 I=com.jwipc.wochu/.MainActivity U=0 StackId=0 sz=2}
taskAffinity=com.jwipc.wochu
realActivity=com.jwipc.wochu/.AppActivity
baseDir=/system/app/WoChuLauncher/WoChuLauncher.apk
dataDir=/data/user/0/com.jwipc.wochu
stateNotNeeded=false componentSpecified=true mActivityType=1
isHomeActivity=false
compat={160dpi always-compat} labelRes=0x7f050000 icon=0x7f020014 theme=0x1030006
config={1.0 dualscreenflag=DISABLE ?mcc?mnc [zh_CN] ldltr sw1080dp w1080dp h1840dp 160dpi xlrg long port finger -keyb/v/h -nav/h s.4}
taskConfigOverride={1.0 dualscreenflag=DISABLE ?mcc?mnc ?localeList ?layoutDir ?swdp ?wdp ?hdp ?density ?lsize ?long ?orien ?uimode ?night ?touch ?keyb/?/? ?nav/?}
taskDescription: iconFilename=null label=“null” color=ff222222
launchFailed=false launchCount=0 lastLaunchTime=-2m47s338ms
haveState=false icicle=null
state=RESUMED stopped=false delayedResume=false finishing=false
keysPaused=false inHistory=true visible=true sleeping=false idle=true mStartingWindowState=STARTING_WINDOW_NOT_SHOWN
fullscreen=true noDisplay=false immersive=false launchMode=0
frozenBeforeDestroy=false forceNewConfig=false
mActivityType=HOME_ACTIVITY_TYPE
waitingVisible=false nowVisible=true lastVisibleTime=-1m30s630ms
resizeMode=RESIZE_MODE_RESIZEABLE
* Hist #0: ActivityRecord{dea55db u0 com.jwipc.wochu/.MainActivity t763}
packageName=com.jwipc.wochu processName=com.jwipc.wochu
launchedFromUid=0 launchedFromPackage=null userId=0
app=ProcessRecord{ad162ac 1089:com.jwipc.wochu/u0a45}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000100 cmp=com.jwipc.wochu/.MainActivity }
frontOfTask=true task=TaskRecord{cf3785f #763 I=com.jwipc.wochu/.MainActivity U=0 StackId=0 sz=2}
taskAffinity=null
realActivity=com.jwipc.wochu/.MainActivity
baseDir=/system/app/WoChuLauncher/WoChuLauncher.apk
dataDir=/data/user/0/com.jwipc.wochu
stateNotNeeded=true componentSpecified=false mActivityType=1
isHomeActivity=true
compat={160dpi always-compat} labelRes=0x7f050000 icon=0x7f020014 theme=0x1030006
config={1.0 dualscreenflag=DISABLE ?mcc?mnc [zh_CN] ldltr sw1080dp w1080dp h1840dp 160dpi xlrg long port finger -keyb/v/h -nav/h s.4}
taskConfigOverride={1.0 dualscreenflag=DISABLE ?mcc?mnc ?localeList ?layoutDir ?swdp ?wdp ?hdp ?density ?lsize ?long ?orien ?uimode ?night ?touch ?keyb/?/? ?nav/?}
taskDescription: iconFilename=null label=“null” color=ff222222
launchFailed=false launchCount=0 lastLaunchTime=-16m29s632ms
haveState=true icicle=Bundle[mParcelledData.dataSize=1412]
state=STOPPED stopped=true delayedResume=false finishing=false
keysPaused=false inHistory=true visible=false sleeping=false idle=true mStartingWindowState=STARTING_WINDOW_SHOWN
fullscreen=true noDisplay=false immersive=false launchMode=2
frozenBeforeDestroy=false forceNewConfig=false
mActivityType=HOME_ACTIVITY_TYPE
waitingVisible=false nowVisible=false lastVisibleTime=-2m50s115ms
resizeMode=RESIZE_MODE_RESIZEABLE
Running activities (most recent first):
TaskRecord{cf3785f #763 I=com.jwipc.wochu/.MainActivity U=0 StackId=0 sz=2}
Run #1: ActivityRecord{913d5c u0 com.jwipc.wochu/.AppActivity t763}
Run #0: ActivityRecord{dea55db u0 com.jwipc.wochu/.MainActivity t763}
mResumedActivity: ActivityRecord{913d5c u0 com.jwipc.wochu/.AppActivity t763}
mLastPausedActivity: ActivityRecord{913d5c u0 com.jwipc.wochu/.AppActivity t763}
mFocusedActivity: ActivityRecord{913d5c u0 com.jwipc.wochu/.AppActivity t763}
mFocusedStack=ActivityStack{43f9b75 stackId=0, 1 tasks} mLastFocusedStack=ActivityStack{43f9b75 stackId=0, 1 tasks}
mSleepTimeout=false
mCurTaskIdForUser={0=766}
mUserStackInFront={}
mActivityContainers={0=ActivtyContainer{0}A}
mLockTaskModeState=NONE mLockTaskPackages (userId:packages)=
0:[]
mLockTaskModeTasks[]
realActivity=com.jwipc.wochu/.MainActivity就是了
方法二 :
在Terminal命令中输入 adb shell dumpsys window | findstr mCurrentFocus文章来源:https://www.toymoban.com/news/detail-757019.html
mCurrentFocus=Window{7dde643 u0 com.jwipc.wochu/com.jwipc.wochu.MainActivity}文章来源地址https://www.toymoban.com/news/detail-757019.html
到了这里,关于安卓使用adb命令查看当前activity的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!