0

So I am trying to run a remote nodejs server with a few arguments and although I manage the start the server correctly i fail to pass on to the next command and the app fails after a 60 sec timeout. Here's my code:

            SshClient ssh = new SshClient(myURL, 22, myUser, myPass);
    string unixCommand = "/usr/local/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js --address 127.0.0.1 --port 4723 --full-reset --device-name \"iPhone 6\" --platform-name iOS --platform-version \"8.3\" --app \"myApp.app\" --browser-name iOS -l --log /Users/QA/Library/Logs/Appium/1.log";
    {
        ssh.Connect();
        ssh.RunCommand(unixCommand);
        ssh.Disconnect();

Thanks!

Pavel Zagalsky
  • 1,620
  • 7
  • 22
  • 52
  • Fails after a 60 second timeout, does that mean you get a timeout error, or some other kind of error? When you run that command locally (or through an SSH terminal) does the command return right away? – Ron Beyer Apr 21 '15 at 12:33
  • I am getting a timeout because I already passed all the relevant values and should be going to the next commands. If I run it locally I remain in the nodejs app and waiting for further commands Hmm perhaps I should an "end of" or something in the end of the command? – Pavel Zagalsky Apr 21 '15 at 12:38
  • I think the & causes the command to run in a background process, try appending that to the end of the command, see http://stackoverflow.com/questions/4797050/how-to-run-process-as-background-and-never-die – Ron Beyer Apr 21 '15 at 12:40
  • Hmm tried with the & and with the "nohup" but it didn't do the work.. – Pavel Zagalsky Apr 21 '15 at 12:46
  • I installed "forever" for NodeJS and it solved my problem. – Pavel Zagalsky Aug 09 '15 at 07:28

0 Answers0