https://github.com/unityvn/android_device_monitor_tool_logcat
Android Device Monitor - Android logcat tool installed in unity
https://github.com/unityvn/android_device_monitor_tool_logcat
android-debug-tools android-device-monitor android-logcat androidlog unity unity3d
Last synced: 23 days ago
JSON representation
Android Device Monitor - Android logcat tool installed in unity
- Host: GitHub
- URL: https://github.com/unityvn/android_device_monitor_tool_logcat
- Owner: unityvn
- Created: 2025-04-18T09:16:13.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-18T11:03:25.000Z (about 1 year ago)
- Last Synced: 2025-04-18T22:56:22.724Z (about 1 year ago)
- Topics: android-debug-tools, android-device-monitor, android-logcat, androidlog, unity, unity3d
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Android Device Monitor - Android logcat tool
- Để tìm bug khi build game ra thiết bị android thì mọi người hay dùng tool nào? Ngoài sử dụng `Android Studio` hoặc vào package manager của unity để cài tool `Android Logcat` thì mình thấy khá ít anh em biết có sự tồn tại của một tool logcat nữa được tích hợp sẵn khi mọi người cài unity editor.
- Tool mà mình đang nói đến là `Android Device Monitor`, mình thường dùng tool này là chủ yếu vì mình thấy giao diện của nó khá giống với log của `Android Studio` mà lại không phải cài thêm `Android Studio` gây tốn thêm bộ nhớ cho máy tính.

### Lưu ý
- Chỉ chạy trên window (máy mac thì bỏ qua luôn)
- Trong máy phải có java sdk 8 (cái này nếu không mở được lên thì chỉ cần down bừa một bản java sdk 8 về cài vào máy là chạy được, không phải setup thêm gì [(Mình ghim 1 version java sdk 8 ở đây nhé)](https://github.com/unityvn/android_device_monitor_tool_logcat/releases/download/1.0.0/JavaSetup8u441.exe))
### Cách dùng
- Lấy SDK path trong unity

- Mở theo sdk path > tools > monitor

Đến đây chỉ cần mở monitor lên và dùng thôi (nếu mở thông thường không được thì hãy thử mở bằng Administrator)
- Hoặc ném method này vào static class nào đó rồi gọi nó ra cũng có thể mở được Monitor lên nhé
```csharp
public static void OpenMonitor()
{
string path = $"{AndroidExternalToolsSettings.sdkRootPath}/tools/monitor.bat";
if (File.Exists(path))
{
Process process = new Process();
process.StartInfo.FileName = path;
process.StartInfo.Verb = "runas";
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.Start();
}
}
```
`Chúc anh em nghịch thành công!`