是否可以下载Appium v1.7.2命令行工具(CLI)?

是否可以下载Appium v1.7.2命令行工具(CLI)?,appium,appium-ios,appium-android,Appium,Appium Ios,Appium Android,目前我正在使用Appium Desktop v1.7.2,并在运行脚本之前手动启动服务器。但现在我必须通过v1.7.2的代码/程序启动Appium server来进行框架设计。我知道Appium桌面版不能通过程序启动(如果我没有错的话) 任何人都可以让我知道,他们的Appium v1.7.2 CLI是否可以下载/提供?如果是,任何示例脚本都会有很大帮助。这里是我自己的Appium服务器实用程序类: import java.io.IOException; import java.net.Serve

目前我正在使用Appium Desktop v1.7.2,并在运行脚本之前手动启动服务器。但现在我必须通过v1.7.2的代码/程序启动Appium server来进行框架设计。我知道Appium桌面版不能通过程序启动(如果我没有错的话)


任何人都可以让我知道,他们的Appium v1.7.2 CLI是否可以下载/提供?如果是,任何示例脚本都会有很大帮助。

这里是我自己的Appium服务器实用程序类:

import java.io.IOException;
import java.net.ServerSocket;

import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.service.local.AppiumDriverLocalService;
import io.appium.java_client.service.local.AppiumServiceBuilder;
import io.appium.java_client.service.local.flags.GeneralServerFlag;

/**
 * This class handles Appium Server
 * 
 * @author Bill Hileman
 */
public class AppiumServer {

    private AppiumDriverLocalService service;
    private AppiumServiceBuilder builder;
    private DesiredCapabilities cap;

    private int port = 4723;

    public void startServer() {
        // Set Capabilities
        cap = new DesiredCapabilities();
        cap.setCapability("noReset", "false");

        // Build the Appium service
        builder = new AppiumServiceBuilder();
        builder.withIPAddress("0.0.0.0");
        builder.usingPort(port);
        builder.withCapabilities(cap);
        builder.withArgument(GeneralServerFlag.SESSION_OVERRIDE);
        builder.withArgument(GeneralServerFlag.LOG_LEVEL, "error");

        // Start the server with the builder
        service = AppiumDriverLocalService.buildService(builder);
        service.start();
    }

    public void stopServer() {
        service.stop();
    }

    public boolean serverIsRunnning() {

        boolean isServerRunning = false;
        ServerSocket serverSocket;
        try {
            serverSocket = new ServerSocket(port);
            serverSocket.close();
        } catch (IOException e) {
            // If control comes here, then it means that the port is in use
            isServerRunning = true;
        } finally {
            serverSocket = null;
        }
        return isServerRunning;
    }

}
在mac上:
mkdir您的应用程序目录

cd您的应用目录

npm安装appium@1.7.2

cd-appium

npm安装
[这是获取依赖项并下载]

要手动启动服务器:
节点。

以编程方式启动服务器:[Python代码]

p=subprocess.Popen('node'),cwd=your\u appium\u dir\u path,stdout=subprocess.PIPE,stderr=subprocess.PIPE)

是否使用npm安装了appium CLIappium@1.7.2指挥部?是的,我就是这个意思