How might I get the serial number/ID (like 5554,5556 etc.) of my Android emulator programmatically?
Asked
Active
Viewed 1,953 times
1
-
The `5554` represents the port number for that emulator. If you are creating the emulators yourself, you can specify the port number with a `-port 5558` option in the `emulator` command. If you're not creating them yourself then you'll need to use a different solution. – Joshua Pinter Jul 06 '21 at 22:08
1 Answers
0
What do you need the ID for? If you want to identify a specific device, you'll need to remember the following: If the Device changes hands or gets reset, the ID stays the same. So you'll want an ID which identifies the Device and changes when the device is wiped.
Since version 3.0 there is a Secure.ANDROID_ID
which you can use (see here).
If you need it to work with versions lower then 3.0, you can use the UUID-class.

Community
- 1
- 1

Lukas Knuth
- 25,449
- 15
- 83
- 111