This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
28 / 32
May 2016

@Real_Lau Glad you are finally able to solve it.

For anyone comes to this post in future:
UDID is the way Appium server differentiates between two devices, not by deviceName. If you don't provide the udid the server assumes that there is only one device and tries to install or send command to the default connected device without mentioning the android device id.
i.e. it tries adb install <*.apk> rather than adb -s <android_ id> install <*.apk>

which gets failed because ADB throws the error that "There are multiple device connected".

@pr4bh4sh thanks for the tip (and the comment in the referenced Github issue). Got it to work for 3 devices with Appium v1.4.16 (2 over USB, one over wifi with 3 appium instances).

On a related note, it's funny how I got appium node.js version 1.5.0-beta9 installed. I believe I had installed it via the standard instructions mentioned at appium.io (but I could be wrong). On uninstalling then reinstalling, this time a regular npm install -g appium correctly installed 1.4.16 (which appears to be latest stable version excluding betas based on the web node repo listings).

@daluu Glad it worked.
On how you got the unintended version.
1. In you don't specify the version while installing it via npm e.g. npm -g install appium it will install whatever latest stable.
2. While installing beta if you do npm -g install appium@beta it will install the latest beta avaliable. I guess thats how you got the beta9. Suppose you want the 1.5.0 beta8 then npm -g install appium@1.5.0-beta8 should do the trick.

You should try avm4 if you want more than one version of Appium available all the time without installing them every time.
P.S. You can also look at https://github.com/saikrishna321/AppiumTestDistribution9 as @saikrishna321 has suggested on git.

Thanks for the tip on avm, that will be helpful. Btw, I never explicitly tagged @beta at the end to my original instal (no tag at all supposedly)l. I guess npm screwed up there somehow, worked ok the second time around.

As for AppiumTestDistribution, it looks like cool solution but is built for Java. Would be nice if we'll eventually get a port for other platforms like Python (I'm using Python client for Appium). Or better yet, a language agnostic platform akin to Selenium Grid, where you just connect to it & it (or you manually) handle all the parallel instance handling on the back end.

Yeh, NPM might be the culprit here.
About the AppiumumTestDistribution, So it's gonna hard for me too. As I'm planning to switch to python as well. I'll try to recreate the same with python, but not anytime soon.

13 days later

Hi Daluu,

I am getting the 'more than one device/emulator' error too.

I tried everything in this post but no success yet.

I even tried to spawn 2 adb instances on different ports but appium doesn't know how to talk to the 2nd adb instance.

I guess you didn't have to do that.

Did you have this in your capabilities?

I was using adb tcpip so I had this

"deviceName": "10.10.122.130:5555",
    "udid": "10.10.122.130:5555",

Did you have to use deviceName? or did you only have to use udid?

8 days later
12 days later

Hello pr4bh4sh,

I tried following your approach, but it still does'nt work for me. Pasting the logs below.

2016-02-22 07:12:59:428 - info: --> GET /wd/hub/session/eee391c3-b426-40f0-8aab-415f2fef508c {}
2016-02-22 07:12:59:429 - info: [debug] Responding to client with success: {"status":0,"value":{"platform":"LINUX","browserName":"Android","platformVersion":"18","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformVersion":"18","deviceName":"FSMART","autoLaunch":false,"platformName":"Android","udid":"4df7f8d8260f3093"},"deviceName":"FSMART","autoLaunch":false,"platformName":"Android","udid":"4df7f8d8260f3093"},"sessionId":"eee391c3-b426-40f0-8aab-415f2fef508c"}

2016-02-22 07:12:59:432 - info: <-- GET /wd/hub/session/eee391c3-b426-40f0-8aab-415f2fef508c 200 4.117 ms - 533 {"status":0,"value":{"platform":"LINUX","browserName":"Android","platformVersion":"18","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformVersion":"18","deviceName":"FSMART","autoLaunch":false,"platformName":"Android","udid":"4df7f8d8260f3093"},"deviceName":"FSMART","autoLaunch":false,"platformName":"Android","udid":"4df7f8d8260f3093"},"sessionId":"eee391c3-b426-40f0-8aab-415f2fef508c"}

2016-02-22 07:12:59:467 - info: [debug] Getting install status for com.****.****.dev
2016-02-22 07:12:59:467 - info: [debug] Getting device API level
2016-02-22 07:12:59:468 - info: [debug] executing cmd: C:\Users\z185805\AppData\Local\Android\sdk\platform-tools\adb.exe shell "getprop ro.build.version.sdk"
2016-02-22 07:12:59:703 - warn: Error: Command failed: C:\Windows\system32\cmd.exe /s /c "C:\Users\z185805\AppData\Local\Android\sdk\platform-tools\adb.exe shell "getprop ro.build.version.sdk""
error: more than one device and emulator

at ChildProcess.exithandler (child_process.js:751:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1016:16)
at Process.ChildProcess._handle.onexit (child_process.js:1088:5)

Which version of appium server you are using???
Configuration looks correct.

in your case,
1. You can launch two appium server instances, each server instance bind with one device. to do this you need to provide -UDID as command line argument while launching appium
e.g: appium -p 6001 -u

  1. allocate different appium servers only with Unique port, and you can provide UDID to your desired capability.

Thanks,
Priyank Shah

2 months later

I am having a very similar issue as you guys, I added a comment on an issue on github https://github.com/appium/appium/issues/5949#issuecomment-21665631310 any help would be really appreciated.

Minor difference is that I am using Selenium as a hub, but I think the issue is stemming from the actual appium servers. It seems to be ignoring the caps? The only thing I haven't tried is downgrading to 1.4.16, is that even worth it at this point?

Thanks!

I just skimmed the Github issue, but I think the bug occurred in one of the projects Appium depends on. npm, however, might not automatically install the latest versions of all the dependencies.

You want to install Appium through npm using the --no-shrinkwrap option, which forces npm to install the latest published versions of all the projects Appium depends on for everything.

Did you do a clean install? Can you post some updated logs?

I just did a clean install of Node and Appium (with the --no-shrinkwrap option) and I am still getting the same hang up :frowning:

I attached a gist file for all the messages I am getting.

This is how I am registering the appium servers
java -jar selenium-server-standalone-2.53.0.jar -port 4444 -role hub

appium --nodeconfig appium_nodeconfig_nexus_5.json -p 4723 -bp 2251 --default-capabilities '{"udid":"192.168.60.102:5555"}'

appium --nodeconfig appium_nodeconfig_geny_nexus_7.json -p 4724 -bp 2252 --default-capabilities '{"udid":"192.168.60.101:5555"}'

I'm guessing this is a Genymotion emulator. Can you run adb help and make sure that the -s option is available? I've read that Genymotion packages its own version of the adb server with its emulators, and sometimes Genymotion's adb gets used instead of the standard SDK's version. There are some differences between the two servers.

I wouldn't expect there to be much difference between the two, but I could be wrong. :stuck_out_tongue:

1 month later

Even I ended in the same Issue. I have connected two devices to the same machine and started to different Appium servers . I was successfully able to push and launch the .Apk File(Hybrid Apk) in both the devices. But I am not able to switch between the 2 drivers for interacting. For example after logging in first driver, I'm not able to interact with 2nd driver. It shows session not found Error. Please find the logs.

org.openqa.selenium.remote.SessionNotFoundException: no such session
(Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 6.3 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 31 milliseconds
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'
System info: host: 'onsitelaptop', ip: '192.168.56.1', os.name: 'Windows 8.1', os.arch: 'x86', os.version: '6.3', java.version: '1.8.0_31'
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities [{app=C:\Workspace1\UCEdgeProject\UCedge\UCedge_Android_2.6.1.Xdev_debug.apk, networkConnectionEnabled=true, warnings={}, databaseEnabled=false, deviceName=BH903R1G1E, platform=LINUX, desired={app=C:\Workspace1\UCEdgeProject\UCedge\UCedge_Android_2.6.1.Xdev_debug.apk, newCommandTimeout=800, platformName=Android, udid=BH903R1G1E, deviceName=BH903R1G1E}, newCommandTimeout=800, platformVersion=5.1.1, webStorageEnabled=false, locationContextEnabled=false, browserName=Android, takesScreenshot=true, javascriptEnabled=true, platformName=Android, udid=BH903R1G1E}]
Session ID: 4fe65b3d-3f89-4283-a62e-ce7a6f54f215

1 year later

I know it’s been awhile but I finally figured out this bug, for me at least. Include --suppress-adb-kill-server when starting your individual server nodes for selenium grid. Let me know if this works for anybody.