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
- ‘appium’
- ‘appium -a 0.0.0.0 -p 4724’