Adb logcat crashes for many months - command

I'm working on a windows app to make diagnostics of android smartphone.
This app is performing adb commands to get many system informations.
For many months, I'm working on study logcat to make apps statistics and count :
Crashes by app
Number of start by app (or last starting date)
I'm using the command below
adb logcat -d -b events -v time
Thanks to this, I can extract and analyse occurences of "am_crash" lines and "am_activity_resume" to get some informations, but it seems that the output of my command is limited in the time. I'd like to get informations for many months, or if possible for all the lifetime of the smartphone connected.
Could someone help me to find a workaround ?

logcat buffers are circular and have predetermined size. You can change the size but the change won't be persistent. There is no "workaround" for the stock Android. You would need a custom logging app which would save all the events you want to a separate log.

Related

Android cold start How do I find what devices have issues

I uploaded a Flutter app to Google Play Console for some external testers to try.
In the Google Play Console there's a section Pre-Launch Report. In this section's "Overview" there's a subsection called "Performance", in here there are two items:
Cold start time
Your app took 6,982ms to launch for the first time, after being installed on this device model
and
Cold start time
Your app took 8,250ms to launch for the first time, after being installed on this device model
It has an arrow next to both items implying you can find out what device model had these huge start up times.
However, all it does is take me to a list of models that didn't have issues. That's not very useful to anyone.
Is there a way to find out what models it has issues on?
Look closely and you will see the device:

How can one rename a connectd device in Flutter run command?

In Flutter one can check available connected devices using flutter devices. When running one can do flutter run -d <device-name>. It turns out some devices have very long names, with numbers and letters combined. Is there a way to rename a connected device just for the current session?
There are few ways you can achieve this
Execute flutter run and it will display all devices in a numbered list. So all you have to do is enter a number and hit enter again
If your device is iohone xd45rchdjb...gjcf
You can execute flutter run -d iphone6.. you can ignore the ID part. Also you can pass only the ID and not pass the name. That will also work

Flutter application freezing

I am working on a mobile application in Flutter to
create a Bluetooth connection
receive data from this device
plot them on the screen using SfCartesianChart
Everything works fine, except that after a while, the application freezes completely. There is nothing I can do but quit the application. I have looked at the "Flutter performance" section, but I can't find any useful indication. Also, I don't see any errors on my command line. It is a total mystery. I keep looking but it's hopeless.
Well, I never understand why people are giving a "-1" instead of explaining something but I appreciate your suggestions on how I can resolve this error.

How to capture screenshots using UI automation on a iPhone?

I connected my iPhone 5s running iOS 8.3 to my mac which runs my script using "Automation Instrument" and I want to capture screenshots of UI during this process on my iPhone 5s and save them to my mac's disk at a particular location.
1.printing "target.logElementTree();" displays my elements but what I want is "Screenshot of device in realtime during run of automated script" so can we save the screenshot using this approach ????
2.I don't have the code of the app except the .ipa
Thanks for your time and efforts in going through or answering this question
With this command I am able to view the screenshot in trace log during automation.
UIATarget.localTarget().captureScreenWithName("Prabhu Konchada");
All we need to do is export these results to find them in the your desired folder !!!!

logs on second run of an ios application in the simulator

I have a question which seems like it should be a fairly common occurrence. I am trying to test code which only runs the first time an ios application is installed. While in principle this is very easy, I'm having trouble with it behaving properly the second time the app runs (note, this is not crash related).
I have been force running the app for a second time using the "Application does not run in background" flag in the plist, and then just hitting the home button. This works great, except i stop getting log data after the first run.
Does anyone know how to test for this situation in a way where you can continue seeing the log information after the app closes? For example, if there is a way to attach the xcode logger to the new process id? Or just another way to force an app reboot without losing the logging feature?
Thanks in advance!
Use the debugger menu:
Product>Attach To Process
(Results may vary with different versions of Xcode).
Also, you might need to insert a sleep at the very start of your launch to catch the very early log messages.
EDIT: If you're on a device then you can use the Device Organizer (cmd+shift+2) to watch all logs on a device.