Reputation: 620
We are testing our Android app on real-world devices and notice some of them reboot occasionally after 2-3 hours of app running. The app consists of one service with 3 threads (with GPS and network) and two activities, one of wich is resource-consuming (displays the map)
Logcat did not help, as we did not see any important messages before the device reboots. Sometimes the device even does not start, only battery removal helps to start it again.
The devices are based on different hardware, produced in different countries (mostly PRC, hehe) and use different Android versions.
What are the most common problems that could lead to device reboot and how does one debug it?
Upvotes: 6
Views: 9910
Reputation: 620
It's most likely an overheating problem when GPS receiver is on. Turning GPS off and getting location from cell network, the app keeps running smoothly for hours.
Thanks everyone for the responses and ideas!
Upvotes: 0
Reputation: 3328
There're two kinds of reboot in Android:
System server fault. In that case no reboot happens but Zygote
restarts instead. Common reasons:
ext2
partitions aren't formatted as follows. It leads to errors and /data/
partition is mounted as read-only, which produces a bunch of errors.Both are quite rare and can be reproduced mostly in monkey-testing, not real-case scenarios. You may see an example of logcat output by killing the service_manager
process with adb shell
.
Kernel panic. In that case device actually reboots. As kernel panic happens on the layer beyound Android, it won't produce any logcat output. Instead it'll write a stack trace into console. You may read it from /dev/kmsg
or from ADB shell: adb shell dmesg
.
Unfortunately it's hard to read those as on most devices console output is disabled and kmsg
buffer will be erased on each reboot.
P.S. Also reboot may be caused by hardware issues. In that case it's unlikely to find any traces but hopefully this should be reproduced only on particular devices.
Upvotes: 4
Reputation: 2332
I had a similar problem (also gps and network) I have forgoten to set the network update timer to production (15 minutes) so the device updated every 15 seconds any way the device overheated soner or later (htc desire)
Try to minimize the cpu usage ( profiling) or ensure a proper cooling mechanism
Upvotes: 1
Reputation: 83311
From the information you have provided, it sounds like you are most likely leaking a Thread
. You can use DDMS to analyze thread usage over your app's course of execution. Another possibility is that you are simply just running out of memory... you can also use DDMS to help you out with this.
Upvotes: 0