Tutorial How to get logs from your Android device

AndnixSH

PMT Elite Modder
Staff member
Modding-Team
Logcat is the Android logging system provides a mechanism for collecting and viewing system debug output. Logs from various applications and portions of the system are collected in a series of circular buffers.

Non-rooted device:
Matlog/Laughing Logger app (Recommended):

Download Matlog or Laughing Logger app for Android and install it

No PC method (Android 11 and above & Wi-Fi required)
Note: Some devices running Android 11 and above don't have Wireless Debugging. If you don't have Wireless Debugging, and don't have Wi-Fi, then you need PC

Download aShellYou app: Releases · DP-Hridayan/aShellYou

Follow the tutorial how to Connect Self Device: Wireless Debugging Setup

If you have problem connecting, use Shizuku method instead

After connecting, tap the ADB via Wireless Debugging or Local ADB card, select the connected device, and run one of the commands

Laughing Logger:
Code:
adb shell pm grant org.laughing.logger android.permission.READ_LOGS

Matlog:
Code:
adb shell pm grant com.pluscubed.matloglibre android.permission.READ_LOGS

If it says "Process exited with code: 0", it means it is running successfully

Screenshot_20250621-220343.png


PC method
Note: You need a basic knowledge of CMD/Terminal

First, enable USB debugging: Configure on-device developer options | Android Studio | Android Developers

Download standalone SDK Platform Tools for Windows/Mac/Linux: SDK Platform Tools release notes | Android Developers

Open CMD/Terminal.

Navigate to platform tools directory using "cd" command

Copy and paste this command into CMD/Terminal

Laughing Logger:
Code:
./adb shell pm grant org.laughing.logger android.permission.READ_LOGS

Matlog:
Code:
./adb shell pm grant com.pluscubed.matloglibre android.permission.READ_LOGS

1658422735965.png


See more about ADB: Android Debug Bridge (adb) | Android Developers

Recording logs
After giving the app permisson to read logs, you can now record logs. During recording, make sure to replicate a bug or crash to catch the useful logs for diagnosis

Laughing Logger file location:
  • Android 11 and above: /storage/emulated/0/Android/media/org.laughing.logger/Laughing Logger/saved_logs/
  • Android 10 and below: /storage/emulated/0/Laughing Logger/saved_logs/
Matlog file location:
  • Android 11 and above: /storage/emulated/0/Documents/matlog/savedlogs
  • Android 10 and below: /storage/emulated/0/matlog/savedlogs
1658423087137.png

Android Studio:
Note: USB debugging is required. Android Studio might be complicated to setup, but the logcat interface is easier to use

For phones and tablets: Enable USB debugging: Configure on-device developer options | Android Studio | Android Developers

For emulators:
- AVD/MEmuPlay: Rebooting/starting the emulator and it will automatically connect.
- LDPlayer: Open emulator settings > Other > And change ADB debugging to "Enable remote connection"
- Bluestacks: Open emulator settings > Advanced > Turn on "Connect to Android at 127.0.0.1:XXXX"
- Nox: Manually connect to adb by typing adb connect 127.0.0.1:62001 into CMD/Powershell. Port for the main instance is 62001. Other instances may have open ports starting with 62025 or above
- MuMu: Manually connect to adb by typing adb connect 127.0.0.1:7555 into CMD/Powershell. Port is always 7555 regardless of instance
- Other emulators: Figure out the port by yourself. You can use network tool like netstat to check

Download Android Studio for Windows/Mac/Linux: Download Android Studio & App Tools - Android Developers

Install Android Studio: Install Android Studio | Android Developers

After installation, open Android Studio and create a new project.

At the bottom of toolbar, open the logcat. Your device should be detected, and will constantly sending logs.

1764860866770.png


To save logs, simply select all (CTRL + A), copy (CTRL + C) and paste (CTRL + V) onto text editor, and save as text file.

Video tutorial:

ADB command line (Advanced):
Note: USB debugging is required and you need a basic knowledge of CMD/Terminal

For phones and tablets: Enable USB debugging: Configure on-device developer options | Android Studio | Android Developers

For emulators:
- AVD/MEmuPlay: Rebooting/starting the emulator and it will automatically connect.
- LDPlayer: Open emulator settings > Other > And change ADB debugging to "Enable remote connection"
- Bluestacks: Open emulator settings > Advanced > Turn on "Connect to Android at 127.0.0.1:XXXX"
- Nox: Manually connect to adb by typing adb connect 127.0.0.1:62001 into CMD/Powershell. Port for the main instance is 62001. Other instances may have open ports starting with 62025 or above
- MuMu: Manually connect to adb by typing adb connect 127.0.0.1:7555 into CMD/Powershell. Port is always 7555 regardless of instance
- Other emulators: Figure out the port by yourself. You can use network tool like netstat to check

Download standalone SDK Platform Tools for Windows/Mac/Linux: SDK Platform Tools release notes | Android Developers

Open CMD/Terminal

Change directory to platform tools directory using "cd" command

Type

Code:
./adb logcat > (path)

or on current directory

Code:
./adb logcat > log.txt

If you have more than one device connected, list your devices

Code:
./adb devices

And use -s flag

Code:
./adb -s (device name) logcat > (path)

Nothing will appear on the prompt but it is actually running, it is because the output are saving to disk directly. To stop logging, simply close the window

1658423006447.png


See more about adb logcat:

Video tutorial:


Rooted device/emulator/virtual machine:
Download Matlog or Laughing Logger app for Android and install it

Launch the app and grant root permission

Now you can record logs

Laughing Logger file location:
  • Android 11 and above: /storage/emulated/0/Android/media/org.laughing.logger/Laughing Logger/saved_logs/
  • Android 10 and below: /storage/emulated/0/Laughing Logger/saved_logs/
Matlog file location:
  • Android 11 and above: /storage/emulated/0/Documents/matlog/savedlogs
  • Android 10 and below: /storage/emulated/0/matlog/savedlogs
1658423087137.png
 

Attachments

  • 1658417819502.png
    1658417819502.png
    255 KB · Views: 1,675
Last edited:
Back
Top Bottom