when I'm using the Android emulator I can do "adb logcat" to see output messages (log / system.out.println) originated from my code. It also shows the stack trace of exceptions which happen during execution.
But, when I'm using a real phone, "adb logcat" does not do / show anything.
I also tried "adb -d logcat" which also does not display anything.
Is there any way to get it working with the real phone?
Thanks.
UPDATE:
I just tried "adb -s ? logcat" ('?' is the serial number of the device) and also got no results.
I tried another "adb" command to see if anything was working: "adb -s ? bugreport". This printed a lot of stuff. Example: "Memory Info", "CPU Info" and some Java specific things. So it seams that some stuff is working.
8. Finally, you can run ADB commands on your Android device without any computer. You don't need to add adb or adb shell initializers in this app as you are already within the local ADB shell.
View your app logs Build and run your app on a device. Click View > Tool Windows > Logcat (or click Logcat in the tool window bar).
Enable USB debugging on your device.
Connect the device to computer
Use these commands:
Get the "device id"
adb devices
example:
$ adb devices List of devices attached 5856423841563398 device emulator-5554 device
To specify the device when using logcat
adb -s "device id" logcat
example:
$ adb -s 5856423841563398 logcat --------- beginning of crash 03-31 15:56:51.174 13547 13547 E AndroidRuntime: FATAL EXCEPTION: main
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With