Question: I need to get a unique ID for the device. I originally thought I'd use the device's imei, but that doesn't seem to return anything:

```
import QtSystemInfo 5.0

DeviceInfo {
    id: device
}

Component.onCompleted {
    console.log(device.imei(0)) // Returns nothing
}

```

That may or may not be a bug: <https://bugs.launchpad.net/ubuntu/+source/qtsystems-opensource-src/+bug/1197542> but since there haven't been any updates for a year, I'm hoping that maybe I can use some other piece of information.

So, does anyone know how I can get a unique ID for the device? It has to be persistent, but it can be totally meaningless other than as an identifier.

Answer: 
This does work. It is how *ubuntu-system-settings* is [getting the IMEI](https://bazaar.launchpad.net/~system-settings-touch/ubuntu-system-settings/trunk/view/head:/plugins/about/PageComponent.qml#L116). 

Rather, your issue may be that console.log() is not going to whatever console output you're expecting to see it at, or the system you are running it on, has no IMEI available (which requires a GSM modem). There is also a serial number shown in the *About* page of system settings, but it is being read through a C++ plug-in, which you likely cannot use directly from your app, and may need to reimplement.

Reading the device information is limited to system unconfined apps at the moment. There is no current policy\_group to use to be able to read the IMEI in a confined app.
In more recent versions, the `DeviceInfo` QML type has a `uniqueID` property:

```
DeviceInfo {
    id: device
}

Component.onCompleted {
    console.log(device.uniqueID)
}

```

Documentation: [QML DeviceInfo Element: property uniqueID](https://doc-snapshots.qt.io/qt-mobility/qml-deviceinfo.html#uniqueID-prop). (Code not tested, just saw this in the documentation.)