Stable naming and query for Ubuntu Emulator device ID
Bug #1309040 reported by
Benjamin Zeller
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
goget-ubuntu-touch (Ubuntu) |
Confirmed
|
High
|
Sergio Schvezov |
Bug Description
Currently the device ID for the ubuntu emulator is changed on every boot,
its incremented for every emulator running in paralell.
This is a problem if multiple emulators are used together with the SDK and QtC.
In QtC devices need to have a unique ID, because all device settings need to
be stored and referenced somehow. If the device ID changes this can create problems
(for example a armhf Toolchain could be linked to a x86 emulator).
In addition a method to query the created ID for all emulators is required, in order
to map the output from ubuntu-emulator list to registered devices inside QtC when
the emulator is not running.
To post a comment you must log in.
Looking internally how the naming happens, it's basically a fixed socket and adb host command that only allows the port itself to change from one instance to another.
Without specifying any port when calling the emulator, it'll start at 5554 and increase +2 for every other instance, until it reaches 5584. There's no easy way to use an id or name it differently than locking it into a specific port. This is a limitation in the adb protocol, as the emulator is a special case (it uses tcp instead of usb).
One possible way to map the emulator image with the runtime instance would be to force a different port per emulator, and export that data with the 'ubuntu-emulator' tool (list). With this you could at least know how to connect to the right instance, as long you don't have any android emulator running at the same time (as both will end up using adb).
Limitations:
- The console port number must be an even integer between 5554 and 5584, inclusive. <port>+1 must also be free and will be reserved for ADB.
- The mapping would not necessarily be correct if you also start the Android emulator. One way to workaround that would be to start with 5584 and decrease -2 at every new emulator image that gets created.
As there's not much we can do in the android side, moving this bug to goget-ubuntu-touch.