Appium uses the first connected device

I have appium 1.4.13 on my mac (the command line version). I was running 2 genymotion emulators on my mac, and also started 2 appium servers with different port and ‘bp’. I tried hitting these 2 servers from different machines with desired capabilities set to different emulators (also tried running appium server itself with different emulators with -device-name), but the tests always ran in the same emulator regardless. I could see the logs printing ‘found 2 emulators’ ‘using first emulator’. Am clueless how can this be rectified. Any pointers please ?

Thanks,
Jaya

When you start Appium session you should specify device UDID. It is “udid” capability or --udid argument in Appium command line. Proper string can be found by running command like:

adb devices

It will return the list of identifiers. As soon as you pass “udid” capability only specific Genymotion instance will be taken.