|
| 1 | +namespace Unity.Android.Logcat |
| 2 | +{ |
| 3 | + internal static class AndroidLogcatAdbCommandCatalog |
| 4 | + { |
| 5 | + internal static readonly AndroidLogcatCommandEntry[] All = new[] |
| 6 | + { |
| 7 | + // --- Device Management --- |
| 8 | + new AndroidLogcatCommandEntry("List Devices", "adb devices"), |
| 9 | + new AndroidLogcatCommandEntry("List Devices (Verbose)", "adb devices -l"), |
| 10 | + new AndroidLogcatCommandEntry("Start Server", "adb start-server"), |
| 11 | + new AndroidLogcatCommandEntry("Kill Server", "adb kill-server"), |
| 12 | + new AndroidLogcatCommandEntry("Reboot Device", "adb reboot"), |
| 13 | + new AndroidLogcatCommandEntry("Reboot to Bootloader", "adb reboot bootloader"), |
| 14 | + new AndroidLogcatCommandEntry("Reboot to Recovery", "adb reboot recovery"), |
| 15 | + new AndroidLogcatCommandEntry("Get Device State", "adb get-state"), |
| 16 | + new AndroidLogcatCommandEntry("Get Serial Number", "adb get-serialno"), |
| 17 | + new AndroidLogcatCommandEntry("Wait for Device", "adb wait-for-device"), |
| 18 | + |
| 19 | + // --- App Management --- |
| 20 | + new AndroidLogcatCommandEntry("List All Packages", "adb shell pm list packages"), |
| 21 | + new AndroidLogcatCommandEntry("List Third-Party Packages", "adb shell pm list packages -3"), |
| 22 | + new AndroidLogcatCommandEntry("List System Packages", "adb shell pm list packages -s"), |
| 23 | + new AndroidLogcatCommandEntry("Clear App Data", "adb shell pm clear <package>"), |
| 24 | + new AndroidLogcatCommandEntry("Force Stop App", "adb shell am force-stop <package>"), |
| 25 | + new AndroidLogcatCommandEntry("Start Activity", "adb shell am start -n <package/activity>"), |
| 26 | + new AndroidLogcatCommandEntry("Start App (Launcher)", "adb shell monkey -p <package> -c android.intent.category.LAUNCHER 1"), |
| 27 | + new AndroidLogcatCommandEntry("Start App (UnityPlayerActivity)", "adb shell am start -n <package>/com.unity3d.player.UnityPlayerActivity"), |
| 28 | + new AndroidLogcatCommandEntry("Start App (GameActivity)", "adb shell am start -n <package>/com.google.androidgamesdk.GameActivity"), |
| 29 | + new AndroidLogcatCommandEntry("Uninstall App", "adb uninstall <package>"), |
| 30 | + new AndroidLogcatCommandEntry("Install APK", "adb install <path.apk>"), |
| 31 | + new AndroidLogcatCommandEntry("Install APK (Replace)", "adb install -r <path.apk>"), |
| 32 | + new AndroidLogcatCommandEntry("Install Multiple APKs (Split)", "adb install-multiple -r <path1.apk> <path2.apk>"), |
| 33 | + new AndroidLogcatCommandEntry("Push OBB File", "adb push <local.obb> /sdcard/Android/obb/<package>/"), |
| 34 | + new AndroidLogcatCommandEntry("Create OBB Directory", "adb shell mkdir -p /sdcard/Android/obb/<package>"), |
| 35 | + new AndroidLogcatCommandEntry("Grant Permission", "adb shell pm grant <package> <permission>"), |
| 36 | + new AndroidLogcatCommandEntry("Revoke Permission", "adb shell pm revoke <package> <permission>"), |
| 37 | + new AndroidLogcatCommandEntry("Dump App Info", "adb shell dumpsys package <package>"), |
| 38 | + |
| 39 | + // --- File Transfer --- |
| 40 | + new AndroidLogcatCommandEntry("Push File to Device", "adb push <local> <remote>"), |
| 41 | + new AndroidLogcatCommandEntry("Pull File from Device", "adb pull <remote> <local>"), |
| 42 | + new AndroidLogcatCommandEntry("List Directory", "adb shell ls -la <path>"), |
| 43 | + new AndroidLogcatCommandEntry("Remove File", "adb shell rm <path>"), |
| 44 | + new AndroidLogcatCommandEntry("Make Directory", "adb shell mkdir -p <path>"), |
| 45 | + |
| 46 | + // --- Logcat --- |
| 47 | + new AndroidLogcatCommandEntry("View Logcat", "adb logcat"), |
| 48 | + new AndroidLogcatCommandEntry("Clear Logcat", "adb logcat -c"), |
| 49 | + new AndroidLogcatCommandEntry("Dump Logcat & Exit", "adb logcat -d"), |
| 50 | + new AndroidLogcatCommandEntry("Logcat Errors Only", "adb logcat *:E"), |
| 51 | + new AndroidLogcatCommandEntry("Logcat Warnings & Above", "adb logcat *:W"), |
| 52 | + new AndroidLogcatCommandEntry("Logcat with Timestamps", "adb logcat -v time"), |
| 53 | + new AndroidLogcatCommandEntry("Logcat by Tag", "adb logcat -s <TAG>"), |
| 54 | + new AndroidLogcatCommandEntry("Logcat Unity Only", "adb logcat -s Unity"), |
| 55 | + |
| 56 | + // --- Screen Capture --- |
| 57 | + new AndroidLogcatCommandEntry("Take Screenshot", "adb shell screencap /sdcard/screenshot.png"), |
| 58 | + new AndroidLogcatCommandEntry("Record Screen", "adb shell screenrecord /sdcard/recording.mp4"), |
| 59 | + new AndroidLogcatCommandEntry("Record Screen (30s)", "adb shell screenrecord --time-limit 30 /sdcard/recording.mp4"), |
| 60 | + |
| 61 | + // --- System Info --- |
| 62 | + new AndroidLogcatCommandEntry("Get Android Version", "adb shell getprop ro.build.version.release"), |
| 63 | + new AndroidLogcatCommandEntry("Get SDK Version", "adb shell getprop ro.build.version.sdk"), |
| 64 | + new AndroidLogcatCommandEntry("Get Device Model", "adb shell getprop ro.product.model"), |
| 65 | + new AndroidLogcatCommandEntry("Get Device Manufacturer", "adb shell getprop ro.product.manufacturer"), |
| 66 | + new AndroidLogcatCommandEntry("Get All Properties", "adb shell getprop"), |
| 67 | + new AndroidLogcatCommandEntry("Get Screen Resolution", "adb shell wm size"), |
| 68 | + new AndroidLogcatCommandEntry("Get Screen Density", "adb shell wm density"), |
| 69 | + new AndroidLogcatCommandEntry("Get Battery Info", "adb shell dumpsys battery"), |
| 70 | + new AndroidLogcatCommandEntry("Get CPU Info", "adb shell cat /proc/cpuinfo"), |
| 71 | + new AndroidLogcatCommandEntry("Get Memory Info", "adb shell cat /proc/meminfo"), |
| 72 | + new AndroidLogcatCommandEntry("Get Disk Usage", "adb shell df"), |
| 73 | + new AndroidLogcatCommandEntry("Get Running Processes", "adb shell ps"), |
| 74 | + new AndroidLogcatCommandEntry("Get Top Processes", "adb shell top -n 1"), |
| 75 | + new AndroidLogcatCommandEntry("Get Build Properties", "adb shell cat /system/build.prop"), |
| 76 | + |
| 77 | + // --- Input Simulation --- |
| 78 | + new AndroidLogcatCommandEntry("Send Keyevent (Home)", "adb shell input keyevent KEYCODE_HOME"), |
| 79 | + new AndroidLogcatCommandEntry("Send Keyevent (Back)", "adb shell input keyevent KEYCODE_BACK"), |
| 80 | + new AndroidLogcatCommandEntry("Send Keyevent (Menu)", "adb shell input keyevent KEYCODE_MENU"), |
| 81 | + new AndroidLogcatCommandEntry("Send Keyevent (Power)", "adb shell input keyevent KEYCODE_POWER"), |
| 82 | + new AndroidLogcatCommandEntry("Send Keyevent (Volume Up)", "adb shell input keyevent KEYCODE_VOLUME_UP"), |
| 83 | + new AndroidLogcatCommandEntry("Send Keyevent (Volume Down)", "adb shell input keyevent KEYCODE_VOLUME_DOWN"), |
| 84 | + new AndroidLogcatCommandEntry("Send Keyevent (Enter)", "adb shell input keyevent KEYCODE_ENTER"), |
| 85 | + new AndroidLogcatCommandEntry("Send Keyevent (Tab)", "adb shell input keyevent KEYCODE_TAB"), |
| 86 | + new AndroidLogcatCommandEntry("Send Text", "adb shell input text <text>"), |
| 87 | + new AndroidLogcatCommandEntry("Tap Screen", "adb shell input tap <x> <y>"), |
| 88 | + new AndroidLogcatCommandEntry("Swipe Screen", "adb shell input swipe <x1> <y1> <x2> <y2>"), |
| 89 | + |
| 90 | + // --- Networking --- |
| 91 | + new AndroidLogcatCommandEntry("Enable WiFi ADB", "adb tcpip 5555"), |
| 92 | + new AndroidLogcatCommandEntry("Connect via IP", "adb connect <ip>:5555"), |
| 93 | + new AndroidLogcatCommandEntry("Disconnect All", "adb disconnect"), |
| 94 | + new AndroidLogcatCommandEntry("Forward Port", "adb forward tcp:<local> tcp:<remote>"), |
| 95 | + new AndroidLogcatCommandEntry("Reverse Port", "adb reverse tcp:<remote> tcp:<local>"), |
| 96 | + new AndroidLogcatCommandEntry("Get IP Address", "adb shell ip addr show wlan0"), |
| 97 | + new AndroidLogcatCommandEntry("Ping Host", "adb shell ping -c 4 <host>"), |
| 98 | + |
| 99 | + // --- Dumpsys --- |
| 100 | + new AndroidLogcatCommandEntry("Dump Activity Stack", "adb shell dumpsys activity activities"), |
| 101 | + new AndroidLogcatCommandEntry("Dump Memory Info", "adb shell dumpsys meminfo"), |
| 102 | + new AndroidLogcatCommandEntry("Dump Window Info", "adb shell dumpsys window"), |
| 103 | + new AndroidLogcatCommandEntry("Dump Display Info", "adb shell dumpsys display"), |
| 104 | + new AndroidLogcatCommandEntry("Dump CPU Info", "adb shell dumpsys cpuinfo"), |
| 105 | + new AndroidLogcatCommandEntry("Dump Battery Stats", "adb shell dumpsys batterystats"), |
| 106 | + new AndroidLogcatCommandEntry("Dump SurfaceFlinger", "adb shell dumpsys SurfaceFlinger"), |
| 107 | + new AndroidLogcatCommandEntry("Dump Graphics Stats", "adb shell dumpsys gfxinfo <package>"), |
| 108 | + new AndroidLogcatCommandEntry("Dump Wifi Info", "adb shell dumpsys wifi"), |
| 109 | + new AndroidLogcatCommandEntry("Dump Alarm Info", "adb shell dumpsys alarm"), |
| 110 | + new AndroidLogcatCommandEntry("Dump Notification Info", "adb shell dumpsys notification"), |
| 111 | + |
| 112 | + // --- Settings --- |
| 113 | + new AndroidLogcatCommandEntry("Enable Stay Awake", "adb shell settings put global stay_on_while_plugged_in 3"), |
| 114 | + new AndroidLogcatCommandEntry("Disable Stay Awake", "adb shell settings put global stay_on_while_plugged_in 0"), |
| 115 | + new AndroidLogcatCommandEntry("Show Touches On", "adb shell settings put system show_touches 1"), |
| 116 | + new AndroidLogcatCommandEntry("Show Touches Off", "adb shell settings put system show_touches 0"), |
| 117 | + new AndroidLogcatCommandEntry("Enable USB Debugging", "adb shell settings put global adb_enabled 1"), |
| 118 | + new AndroidLogcatCommandEntry("Set Screen Off Timeout", "adb shell settings put system screen_off_timeout <ms>"), |
| 119 | + |
| 120 | + // --- Debug / Advanced --- |
| 121 | + new AndroidLogcatCommandEntry("Bug Report", "adb bugreport"), |
| 122 | + new AndroidLogcatCommandEntry("Remount System", "adb remount"), |
| 123 | + new AndroidLogcatCommandEntry("Root Shell", "adb root"), |
| 124 | + new AndroidLogcatCommandEntry("Unroot Shell", "adb unroot"), |
| 125 | + new AndroidLogcatCommandEntry("Disable Verity", "adb disable-verity"), |
| 126 | + new AndroidLogcatCommandEntry("Enable Verity", "adb enable-verity"), |
| 127 | + new AndroidLogcatCommandEntry("Wait for Device Boot", "adb wait-for-device shell getprop sys.boot_completed"), |
| 128 | + new AndroidLogcatCommandEntry("List Tombstones", "adb shell ls -lt /data/tombstones/"), |
| 129 | + new AndroidLogcatCommandEntry("Pull Tombstone", "adb pull /data/tombstones/<tombstone_XX> <local_path>"), |
| 130 | + |
| 131 | + // --- Meta Quest / XR --- |
| 132 | + new AndroidLogcatCommandEntry("List OVR Packages", "adb shell pm list packages | grep oculus"), |
| 133 | + new AndroidLogcatCommandEntry("Get Guardian State", "adb shell dumpsys OVRGuardianService"), |
| 134 | + new AndroidLogcatCommandEntry("Get Compositor Stats", "adb shell dumpsys OVRCompositor"), |
| 135 | + new AndroidLogcatCommandEntry("Set GPU Level", "adb shell setprop debug.oculus.gpuLevel <0-4>"), |
| 136 | + new AndroidLogcatCommandEntry("Set CPU Level", "adb shell setprop debug.oculus.cpuLevel <0-4>"), |
| 137 | + new AndroidLogcatCommandEntry("Enable Perf Overlay", "adb shell setprop debug.oculus.enablePerfOverlay 1"), |
| 138 | + new AndroidLogcatCommandEntry("Disable Perf Overlay", "adb shell setprop debug.oculus.enablePerfOverlay 0"), |
| 139 | + new AndroidLogcatCommandEntry("Set Fixed Foveation", "adb shell setprop debug.oculus.foveation.level <0-4>"), |
| 140 | + new AndroidLogcatCommandEntry("Set Refresh Rate", "adb shell setprop debug.oculus.refreshRate <72|90|120>"), |
| 141 | + |
| 142 | + // --- AAB / Bundletool --- |
| 143 | + new AndroidLogcatCommandEntry("bundletool: Build Split APKs", "java -jar bundletool.jar build-apks --bundle=<path.aab> --output=<output.apks> --connected-device"), |
| 144 | + new AndroidLogcatCommandEntry("bundletool: Install APKs", "java -jar bundletool.jar install-apks --apks=<path.apks>"), |
| 145 | + new AndroidLogcatCommandEntry("bundletool: Get Device Spec", "java -jar bundletool.jar get-device-spec --output=<device-spec.json>"), |
| 146 | + }; |
| 147 | + } |
| 148 | +} |
0 commit comments