06-02-2018 11:24
06-02-2018 11:24
This happens inconsistently, but about once every three side-loads. Is there a way I can debug this / help you debug this? The only information I get in the console is not all that helpful:
[HOST][19:03:56]App closed on device, unloading companion in 3 seconds…
If I have to restart and reconnect to the server every three or so side-loads, development slows to a crawl. 😕
Some help would be appreciated!
06-17-2018 08:01
06-17-2018 08:01
This is really unbearable. Could I please get a reply to this?
06-17-2018 08:05
06-17-2018 08:05
PS: It also happens without explicitly side-loading. It happens more often when connected to the development server, but it has also happened twice while I was walking on the street. The watch mistakenly recognises a run, I close the exercise app, and it crashes.
Are logs / core-dumps being kept anywhere that could help anyone debug this behaviour?
06-17-2018 08:07
06-17-2018 08:07
I'm not making this up. Right after writing that last post, I got an e-mail notification on my watch, and it crashed and rebooted. It's like the slightest thing can set it off.
06-17-2018 13:35
06-17-2018 13:35
Could it be that your clockface is hogging the CPU for too long? IIRC, I've had Bad Things happen when doing that.
I'd approach debugging by progressively commenting out chunks of code.
Another way to debug things like this is to write diagnostic messages (eg, '4:30pm: starting loadFiles') to a file. After a crash, read the file so you can see what executed and what didn't.
06-17-2018 13:57
06-17-2018 13:57
Thanks for your response. A custom clock-face is indeed what I'm working on. But it doesn't do anything CPU-intensive, let alone in a single thread. It is actually quite snappy.
The progressively-commenting-out-code / binary-search approach won't work here, because the crashes are not consistent. My intuition is that there's a memory leak, and the OS eventually gives up and reboots. But I have no way to verify it. What I'm hoping is that the system has internal logs or core-dumps that the actual FitBit developers could look at.
06-17-2018 14:17
06-17-2018 14:17
Inconsistent crashes are a pain to debug. Nevertheless, if it's crashing as often as you say, progressive commenting could still be of some value.
There is an API call for reporting available memory; you could trying using that to track behaviour.