Selenium With Java and Python For Mobile Apps & Web Apps......!

Thursday, 2 June 2016

How to Start Appium Server using Coding in MAC.

package com.flipkart;

import java.io.IOException;

public class AppiumLaunch {
public static String APPIUMSERVERSTART = "/Users/pardeep.k/local/bin/appium";
  public static void startAppiumServer() throws IOException, InterruptedException {
       
            ProcessBuilder pb = new ProcessBuilder(APPIUMSERVERSTART);
            pb.redirectOutput(ProcessBuilder.Redirect.INHERIT);
            pb.redirectError(ProcessBuilder.Redirect.INHERIT);
            Process process = pb.start();
          Runtime runtime = Runtime.getRuntime();
            process = runtime.exec(APPIUMSERVERSTART);
            Thread.sleep(5000);
            if (process != null) {
                System.out.println("Appium server started");
            }
       
    }
public static void main(String[] args) throws IOException, InterruptedException {
AppiumLaunch.startAppiumServer();
}

}

5 comments:

Translate

Popular Posts

Total Pageviews