I’d like to detect from within my app whether the iPhone has been rebooted since last time my app was started. I need to do this because my app uses the timer since last system reboot to clock a user’s time and I want to detect reboot so I can invalidate the time.
Is there anywhere I could extract the information from the system console log like reboot , crashes ? The organizer in xcode can access it , maybe I can too.
If not , can you think of other ways to get this information?
This seems like it would work:
Next time your application gets started, load the previous value for ‘lr’, compute the new one, and if they differ, you have detected a reboot (you’ll probably have to tolerate a small difference there… a couple milliseconds perhaps).
I think it would be pretty tough to fool that… the user would have to tamper their phone time very precisely, and they would have to start your application at a very precise moment on top of that, exactly when the new ‘lr’ would be identical to the previous one… pretty tough to do, the probability of them being able to do that is very close to 0 I think. And you don’t need any internet connection to do that…
The new ‘lr’ would be identical to the previous one in the following cases only: