I took a look at https://github.com/appium/appium/issues/46235 and tried suggestions there.
- used udid in desired capability for client
- passed udid/U flag on appium server instance (ran 2 instances on different ports)
- passed a different -bp port value for each appium server instance
- added --session-override flag to both appium server instances
still no go with 2 Android devices connected, rather than link/post long log snippet, this is what might be of interest to see for excerpts:
here we detect multiple devices connected, and issue command to correct device UDID
[debug] [ADB] Getting connected devices...
[debug] [ADB] 3 device(s) connected
[debug] [ADB] Running /Applications/AndroidDev/sdk/platform-tools/adb with args: ["-s","TA0930ALF7","shell","pm","install","-r","/data/local/tmp/8e431a8da3b643581864d3ea5f739fe2.apk"]
and here's where it finally fails
[debug] [UiAutomator] Found jar name: 'AppiumBootstrap.jar'
[debug] [ADB] Running /Applications/AndroidDev/sdk/platform-tools/adb with args: ["push","/usr/local/lib/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-android-bootstrap/bootstrap/bin/AppiumBootstrap.jar","/data/local/tmp/"]
[ADB] Error: Error executing adbExec. Original error: Command '/Applications/AndroidDev/sdk/platform-tools/adb forward tcp:4724 tcp:4724' exited with code 1{"stdout":"","stderr":"error: more than one device/emulator\n","code":1}
My environment:
Appium node.js version 1.5.0-beta9
node.js version 0.12.4
adb version 1.0.32 Revision 09a0d98bebce-android
Mac OS X 10.10.5
Using Appium Python client, should be the latest