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?
If your device keeps randomly restarting, in some cases may mean that poor quality apps on the phone are the issue. Uninstalling third-party apps can potentially be the solution. You may have an app running in the background that is causing your phone to restart.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With