Frequently asked questions about utdid on Android.
When does the utdid change, and when does it stay the same?
-
System or app restart
Without external storage permission, the utdid does not change.
With external storage permission, the utdid does not change.
-
App deleted and reinstalled
Without external storage permission, the utdid changes.
With external storage permission, the utdid does not change.
-
Factory reset, SD card data cleared, and app reinstalled
Without external storage permission, the utdid changes.
With external storage permission, the utdid changes.
Why does the utdid change after the process is killed?
This happens because of how utdid initializes on first install.
On first install, the app does not have external storage permission, so it cannot read the external utdid. If an internal utdid does not exist, a new utdid is generated.
utdid is an application ID. Each time the app starts, it compares the external utdid with the internal utdid and keeps whichever was generated earlier.
Once the app is granted external storage permission and restarts, this comparison overwrites the internal utdid with the external utdid, causing the utdid to change.
To resolve this:
Use utdid4all version 1.1.5.3 or later. Earlier versions have compatibility issues with newer versions of Android.
This issue only affects the first installation. After external storage permission is granted, the utdid remains stable on subsequent restarts.
On some phones running Android 6.0 or later, external storage permission is granted only after the user taps OK on the permission dialog. Declaring the permission in the manifest is not enough.
What to do when you need a static device ID on Android 10 or later?
As Android tightens device permissions, it is difficult to guarantee that the utdid remains unique and static for a device. If your use case requires a stable device ID, use an alternative method to get one.