Launch Appium Server(s) via Python Script

I am writing an automation script and it would be nice to be able to launch Terminal on my mac via my Python script in order to launch the Appium servers, instead of doing it manually.

The closest I’ve come is by using the following code, but this only launches Terminal and I am unable to send commands to it:

from subprocess import Popen, PIPE, STDOUT

Popen(['open', '-a', 'Terminal', '-n'], stdout=PIPE, stdin=PIPE, stderr=STDOUT)

I need to be able to launch two Terminal instances and run the following

  1. ‘appium’
  2. ‘appium -a 0.0.0.0 -p 4724’

Any suggestions? Everything I’ve tried since has failed…

were you able to solve this?

no, never get replies on this forum…