How to Setup Test Device IDs

Use this guide to configure TestDeviceIDs — the list of known development/QA device identifiers this project checks against, so your own test devices behave differently from real players' devices without affecting anyone else. Based on the actual class and its real call sites in this codebase. Ships empty — you're expected to fill it in with your own devices' IDs, never anyone else's.

Architecture Context

  • TestDeviceIDs is a static class holding a hardcoded list of device IDs (matched against SystemInfo.deviceUniqueIdentifier at runtime) plus one helper, IsTestDevice(), that any system can call to ask "is this build running on one of our own test devices?"
  • Three places in this project's code already read it:
    • Splash screen — prints the current device's ID as on-screen text every time the app launches, and colors that text red once the device is in the list. This also happens to be the easiest way to discover a device's ID in the first place (see Step 1).
    • AdMob — feeds the list into Google's UMP consent debug settings, which does two things on a listed device: lets you force the EEA consent form to appear for testing even when the device isn't geolocated there, and marks the device to receive test ads only (not real, billable ads) — worth doing deliberately, since clicking your own real ads repeatedly can get an AdMob account flagged for invalid activity.
    • GameAnalytics — skips sending real analytics events from a listed test device (unless explicitly overridden in config), so your own QA play sessions don't pollute real player analytics data.
  • Any project sharing this same manager/proxy setup can rely on the same mechanism — the only project-specific part is the actual list of device IDs, which is exactly what you're expected to replace per project.

Pre-Setup Checklist

  • A build installed on each physical device you want to treat as a test device (Editor Play Mode doesn't need this — it's for real hardware).
  • Understand what's being matched: SystemInfo.deviceUniqueIdentifier is a Unity-generated identifier derived from the OS's own per-app-vendor device ID (identifierForVendor on iOS, the Android ID on Android) — not a store-specific "advertising ID," and not something you look up in a dashboard anywhere.

Main Procedure

Step 1: Get Your Device's ID

If this project's splash screen is in place, this is the easy path: install the build on the device and read the ID straight off the splash screen — it prints SystemInfo.deviceUniqueIdentifier as text there on every launch, even before you've added it to the list.

If a project doesn't show it on-screen, add a one-line temporary log instead, wherever the game starts up:

Debug.Log("Device ID: " + SystemInfo.deviceUniqueIdentifier);

then read it back from the device's console output (Xcode's console for iOS, Logcat / adb logcat for Android) after launching that build.

Step 2: Add It to the List

Open TestDeviceIDs.cs and add the ID as a new named constant, then add that constant to the list:

private const string _device00 = "PASTE-YOUR-DEVICE-ID-HERE"; // My iPhone

private static List<string> _list = new List<string> { _device00 };

A short comment per entry (whose device it is) is just for your own reference later — there's no naming requirement beyond that.

Step 3: Validate

Rebuild and reinstall on that device. If the splash screen is present, its device ID text should now show in red. On AdMob, ads served to that device should show as clearly marked test creatives instead of real ads. In GameAnalytics, events from that device should stop appearing in the dashboard.

Step 4: Empty It Back Out Before Distributing

If you're preparing this project to hand off or publish — rather than your own working copy — clear the list back to empty instead of shipping it with your own personal devices' IDs baked in. Whoever picks the project up next should populate it with their own devices, not inherit yours.

Common Edit Recipes

Recipe A: Add a New Test Device

Repeat Steps 1–2 for the new device — nothing else needs to change, since every call site reads from the same list/helper at runtime.

Recipe B: Use This Same Check in Code You Add

Call the IsTestDevice() helper from anywhere new that needs the same "is this a known test device" check — it has no dependency on any of the three existing call sites and works the same way wherever it's called.

Troubleshooting

  • Splash screen shows a device ID, but it never turns red after adding it. Double check the pasted ID has no extra whitespace and matches exactly — the check is an exact string match against the list.
  • Real (non-test) ads still show on a device you added. Confirm the device was actually in the list before the ad SDK's consent/init flow ran — that's read once at startup, so adding a device and testing without rebuilding won't help.
  • A device's ID changes between installs. SystemInfo.deviceUniqueIdentifier is generally stable per device/vendor, but can change in some circumstances (e.g. on iOS, if every app from the same developer/vendor has been uninstalled from the device) — re-grab it via Step 1 if a previously-listed device stops matching.
  • Events still show up in GameAnalytics from a device you listed. Check whether this project has a config flag to force-send events from test devices anyway — if it's enabled, test devices intentionally still send real events.