@dduphorn There is already a thread on how to start stop appium server programatically. You might need to check this