The main. Js address of the Appium service should be written according to the actual situation. 2. Kill the Appium service in the script to restart it.

Subprocess. Popen (‘ killall node, shell = True)

3. Start the Appium service, mainly main.js. Parameters can refer to my other articles.

Subprocess. Popen (‘/Applications/Appium app/Contents/Resources/node/bin/node / Applications/Appium app/Contents/Resources/node_modules/Appium/build/lib/main js – address “127.0.0.1” -p “4723” — command-timeout “100” — automation-name “Appium” >/ TMP /1.txt ‘,shell=True)