logging - How do you save an Android application log to a file on a physical device? -


i want know why android application service goes down (whether it's os killing or crasch) , therefore want save log file on phone. how can done?

basically got 2 possibilities , first 1 should finding reason crash without coding since logcat should show error occurred led service end.

1) using logcat command

having log.i("your tag", "output text") can intercept messages using android eclipse plugin or calling adb logcat command line, having android device connected , service running.

see http://developer.android.com/guide/developing/tools/adb.html#logat

2) writing stdout

using system.out.println("...") command can configure device write stdout file:

adb shell stop adb shell setprop log.redirect-stdio true adb shell start 

see http://developer.android.com/guide/developing/tools/adb.html#stdout

obviously have spread lot of debug output messages on application, @ critical points.

good luck finding error!


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -