?????????????????????????????????appium????????????Windows OS??????????????У???????Appium server??
???????Appium GUI????????
????????cmd line ???Appium
???????????CI?????Appium GUI??????е????????????case???????Appium session???????????????Appium server???????????????????????????Appium
???????????????????command line
????PS:???command line?????Appium??????????????
??????path ???
????;C:Program Files (x86)Appium ode_modules.bin;
?????????command line??????

???????????????????Appium???????????????
?????????????????????C:Program Files (x86)Appium ode_modules.binappium.bat

?????????????????????????????ip??port log??????????????
????????????
????C:UsersTest>appium -a 127.0.0.1 -p 1235
????info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)
????info: Appium REST http interface listener started on 127.0.0.1:1235
????info: [debug] Non-default server args: {"address":"127.0.0.1"??"port":1235}
????info: Console LogLevel: debug
???????????????????????????appium --help
??????????????????Java???????command?????
????????д????????
public void excuteCMD(String comand)
{
Runtime rt = Runtime.getRuntime();
RuntimeExec rte = new RuntimeExec();
StreamWrapper error?? output;
try
{
Process proc = rt.exec(comand);
error = rte.getStreamWrapper(proc.getErrorStream()?? "ERROR");
output = rte.getStreamWrapper(proc.getInputStream()?? "OUTPUT");
BufferedReader stdInput = new BufferedReader(new InputStreamReader(proc.getInputStream()));
String s;
while ((s = stdInput.readLine()) != null)
{
System.out.println(s);
if (s.contains("Appium REST http"))
{
System.out.println("STARTED!");
}
}
error.start();
output.start();
error.join(3000);
output.join(3000);
System.out.println("Output: " + output.message + " Error: " + error.message);
} catch (IOException e)
{
e.printStackTrace();
} catch (InterruptedException e)
{
e.printStackTrace();
}
}