16

Possible Duplicate:
How can I view and examine the Android log?

My android (2.1) phone (a HTC Wildfire, if that matters) sometimes reboots without an apparent reason. Not extremely frequently, but too much to simply ignore it.
I'd say once every couple of days.

It always happens when I'm not using the phone, I take it out of my pocket and am greeted by the SIM unlock screen, so it's hard to pinpoint the app or service that is causing it.

I browsed the filesystem a bit but couldn't immediately find anything like /var/log, so I wonder if anyone knows where logfiles are located, if they exist at all?

Or any other way to easily pinpoint the offending process on my phone?

1

3 Answers 3

4

If you want to examine the log outside the environment of your phone, there is the application LogCollector.

It's free and it allows you to send/upload the log to/with the program of your choice. I just send the log via gmail to my home email account.

It is always easier to read such log files on your pc screen, compared to reading it with whatever application on your (small) Android screen.

1

How do you know your phone has rebooted? Just because the lockscreen appears doesn't mean it rebooted. Check your battery stats, Settings > About Phone > Batter and look at the up and awake time. If the phone has been up for a long time its unlikely your phone is rebooting on you. Just check this after a time when you think the phone has rebooted.

I think you are going to have to use logcat to get logs from an Android phone. If your phone is rebooting on you, you could attempt to run logcat, but you would have to have logcat running continuously to capture what is going on and making it reboot. This is not very practical. But look below for info on logcat.

Instead of using logcat I would try just starting from a fresh install of Android. If you are rooted I would backup, wipe, and install a ROM from scratch. If you are not rooted, I would download the latest version of Android for your phone from HTC and install it. This will wipe your phone, but running from a clean slate should fix the reboot issue.

Once on your fresh Android install open Market place and install your apps starting with essentials only. DO NOT INSTALL any task killer of any kind. Reboot and see how the phone runs for a few days. If things seem fine then move on and install your other apps a few at a time. Give it a few days and continue on to the next few apps until you find the app that is giving you problems or maybe all you needed was a fresh start.

Logcat: Install the Android SDK on a computer and then open a terminal shell (cmd.exe in Windows) and run adb logcat. On windows it looks like:

adb logcat

Sometimes I have to specify the whole path for that command to work. For me it would be:

C:\Downloads\evo\android-sdk-windows\tools\adb.exe logcat

You mileage will vary depending on where you install the SDK...

After running that command you will only be able to view what the terminal shell can contain or hold in memory. My recommendation would be to increase the buffer size of the terminal shell so that you can capture more information. More advanced shells might be able to output a text file, I would try that too. If you do not have this option just copy and paste everything in the screen to a text file yourself. In cmd you do this by right clicking, mark, highlight what you want, and then go to the text file and paste.

Also this is not always the best route unless you know what you are looking for because logcat will essentially show output of everything your phone is doing. So there will be a ton of data generated.

2
  • I'm pretty sure it's rebooting, as I end up at the sim unlock screen (probably should have made that a little clearer...), and battery times are reset. Keeping it connected to my computer for several days and hoping I'm close when it crashes doesn't seem like a very viable option :) I'll start removing all apps / adding them again one by one... was hoping there would be some logs somewhere, would probably pinpoint the problem in a second, now I'm in for weeks of trouble :( thanks a lot though
    – pierre
    Sep 1, 2010 at 19:43
  • I would try updating first. That would give you a fresh install to work with then add the apps back. It sounds like a pain but it should help your phone run much smoother. Also never use task killers of any kind.
    – Webs
    Sep 1, 2010 at 21:27
1

The best you can do if you want to examine the log files is to install the free Android market app called aLogCat (just search for it on the market).

It allows you to inspect, filter for different levels of log categories and also to send you a log to your email or save it. For sure the easiest way to inspect the logs.

2
  • Forgot about that app. Not a bad idea. The app still uses logcat though so its a question of how much time the OP wants to spend troubleshooting this issue.
    – Webs
    Sep 1, 2010 at 21:35
  • I couldn't find that one (maybe it's a paying app? Can't buy apps over here..), but I found an, I think, similar one catlog, it showed a whole lot of RunTimeExceptions from gtalk. Didn't even know that was running in the background, never use google talk, so killed the service... let's hope that fixes it... fingers crossed :)
    – pierre
    Sep 2, 2010 at 8:08