デバッグで良く使うコマンド dumpsys編 その3 Activity続き
前回はdumpsysのActivityに関する情報を紹介しました。
今回も引き続きActivityに関する情報で良く使うものを紹介します。
まず、前回のおさらい。
dumpsysでActivity情報を取得するには下記を使用します。
$ adb shell activity activities
取得できる情報は下記dumpsysのActivity情報となります。
今回紹介する情報は下記になります。
mResumedActivity:現在ResumeなActivityを表す。
mFocusedActivity:現在Focusを持っているActivityを表す。
Intent:Activityが持っているIntentの情報を表す。
障害が発生した際はResumeだったActivityがどれでFocusを持っていたActivityがどれかという情報を現状分析の際に使用しています。
Intentの情報はActivityがどのようなIntentで起動されたか分かるため、フラグ等が間違えていないか確認するときに使用しています。
他にも有用な情報はあると思いますが、私が良く使う情報は以上になります。
●dumpsysのActivity情報
ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities)
Stack #0:
Task id #1
* TaskRecord{b3fca690 #1 A=com.android.launcher U=0 sz=1}
numActivities=1 rootWasReset=false userId=0 mTaskType=1 numFullscreen=1 mOnTopOfHome=false
affinity=com.android.launcher
intent={act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.android.launcher/com.android.launcher2.Launcher}
realActivity=com.android.launcher/com.android.launcher2.Launcher
Activities=[ActivityRecord{b3e069e0 u0 com.android.launcher/com.android.launcher2.Launcher t1}]
askedCompatMode=false
lastThumbnail=null lastDescription=null
lastActiveTime=111900 (inactive for 228s)
* Hist #0: ActivityRecord{b3e069e0 u0 com.android.launcher/com.android.launcher2.Launcher t1}
packageName=com.android.launcher processName=com.android.launcher
launchedFromUid=0 launchedFromPackage=null userId=0
app=ProcessRecord{b3ff0b58 630:com.android.launcher/u0a8}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.android.launcher/com.android.launcher2.Launcher }
frontOfTask=true task=TaskRecord{b3fca690 #1 A=com.android.launcher U=0 sz=1}
taskAffinity=com.android.launcher
realActivity=com.android.launcher/com.android.launcher2.Launcher
baseDir=/system/priv-app/Launcher2.apk
dataDir=/data/user/0/com.android.launcher
stateNotNeeded=true componentSpecified=false mActivityType=1
compat={213dpi always-compat} labelRes=0x7f0d0000 icon=0x7f030001 theme=0x7f0e0001
config={1.0 310mcc260mnc en_US ldltr sw600dp w600dp h888dp 213dpi lrg port finger qwerty/v/v -nav/h s.5}
launchFailed=false launchCount=1 lastLaunchTime=-3m48s291ms
haveState=false icicle=null
state=RESUMED stopped=false delayedResume=false finishing=false
keysPaused=false inHistory=true visible=true sleeping=false idle=true
fullscreen=true noDisplay=false immersive=false launchMode=2
frozenBeforeDestroy=false thumbnailNeeded=false forceNewConfig=false
mActivityType=HOME_ACTIVITY_TYPE
thumbHolder: b3fca690 bm=null desc=null
waitingVisible=false nowVisible=true lastVisibleTime=-3m17s956ms
Running activities (most recent first):
TaskRecord{b3fca690 #1 A=com.android.launcher U=0 sz=1}
Run #0: ActivityRecord{b3e069e0 u0 com.android.launcher/com.android.launcher2.Launcher t1}
mResumedActivity: ActivityRecord{b3e069e0 u0 com.android.launcher/com.android.launcher2.Launcher t1}
mFocusedActivity: ActivityRecord{b3e069e0 u0 com.android.launcher/com.android.launcher2.Launcher t1}
mDismissKeyguardOnNextActivity=false
mFocusedStack=null mStackState=STACK_STATE_HOME_IN_FRONT
mSleepTimeout=false
mCurTaskId=1
mUserStackInFront={}
Recent tasks:
* Recent #0: TaskRecord{b3fca690 #1 A=com.android.launcher U=0 sz=1}
numActivities=1 rootWasReset=false userId=0 mTaskType=1 numFullscreen=1 mOnTopOfHome=false
affinity=com.android.launcher
intent={act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.android.launcher/com.android.launcher2.Launcher}
realActivity=com.android.launcher/com.android.launcher2.Launcher
Activities=[ActivityRecord{b3e069e0 u0 com.android.launcher/com.android.launcher2.Launcher t1}]
askedCompatMode=false
lastThumbnail=null lastDescription=null
lastActiveTime=111900 (inactive for 228s)

