First of all, I use the EXE way to install the appium.
Create a new. vbs file, write the following script, and remember to replace the D disk with your own drive letter.
1. The back taskkill seems to have no practical effect. Add it.
Set ws = CreateObject ("wscript.shell""d:\\appium\\node_modules\\ . bin\\appium.cmd && cmd/c start taskkill/im cmd.exe/f", vbhide
The 2.appium.cmd file can also be replaced with the Appium file in the same directory.
Set ws = CreateObject ("wscript.shell""d:\\appium\\node_modules\\ . bin\\appium && cmd/c start taskkill/im cmd.exe/f", vbhide
3. You can also start with the Appium node.exe run Main.js file, which can be followed by some initial properties.
Set ws = CreateObject ("wscript.shell""D:\Appium\node.exe d:\ Appium\node_modules\appium\lib\server\main.js--address 127.0.0.1--port 4723--platform-name Android-- Platform-version--automation-name Appium--log-no-color", vbhide
Of course you better check before starting the lower port is not occupied, the following code
1 defkill_process (self):2U" "Kill a process that occupies 5037 ports \ n3 " " 4 Try: 5PID = Os.popen ("Netstat-ano | findstr 5037| findstr LISTENING"). Read (). split () [-1]6Os.system ("taskkill/f/pid%s"%pid)7 exceptIndexerror as E:8 Print ' Portis not occupied'
Background auto Start Appium