Skip to content

Instantly share code, notes, and snippets.

@tylearymf
Last active December 30, 2021 01:51
Show Gist options
  • Save tylearymf/ed7dd1bd4903dee96de94e4f67527bd9 to your computer and use it in GitHub Desktop.
Save tylearymf/ed7dd1bd4903dee96de94e4f67527bd9 to your computer and use it in GitHub Desktop.
UnityProfiler调试命令
@echo off
REM 将下面的 PackageName 设置为 当前要调试的包名,不要加双引号
set PackageName="com.test.apk"
adb shell setprop "debug.checkjni" "1"
adb forward --remove-all
adb reverse --remove-all
REM adb forward "tcp:34999" "localabstract:Unity-%PackageName%"
adb reverse "tcp:34998" "tcp:34999"
adb shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -S -n "%PackageName%/com.unity3d.player.UnityPlayerActivity"
echo 游戏启动成功,可以打开Profiler窗口调试了
echo 10秒后自动关闭
ping -n 10 127.1>nul
exit
REM 使用 Procmon 来监听 Unity 在 BuildAndRun 的时候调用的命令行
REM 过滤器选择 Operation == 'Process Start'
REM 过滤器选择 Process Name == cmd.exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment