Device answers "what am I running on?" in four calls, which the lab runs in parallel and merges:
export async function device() {
const [info, id, battery, lang] = await Promise.all([
Device.getInfo(), Device.getId(), Device.getBatteryInfo(), Device.getLanguageCode(),
]);
return show('device', { ...info, ...id, ...battery, language: lang.value });
}Output
LAB device {"memUsed":4597792,"model":"sdk_gphone64_x86_64","operatingSystem":"android","osVers
ion":"16","androidSDKVersion":36,"platform":"android","manufacturer":"Google","isVirtual":tru
e,"name":"sdk_gphone64_x86_64","webViewVersion":"133.0.6943.137","identifier":"7fe24bd8b500
cb6f","batteryLevel":1,"isCharging":true,"language":"en"}Use osVersion and androidSDKVersion to work around an OS-specific bug, webViewVersion to decide whether a web feature is safe (System WebViews), isVirtual to keep emulators out of analytics, and the battery fields to postpone a heavy sync. identifier, from getId(), is not a hardware serial: on Android 8 and later it is unique per app-signing key, user and device, so another app signed with a different key sees a different value. Treat it as a pseudonymous install id.