Skip to content

Instantly share code, notes, and snippets.

@mfaisalkhatri
Created October 15, 2022 03:51
Show Gist options
  • Save mfaisalkhatri/b48f474f0aa1d926d7b01415947fdf9e to your computer and use it in GitHub Desktop.
Save mfaisalkhatri/b48f474f0aa1d926d7b01415947fdf9e to your computer and use it in GitHub Desktop.
Start Appium server Programmatically
public static void startServer () {
AppiumServiceBuilder builder = new AppiumServiceBuilder ();
builder.withIPAddress ("127.0.0.1")
.usingPort (4723)
.withAppiumJS (
new File ("C:\\Users\\Windows\\AppData\\Roaming\\npm\\node_modules\\appium\\build\\lib\\main.js"))
.usingDriverExecutable (new File ("E:\\Program Files\\nodejs\\node.exe"))
.withArgument (BASEPATH, "/wd/hub")
.withArgument (GeneralServerFlag.SESSION_OVERRIDE)
.withArgument (GeneralServerFlag.LOG_LEVEL, "debug");
service = AppiumDriverLocalService.buildService (builder);
service.start ();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment