Boot time and uptime
Reads time since boot; the boot timestamp itself is a classic stable ID until restart.
In one line
Can see how long your phone has been on, and on Android its restart count
Reads time since boot; the boot timestamp itself is a classic stable ID until restart.
now minus uptime gives a boot timestamp that stays constant until reboot and is near-unique across devices. That is why Apple made it a Required Reason API.
What it can and can't do
What the user does: Nothing. The app checks when it starts
It can
- See time since the last restart on Android, to the millisecond
- See the boot count on Android 7 and newer
- Use the restart time as a rough ID until the next restart
It cannot
- Use boot time on iPhone without a stated reason; Apple has enforced a reason rule since 1 May 2024
- Keep a stable ID after you restart the phone
- Learn what you did before the restart
How it differs between platforms: Android shares uptime with no prompt. iPhone only allows it for approved reasons that developers must declare.
On Android and iPhone
| Android | iPhone | |
|---|---|---|
| Status | Supported | Behind a flag |
| First version | Android 1.0 (API 1) | iOS 17.0 |
| Permission or entitlement | Not listed | entitlement |
| Protection level | none | entitlement |
| How access is granted | none | none |
| What the user sees | Not listed | Not listed |
| How long it lasts | Not listed | Not listed |
| How to take it back | Not listed | Fingerprinting banned regardless of ATT |
| Store policy | None listed | None listed |
| API | SystemClock.elapsedRealtime() (ms, with sleep), uptimeMillis(); Settings.Global.BOOT_COUNT (API 24) | Reason codes 35F9.1, 8FFB.1, 3D61.1; enforced 2024-05-01 |
| Notes | Millisecond resolution; boot count is an integer | None |
Data you get
What comes back: Seconds since boot
Shape: float
How often: Continuous
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
uptime_ms | integer | ms | 0 to 1e10 | 1 ms |
boot_count | integer | boots | 0 to thousands | 1 |
Technical limits
- Fingerprinting banned by Apple even with reasons
The story
What it is
An app can work out the exact moment your phone last restarted.
For you
You never see it. Subtract uptime from the clock and you get the time you rebooted. That time stays the same for days, so it can act as a tag until you restart.
For makers
Makers use it to measure startup speed and spot reboots after crashes. Trackers used it as a near unique ID, which is why Apple made it a Required Reason API.
Where you see it
| Type | Example | Apps |
|---|---|---|
| games | A game checks uptime to see if a crash happened after a restart, and uses it to fix freezes. | None named |
| analytics | A crash tool shows that most failures happen soon after a reboot. | None named |
| security | A fraud tool notes that two logins share the same boot time and flags a copied device. | None named |
| ads | An ad partner joins sessions with the same boot time into one device. | None named |
| banking | A bank detects a time jump that suggests the clock was changed to cheat a code. | None named |
| developer | A developer measures cold start time of the app after the phone restarts. | None named |
Risks
- Works like a short term ID
- Hard to notice
Android and iPhone in short
- Android: Available with no prompt through system uptime.
- iPhone: Apps must give an approved reason or Apple may reject them.
What the platform says
- Apple: Required Reason APIs. Developer rules: apps that read system boot time must declare an approved reason in their privacy manifest.
Good uses and abuse
Legitimate uses
- Measure intervals
- Absolute timestamps for in-app events
Known abuse
- Cross-app device ID until reboot
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 1 of 5 | How revealing the data is |
| Utility | 2 of 5 | How useful it is to honest apps |
| Friction | 1 of 5 | How much the user has to do |
| Fingerprint bits | 18 | Rough identifying entropy, when known |
History
- 2016-08, Android 7.0 (API 24): BOOT_COUNT setting exposed
- 2024-05, iPhone iOS 17.x: System boot time is a Required Reason API
Related capabilities
Related
- Required Reason: system boot time. Can check how long the phone has been on; iPhone needs an approved reason
Sources
How well checked: Inferred from related behavior.