App入口分析方法汇总

logcat方法

adb logcat ActivityManager:I -e 'START' -d
#一步到位
adb logcat ActivityManager:I -e 'START' -d | awk 'END{match($0,/[^= ]*\/[^ ]*/, r);print r[0]}'

取cmp=后面的字符串

09-22 17:18:47.399   374  1153 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=io.appium.android.apis/.ApiDemos bnds=[439,252][641,505]} from uid 10103

dumpsys方法

adb shell dumpsys activity activities
adb shell dumpsys window windows
#一步到位
adb shell "dumpsys activity activities | grep cmp= | grep -o  [^=]*/[^}]* | head -1"

从里面找对应的信息

aapt方法

- Mac/Linux: `aapt dump badging wework.apk  | grep launchable-activity`
- Windows: `aapt dump badging wework.apk  | findstr launchable-activity`

验证命令

启动应用命令 adb shell am start -W -n <package-name>/<activity-name> -S

关闭