elysia/log/log.bat
2025-11-04 09:53:47 +08:00

20 lines
354 B
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
setlocal enabledelayedexpansion
:: 读取包名
set /p PKG=请输入包名(例如 com.example.app:
:: 获取PID
for /f "tokens=*" %%i in ('adb shell pidof %PKG%') do set PID=%%i
if "%PID%"=="" (
echo 未找到包名对应进程,请确认应用已运行。
pause
exit /b
)
echo 已获取PID: %PID%
echo 正在输出日志,按 Ctrl+C 结束...
adb logcat --pid=%PID%