Using Appium to Run Tests on multiple physical devices at once?

Hey Guys -

I have been working on an SDK that uses BTLE to communicate with other devices. We are currently exploring testing solutions to test the matrix of communication possibilities between devices. A former engineer on the project set up his own system using Avro to control multiple devices & check their output.

I am wondering if there’s a way for me to use Appium to fire up tests on multiple physical devices at once. Any thoughts on that?

Thanks again for all that you’ve done w/ Appium. I really love working with it. I am really hoping that we can make use of it for this case.



You should setup one appium server per each device.
Here is a full explanation:

Thank You so much for the reply. This thread was very informative :

It sounds like you can spawn multiple Appium servers on different ports connected to different devices, then have multiple capabilities in our test scripts for each device.
If I want multiple test commands running on various devices at once, I can just multi-thread them. Sounds plausible.

Thanks for the heads up!

1 Like

@vfxdrummer do you know if the same is possible for iOS devices or is it Android only?


If you want to run automation for Android and iOS at once. Do the below setup.

Just run ur appium.js with different different address and port.

node appium.js -a -p 8080


node appium.js -a -p 4723

Set the same Address and Port in your Test Automation Script as well. And it is Done.

hello guys,

i finally achieved multi device high speed automation.

I used self developed automation server and UIAutomator handles for android and xctest handles for iOS inside device! I must say it is awesome! you may automate your device from anywhere just connect to automation server from your device!

Features achieved for iOS and Android

  1. multi device ,multi platform automation! you may automate n number of iOS and android devices at the very same time!
  2. 10 times speed achieved as compared to simple appium automation scripts!
  3. Device reset and restart achieved
  4. Intra-device(swarm) test case for multi device test cases! e.g. trading application (test includes multiple users at same time!)

Right now I am working on making this Architecture generic to use on any project and I am working on making P2P architecture.Currently it is server client architecture!

tell me if anyone need any help!


refer my reply I achieved this!

Hi PositiveCrux,

I am new for Appium. Please provide the setup and sample code for run Multiple devices at time.


Hi Nagendar,

Please check the below link. It provides a very basic implementation of parallel execution using Java Thread and Runnable interface. This is a very simple approach, and you would need to modify the logic if you want to hook it up with some frameworks.

Can you please tell me that maximum number of devices we can connect with appium through 1 test

@nagendaredi If you want multiple device you need to start multiple appium servers with different PORTS and you need to create multiple clients(java threads) to support that each of the server!
I would used AKKA library to achieve this over java multithreading. you can even communicate between threads very easily and synchronize multiple test runs for even inter-device (swarm)test runs!(i.e. Device1 you do something and see its effect on Device 2!)

1 Like

Theoretically - no limitation, practically - after 6 devices we experienced problems with ADB: it starts disconnect devices, shut down, etc. Also, you need good USB hub for that thing as bad hub is a bottleneck there.

But again, one appium server - one device. so 6 devices - 6 servers.

Yeah I am also facing same problem after 4 devices some devices get disconnect.
I have a task to connect 30 devices. what can I do let me know

We can create more adb server with different port number. So can we Perform with that regarding with different adb server

Really? Did you start several ADB servers on one PC and connect devices on each one?

no but i run multiple adb server with different port number lyk ANDROID_ADB_SERVER_PORT=6789

Thanks Anish for your response.

Hi PositiveCrux,
Can you please tell me how you have setup the automation server and the setup
so that we can run multiple devices at once.

my email is [email protected].

Hi All,

Tried configuring multiple android devices getting following error message:-

org.testng.TestNGException: org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 12; The content of elements must consist of well-formed character data or markup.
at org.testng.TestNG.initializeSuitesAndJarFile(
at org.testng.remote.RemoteTestNG.initAndRun(
at org.testng.remote.RemoteTestNG.main(
Caused by: org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 12; The content of elements must consist of well-formed character data or markup.
at Source)
at Source)
at Source)
at Source)
at Source)
at$FragmentContentDriver.startOfMarkup(Unknown Source)
at$ Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at$JAXPSAXParser.parse(Unknown Source)
at Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.testng.xml.XMLParser.parse(
at org.testng.xml.SuiteXmlParser.parse(
at org.testng.xml.SuiteXmlParser.parse(
at org.testng.xml.Parser.parse(
at org.testng.TestNG.initializeSuitesAndJarFile(
… 3 more