drmrbrewer
drmrbrewer

Reputation: 13079

Android app: logging on the device

I'm still fairly new to Android coding. I've made lots of use of the Log.d() function in my code to display lots of handy logging messages to the logcat console within the Android Studio environment, when I run the app with the device connected to the computer (or on an emulator).

Now I'd like to be able to get debug information from a user when the app is running on their device, hopefully showing the same Log.d() messages that I see in the logcat console within Android Studio.

I've done some searching but can't seem to find a straightforward guide as to how this is achieved.

Thanks.

Upvotes: 2

Views: 170

Answers (2)

wildbio
wildbio

Reputation: 1

You can use a webserver, file-backed logger, or any other way of saving/submitting data on the fly.

Most people will recommend either some form of integrated web service like HockeyApp, etc., but you can get it done just by sending a plain old text file if needed. FYI, not best practice, but it gets the job done.

Upvotes: 0

Anson Yao
Anson Yao

Reputation: 1584

You have to use a web server. First send the content of logd() to your server and then check them on your server. However, you may want to test your own apps instead of asking users to test. Google developer console has a place to show some debug information if your app crashed when users are using them.

Upvotes: 1

Related Questions