UPDATED How to write logs to a file in the application that testers check?

Logging is necessary when any errors appear or are thrown out of the application.

  • No it's not that. I mean if the application is tested not connected to Android Studio. Say it being tested by someone else's person. And if he gets an error so that this error is logged to the log file - Abdugani_T
  • Well so in all dumb places to write logs (for example, log4j to help). - Oleksiy Morenets
  • @Abdugani_T as I understand it, the question is when testers catch a bug, how can they give the programmer an error log, right? - iamtihonov

1 answer 1

The first option is to connect the device to a computer that has previously downloaded adb and save the log to a file after an error appears with the command:

adb logcat> logcat.txt

The second option, if the device has a ROOT use the application from GooglePlay CatLog or Log collector and the like.

The third option is to use a service that sends logs to the server immediately, which can be viewed in real time, for example, the Hockey App or Acra .

Another option is to use the Hyperion-Android library and its module 'com.willowtreeapps.hyperion:hyperion-crash:0.9.24' , which after the appearance of an error will display and use it.

  • Is there an option with a code so that when an error is detected, it is written to a file? - Abdugani_T
  • I added another option, to the account of saving it, you need to write an error listener yourself, for example, stackoverflow.com/a/16562770 and in it I think to write an error to the file. - iamtihonov pm