Hi,
I also want to start Appium via SSH, basically I can connect to the remote server and also run terminal commands. When I call ssh.sendCommand with :
"/Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js --command-timeout "7200" --debug-log-spacing --automation-name "Appium" --platform-name "Android" --platform-version "5.0.1" --app "/Users/qa/mobile/apps/test.apk" --full-reset"
it actually starts Appium as a process/service.
I do that by running that code:
public class SSHConnector {
public String sendCommand(String command) throws IOException {
SSHClient client = new SSHClient();
String toReturn = "";
client.loadKnownHosts();
client.connect("ip adress");
try {
client.authPassword("username", "password");
Session session = client.startSession();
try {
Session.Command cmd = session.exec(command);
cmd.join(10, TimeUnit.SECONDS);
toReturn = cmd.getExitErrorMessage();
} finally {
//session.close();
}
} finally {
client.disconnect();
client.close();
}
return toReturn;
}
}
Directly after that I want to create an AndroidDriver, but I'm getting an error message that the connection is refused (from the remote server).
I think that's happening because the session is closed and the client is disconnected ? I assume that Appium is killed on the remote server because the SSH connection is closed ? How can I keep Appium running although the SSH connection is closed ?
Thanks!
Best,
Daniel