@echo off setlocal enableDelayedExpansion set "currentDir=%~dp0" set "noxLogsPath=%appdata%\..\Local\Nox" set "vmLogsPath=%appdata%\..\..\vmlogs" ver | findstr "5\.[0-9]\.[0-9][0-9]*" > NUL && set "noxLogsPath=%appdata%\..\Local Settings\Application Data\Nox" && set "vmLogsPath=%appdata%\..\vmlogs" if exist "%currentDir%\NoxPlayerLogs" rd /s /q "%currentDir%\NoxPlayerLogs" > nul 2>&1 md "%currentDir%\NoxPlayerLogs\" > nul 2>&1 md "%currentDir%\NoxPlayerLogs\vmlogs\" > nul 2>&1 md "%currentDir%\NoxPlayerLogs\BigNoxInstallPack\" > nul 2>&1 md "%currentDir%\NoxPlayerLogs\vmInstall\" > nul 2>&1 md "%currentDir%\NoxPlayerLogs\Nox\" > nul 2>&1 md "%currentDir%\NoxPlayerLogs\Log_multi\" > nul 2>&1 md "%currentDir%\NoxPlayerLogs\UpdateDownloaderlog\" > nul 2>&1 md "%currentDir%\NoxPlayerLogs\logcats\" > nul 2>&1 xcopy "%vmLogsPath%" "%currentDir%\NoxPlayerLogs\vmlogs\" /Y > nul 2>&1 xcopy "%noxLogsPath%\Log_multi_*.txt" "%currentDir%\NoxPlayerLogs\Log_multi\" /Y > nul 2>&1 xcopy "%noxLogsPath%\BigNoxInstallPack" "%currentDir%\NoxPlayerLogs\BigNoxInstallPack\" /Y > nul 2>&1 xcopy "%noxLogsPath%\vmInstall" "%currentDir%\NoxPlayerLogs\vmInstall\" /Y > nul 2>&1 xcopy "%noxLogsPath%\*.log" "%currentDir%\NoxPlayerLogs\Nox\" /Y > nul 2>&1 xcopy "%noxLogsPath%\*.log.*" "%currentDir%\NoxPlayerLogs\Nox\" /Y > nul 2>&1 xcopy "%noxLogsPath%\*.dump" "%currentDir%\NoxPlayerLogs\Nox\" /Y > nul 2>&1 xcopy "%noxLogsPath%\UpdateDownloaderlog\*.log" "%currentDir%\NoxPlayerLogs\UpdateDownloaderlog\" /Y > nul 2>&1 cd /d %currentDir% tasklist | findstr "Nox.exe" > nul 2>&1 IF %ERRORLEVEL% EQU 1 GOTO compress_files for /f %%i in ('dir /b "%currentDir%BignoxVMS"') do ( if "%%i"=="nox" ( set /a port=62001 ) else ( for /f "tokens=2 delims=_" %%j in ("%%i") do ( set /a port=62024+%%j ) ) start /b cmd /c adb.exe connect 127.0.0.1:!port! > nul 2>&1 ) for /f "skip=1" %%i in ('nox_adb.exe devices') do ( set a=%%i if "!a:~0,3!" NEQ "127" ( echo, ) else ( for /f "tokens=2 delims=:" %%j in ("!a!") do ( set port=%%j start /b cmd /c nox_adb.exe -s 127.0.0.1:!port! logcat -d > "%currentDir%NoxPlayerLogs\logcats\!port!_logcat.txt" ) ) ) ::wait for output logcat ping 127.0.0.1 -n 6 > nul 2>&1 taskkill /im nox_adb.exe /f > nul 2>&1 :compress_files 7za.exe a -t7z NoxPlayerLogs\NoxPlayerLogs.7z .\NoxPlayerLogs\* -r -mx=9 -m0=LZMA2 -ms=10m -mf=on -mhc=on -mmt=on > nul 2>&1 cd NoxPlayerLogs rd /s /q BigNoxInstallPack > nul 2>&1 rd /s /q Log_multi > nul 2>&1 rd /s /q Nox > nul 2>&1 rd /s /q vmInstall > nul 2>&1 rd /s /q vmlogs > nul 2>&1 rd /s /q UpdateDownloaderlog > nul 2>&1 rd /s /q logcats > nul 2>&1 start explorer "%currentDir%NoxPlayerLogs"