How to get Android device log on Windows 10
Mobile devices and the apps that run on them run into trouble. If you develop apps for a mobile platform, you probably already know how to get the device log for Android phones and view what’s causing a crash or bug. If you’re an end-user, though, and you need to get an Android device’s log, you will find that the process is complicated to follow with lots of tools that need to be installed. Here’s a much simpler and just as effective method you can use to get an Android device log.
Get Android device log
In order to get the Android device log you need;
- A Windows 10 PC that you have admin access on.
- A data cable that you can use to connect your phone to the PC.
- The Android device on hand.
Follow each of the steps below in sequence, and you will have your Android device log within a matter of minutes. This will work regardless of which version of Android is running on your phone or which phone you have.
1. Enable Developer options
Follow these steps on your Android device.
- Open the Settings app.
- Go to About Phone.
- Look for Build number.
- Tap Build number seven times, and Developer options will be enabled.
2. Turn on USB debugging
Follow these steps on your Android device.
- Open the Settings app.
- Go to System.
- Expand Advanced.
- Tap Developer Options.
- Scroll down to the Debugging section.
- Turn on USB Debugging.
3. Download ADB tools for Windows 10
Perform these steps on your Windows 10 system.
- Download the ADB and Fastboot tools for Windows 10 (https://redirect.viglink.com/?format=go&jsonp=vglnk_159748438694611&key=375566b60d6830a5cce1fcbb1ebbab5d&libId=kdvgyets0102gais000DAf0bdbw4u&loc=https%3A%2F%2Fwww.addictivetips.com%2Fandroid%2Fdownload-adb-and-fastboot%2F&ccpaConsent=1—&v=1&opt=true&out=https%3A%2F%2Fdl.google.com%2Fandroid%2Frepository%2Fplatform-tools-latest-windows.zip) from this link.
- Extract the zipped folder.
- Copy the complete path to the Platform-tools folder to your clipboard.
4. Access Android device on Windows 10 with ADB tools
You will need to interact with both your Windows 10 system and Android device in this step.
- Open Command Prompt with admin rights.
- Use the cd command to move to the Platform-tools folder.
cd path-to-Platform-tools-folder
Example
cd C:\Users\fatiw\Desktop\platform-tools_r30.0.4-windows\platform-tools
- Connect your Android device to your Windows 10 PC with the data cable.
- Unlock the device and make sure the screen is awake.
- On Windows 10, run the following command in the Command Prompt window that is already open.
adb.exe kill-server
If you see the “cannot connect to daemon at tcp:5037: cannot connect to 127.0.0.1:5037: No connection could be made because the target machine actively refused it. (10061)” error, don’t worry and proceed to the next step.
- Run the following command in the Command Prompt window.
adb.exe devices
- Look at your Android device. You will see a prompt asking for permission to Allow USB debugging. Tap Allow.
- Run this command, and the device ID should be accompanied by ‘device.’ Note the device ID down.
adb.exe devices
5. Start logging device events
- You’re now ready to start creating a log. Run the following command in the Command Prompt window. Replace the [device id] with the ID obtained in the previous step.
adb.exe logcat -v threadtime [device id] > C:\android-debug.log
Example
adb.exe logcat -v threadtime PT99621AA1A40100564 > C:\android-debug.log
- Interact with your Android device and reproduce the bug or crash or whatever activity it is you want to log.
- Once you’re done, return to the Command Prompt window, and tap Ctrl+C to end the log.
- The log can be accessed from the root of the C drive. The file will be called android-debug.log.
Conclusion
An Android device is fairly easy to debug regardless if you’re using a Windows 10 system or if you’re using Linux or a Mac. Android does not impose a lot of restrictions when it comes to which platform you can develop for it on. If you’re wondering whether or not you need Android Studio, special USB drivers, or an SDK installed to get the log, you don’t, as is evident from the steps above. Make sure you’re able to access your Android phone’s storage from File Explorer, and everything will go smoothly.
How do i only find the error in all of that file?