unity3D游戏APP如何测试冷热启动时长
adb shell dumpsys window | grep mCurrentFocus
adb shell am force-stop 包名
adb shell am start -W 包名/第一条命令得到的activity
运行之后,没有启动时长,提示 找不到这个activity
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.candy.cn/com.ia.GameActivity } from null (pid=14052, uid=2000) not exported from uid 10880
at com.android.server.wm.ActivityTaskSupervisor.checkStartAnyActivityPermission(ActivityTaskSupervisor.java:1156)
at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:1254)
at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:857)
at com.android.server.wm.ActivityTaskManagerService.startActivityAndWait(ActivityTaskManagerService.java:1619)
at com.android.server.am.ActivityManagerService.startActivityAndWait(ActivityManagerService.java:3460)
at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:599)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:214)
at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
at android.os.ShellCommand.exec(ShellCommand.java:38)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:9693)
at android.os.Binder.shellCommand(Binder.java:950)
at android.os.Binder.onTransact(Binder.java:834)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:6026)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2959)
at android.os.Binder.execTransactInternal(Binder.java:1184)
at android.os.Binder.execTransact(Binder.java:1143)
我的解答思路和尝试过的方法
找不到APP真正的启动页 使用monkey命令 指定模拟随机事件为1次来找到真正的activity
adb shell monkey -p 包名 -vvv 1
用这个activity 去测试冷热启动 但是这个启动时间没有包含unity启动时间
我想要达到的结果
我想能测试 unity完全启动的时长