Has anyone successfully run test scripts parallel in two or more Android devices?

I have search many forums, read many post but I have not found one that has successfully run parallel test scripts in multiple Android devices or emulator. > Is this is possible? (I think it should be so far I cannot find a solution)

What I have done so far
1- I have tried: running parallel test scripts (using Testng) by creating two instances of appium server each with different port, udid, and bootport. I setup the capabilities to match the corresponding instance and it does get executed but NOT parallel.

The test fails because of the following two reason: I notice that reason 1 only happens once when I fresh start the appium instances, the remainder of time fails on reason 2.

–1 - First it fails because one of the two appium instance will throw the following error:

info: Starting App
info: [debug] Attempting to kill all ‘uiautomator’ processes
info: [debug] Getting all processes with ‘uiautomator’
info: [debug] executing cmd: /Applications/adt-bundle-mac-x86_64-20140624/sdk/platform-tools/adb -s 9a588123 shell “ps ‘uiautomator’”
info: [debug] No matching processes found
info: [debug] Running bootstrap
info: [debug] spawning: /Applications/adt-bundle-mac-x86_64-20140624/sdk/platform-tools/adb -s 9a588123 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
info: [debug] [BOOTSTRAP] [debug] Loading json…
info: [debug] Waking up device if it’s not alive
info: [debug] Pushing command to appium work queue: [“wake”,{}]
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
> error: Unhandled error: Error: read ECONNRESET
at errnoException (net.js:905:11)
at TCP.onread (net.js:559:19) context: [POST /wd/hub/session {“desiredCapabilities”:{“appActivity”:“com.core.android.activities.MainActivity”,“appPackage”:“com.core.android”,“platformVersion”:“4.4”,“appWaitPackage”:"com.core.]

2- Second, only one test will gets executed (sometimes in device A or sometimes in device B) in one appium instance and the second instance just halts. Sometimes device A will start running for a few seconds and once device B starts it will halt device A or vise versa.

2- I have tried: running appium in Selenium Grid node; I am able to register two distinct appium server node in Grid hub, but once I again I CANNOT get it to run parallel

The reason it fails is the same as previous reasons, either one Appium instance will halt while the other runs or sometimes even throws a new error that I cannot reproduce. One thing for sure Appium is very unstable trying to run two devices at the same time.

3. What else I have tried:
I have tried using different devices (nexus, samsung, amazon, LG, motorola …). run locally and remotely. I just CANNOT get it to work.

What I need
Your help. Can some one respond if only you have successfully run parallel scripts on multiple devices. Can this be done??


Hi @gualber98,

May be this link is helpful.

But if you are trying to execute tests chrome browser the there is an issue with that.

Try this and let me know if this works for you…

Thanks and regards,

What solved for me was give 10/15 seconds between the start up of each test. I I start both at same time I end up having the ECONNRESET error

1 Like

Hi @karthik_holla,
I went over the link and I have tried the suggestions, but I still can’t get it to work, but I know I now is possible to run in parallel, the issue has to be my settings. I will keep trying.

Also for your issue , do you run appium instance with different --chromedriver-port {number} and --bootstrap-port?

Hi @Telmo_Cardoso ,

Thank you for the reply, I will try it today.


After I put a Thread.sleep() after creating the Driver object as @Telmo_Cardoso suggested, I do not longer get the ECONNRESET error but I still cannot get both devices to run,

Now, both Appium server instance run and the App opens on each device, but after gets loaded only one device runs the other just stops. The two threads, each with different Driver object get run on one device. I don’t understand I set the capabilities for each driver to match only one server instances, any suggestions what could be the problem? Thank you

Hi @gualber98,

This is the command that is used to launch the appium server and register it with selenium grid.

C:\Users\mkarthik\Documents\selenium\Appium\node.exe C:\Users\mkarthik\Documents\selenium\Appium\node_modules\appium\bin\appium.js --address --port 4728 --udid 085d3b920c928938 --bootstrap-port 4724 --nodeconfig C:\Users\mkarthik\workspace\Android\AppiumMobileAutomation\src\com\nodeconfig\085d3b920c928938.json

i am not specifying any chromedriver -port number


I was saying that the problem in your case could be because you are not setting up a different --chromedriver-port

oh ok, Thanks @gualber98 i will try to execute scripts with different chromedriver port…

thanks for your suggestion.



I tried with specifying --chromedriver-port 9516 and 9515 for two different appium instances.

Execution is carried out on a single device. Not sure why commands are not re-directed the second device.

Thanks and regards,


“Execution is carried out on a single device.”
That is exactly what is happening with my execution, any updates on your attempts?

Try the example from the thread:

Thank you, I will try it out. One question are your running two appium instances?

As mush as you need - android devices connected to PC:-)

Can open multiple driver instance with some delay for parallel execution. If all parallel instance are opening simultaneously I am getting ECONNRESET error. So passed one parameter from TestNG xml to wait for 5-10 seconds. It is working file for me :smile:

1 Like

@Fayizkc Can you please provide the testng xml . Need to know how to configure the delay b/w two tests.

Hi Siva.
Delay is not in the TestNG file. You can implement a logic to stop creating appium capabilities parallel. You can create separate class or method to create WebDriver and make sure you are not hitting that method at the same time.

public static boolean driverCreating;  
    WebDriver createApppiumDriver()
    while (driverCreating){}
    driverCreating = true;
     driver = methodForAppiumDriver()
    driverCreating = false;

You can take a look at this

@saikrishna321 I used the above code. But still appium crashes in between.

When u say Appium … Does not give any hint … Can u pls provide the Appium logs when your tests Re triggered in parallel