-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstart-logging.ps1
More file actions
20 lines (20 loc) · 829 Bytes
/
Copy pathstart-logging.ps1
File metadata and controls
20 lines (20 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
adb shell am force-stop com.beatgames.beatsaber
adb shell am start com.beatgames.beatsaber/com.unity3d.player.UnityPlayerActivity
$timestamp = Get-Date -Format "MM-dd HH:mm:ss.fff"
$bspid = adb shell pidof com.beatgames.beatsaber
while ([string]::IsNullOrEmpty($bspid)) {
Start-Sleep -Milliseconds 100
$bspid = adb shell pidof com.beatgames.beatsaber
}
if ($args.Count -eq 0) {
echo "Start logging!"
adb logcat -T "$timestamp" --pid $bspid
}
if ($args[0] -eq "--file") {
echo "Logging and saving to file!"
(adb logcat -T "$timestamp" --pid $bspid | Select-String -pattern "(QuestHook|modloader|AndroidRuntime)") | Tee-Object -FilePath $PSScriptRoot/logcat.log
}
if ($args[0] -eq "--log") {
echo "Logging and saving to file!"
adb logcat -T "$timestamp" --pid $bspid > $PSScriptRoot/logcat.log
}