Logback to capture all logs displayed in adb logcat - android

Currently logback captures all the logs to a file that are mentioned via error, debug etc.
Apart from this logs, in Android Studio logcat we could we other logs that are provided by other apps or by the Android System.
Is there a mechanism to include all the logs that are available in adb logcat to the logs created using logback?

Unfortunately, no :
For security reason, an application can only see its own logcat, since Android 4.1 (API 16) there is no way for it to access logs from other applications or from the system.
While it is possible to add logback events to the logcat with a suitable appender, the other way around is not easy. There is no API to access the logcat events. The only solution would be for the application to launch the adb logcat command (without the usual -d flag), continuously read its output and create logback events.

Related

Activating Serial console in AOSP based Tinkerboard 2 platform

I am using AOSP to do some projects with TinkerBoard2 board. I have a problem enabling the serial console input. I have changed kernel command line arguments in order to ovveride console as such:
console=ttyS2,115200 androidboot.console=ttyS2,115200
Now I am able to see output in /dev/ttyS2 while device boots. However, there is no single user login (console opening) on that TTY. I have an idea what to do in Linux, but for Android don't have much understanding how to open up this console. I have came across following documentation that is written for another Android board, but this mostly seem unapplicable to my case:
https://android.googlesource.com/kernel/msm.git/+/android-msm-shamu-3.10-lollipop-mr1/Documentation/serial-console.txt
What I found also from TinkerBoard2 sources how console for ADB is opened:
on fs && property:ro.debuggable=1
start console
service console /system/bin/sh
console
disabled
seclabel u:r:shell:s0
Any guidance is appreciated. How do I add a console for /dev/ttyS2 for this Android board? Is getty usable for Android platforms?
Thanks

Crashlytics works on production but doesn't work on test

It's a weird situation. I have a react native app that has a test and production environment. On the production side, my app is correctly integrated with crashlytics. But when I try to integrate on test apk, I see only "App detected and we're waiting for a crash!"
SS
Test and prod use the same application, the only difference is google-service.json files. I've not found anything. Please help.
Some notes:
I've tried on emulator and physical devices.
When I try to see dashboard for prod build, I can see correctly.
I don't think that it is related by package versions(Because it works on prod). So I didn't put those.
I 've seen " Crashlytics automatic data collection DISABLED by API" with adb logcat -s FirebaseCrashlytics command
When running the app, if you see the "App detected and we're waiting for a crash!" message, that means that the SDK was able to connect with the back end. But something could be preventing the SDK from sending crashes.
The first thing to do would be checking if the mapping file contains the parameter firebase_crashlytics_collection_enabled and if it is set to false. Check this document.
If so, you can override this parameter opting in with the code:
Firebase.crashlytics.setCrashlyticsCollectionEnabled(true)

Android Studio debugging of native app with SELinux policies set to permissive

I have a native Android app that needs to access one of the device's I2C buses. From what I read here, one needs to set the SELinux policies to "permissive" in order to do so.
However, when I do that, I start getting this error when I try to launch Android Studio's native debugger:
Error while starting native debug session: com.intellij.execution.ExecutionException: Unsupported device. This device cannot be debugged using the native debugger. See log file for details.
I checked the log but couldn't find anything relevant in there.
Any idea if there's an incompatibility between having the SELinux policies set to "permissive" and running the native debugger on Android Studio?

Android Things {AppName} has stopped - get logs

I'm running a build from the Android Things Console built with several custom apks
One of the apps is failing with "{AppName}" has stopped. Open app again" The cause appears isolated to only one Configuration.
I'm trying to get to root cause, normally I would run "adb logcat" to view full details with android. Is adb logcat support with Android Things build? Is a mechanism such as logcat available in Android Things when built with a build from the Android Things Console? If not, is there an alternative?
ADB is available on development images of Android Things, not on production builds. You can change which one in the console. You can also add crash reporting tools like Crashlytics which will provide crash reports for you.

Android Log Memory Usage

My question is simple. In Android app, when we write
Log.d("TAG","log message");
and run this app on device, where does this log goes? We can see this log in logcat in Eclipse.
The log is saved on the device, sommewhere. You can access it with 'adb logcat' commands in adb.
Note that, when publishing the app, you should not log debug messages. Errors only.
using DDMS, as described here

Categories

Resources