Running multiple instances of Appium server for Android and IOS device

Hi,
I am currently doing some research how to run parallel tests on both Android and IOS devices. I have done some reading on the Appium website and various posts that its possible to run parallel tests on Android devices but not IOS.

I managed to launch my tests running parallel on 2 Android devices by starting 2 Appium instances on different ports using the following commands:

appium -p 4727 -bp 4728 -U “05c98033f0d4db47” --chromedriver-port 9516
appium -p 4725 -bp 4731 -U “53db8955” --chromedriver-port 9518

My question is, is it possible to spin up another Appium instance on eg : port 4723, running tests on an IOS device/simulator, in parallel with the above two Appium instances? (port 4727 and 4725)

Thanks.

Yes… I do that. I have one ios and two android at same time (all real devices) connected to one OS X.

Hi Telmo,
Oh cool! Thats awesome. I’ll try that. Thanks for the reply.

@Telmo_Cardoso I need to connect multiple android devices under an Appium server. How that could be possible? Can you share your experience

HI @ashokkumarg ,

Please refer these below links, may help you out.!!!

https://discuss.appium.io/t/appium-parallel-execution-grid
https://discuss.appium.io/t/unable-to-connect-android-device-to-grid

Regards,
Bhaskar.

Hello Ashok,

Did you get right answer for your question, have you done with your implementation.

Thanks,
Nesa

@nesa246 Sorry, I didn’t get.

What doubts you still have?

You can either use the selenium grid and for that you have plenty of links to follow or you can do your own implementation, in this last you need to launch n appium servers in different ports and connect the devices in proper server.

Unless you have another goal it is simple. Please tell us what you want to accomplish if it doesn’t fit the above options.

@Telmo_Cardoso Thanks you for your reply. Again I will look in to the selenium grid and I will follow up the things. I have one clarification over here.

1.In Apppium can I run two applications in the same port. (I have tried but it says Port is in use.)

2.In Appium I can run the application in two different ports. But every time I need to hard code the port number like 4725, 4724. Is there any way to find the available port numbers in appium and also what is the range of port number. I mean from where it starts and where it ends. Example(4700-4800).

  1. No. Not in appium or anything else. If you are using one port with one protocol it wont allow you to use it again while first application doesn’t kill connection.

  2. Any port available in computer will do. The first 1024 are reserved ports, but from those and above go crazy until 65535. Off course you should avoid the most common ones like 8080 or 8443, etc.

Instead of giving the port number like
"address":“127.0.0.1”,“port”:4725
Because in this actually after IP address/local host we are initializing the PORT NUMBER.
Is there any way to fetch the available ports automatically instead of writing as 4725 or etc., whatever.

There are thousands of available ports. You select the ones you want in order to start appium server on those and then when instantiating the drivers user proper ports previously selected.

Don’t search for problems where they aren’t :slight_smile: You will face enough problems in the rest!

I was able to run android test in parallel by passing different bootstrap and appium ports with device UDID.

Look at the link below for working example( it works only on linux and mac as i’m running it thorugh parallel GNU )

Hello Everyone,

Android Multiple device testing using Appium both Android and IOS(only one IOS device), is possible with real devices, I have tested please check the below link.

what is UDID? how to get it

docker run -d --privileged -v /dev/bus/usb:/dev/bus/usb -e appium_args="-p 4723 -bp 2251 -U 32456" -p 4723:4723 shashikant86/docker-appium-cucumber

can anybody tell me what is -U there. how to get it
I am regreing the floowing URL

@slakshmiics All what you need is here http://appium.io/slate/en/master/?ruby#parallel-android-tests

HI Telmo
can u pls explain how to create multiple appium instances through programmatically to work on real android and iOS
thanks in advance

Reddi

Programmatically or directly in bash/cmd you just need to launch server with different port like

appium -p 4730

If you talking about the tests, you can use the grid or you build your code where you can store multiple drivers that you instantiate, one for each server/device with different capabilities (android vs ios)

how do you do that, i am having a hard time to do that with simulator. would you be able to share your config file? This is what i am trying to do - https://stackoverflow.com/questions/59610529/connecting-two-appium-apps-at-the-same-time-and-doing-end-to-end-tests-on-them