I can be wrong, but the device id are must be described in capability. You can try to configure your project in such a way that when the test starts, several threads are started, to which the device id are transferred.
Something like this can be organized using a testng.