Appium - 命令行

时间:2014-09-24 16:05:37

标签: ios7.1 appium

您能指导我或指点一些教程通过命令行运行Appium吗?我在MAC上看到Appium.app的很多问题。如果您可以通过命令行分享您的知识或材料以继续使用appium运行示例应用程序,那将会很棒。请参考appium.app中的我的设置以供参考。

Appium - Not able to launch the inspector

日志:

info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.2.2","revision":"cf6ff5939ddc6b4d45fcbabfbfe13c950e0058c4"}}}
info: <-- GET /wd/hub/status 200 1.335 ms - 104 {"status":0,"value":{"build":{"version":"1.2.2","revision":"cf6ff5939ddc6b4d45fcbabfbfe13c950e0058c4"}}}
info: --> GET /wd/hub/sessions {}
info: [debug] Responding to client with success: {"status":0,"value":[]}
info: <-- GET /wd/hub/sessions 200 2.145 ms - 23 {"status":0,"value":[]}
info: --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"iOS","platformVersion":"7.1","newCommandTimeout":"999999","automationName":"Appium","deviceName":"iPhone Simulator"}}
info: [debug] Using local app from command line: /Users/rsangili/Desktop/temp/Payload/TestApp2.app
info: [debug] Creating new appium session dd2c8121-6a13-48be-8a0b-9fc6233437a5
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode folder
info: [debug] Setting Xcode version
info: [debug] Setting iOS SDK Version
info: [debug] iOS SDK Version set to 7.1
info: [debug] Detecting automation tracetemplate
info: [debug] Not auto-detecting udid, running on sim
error: Could not parse plist file (as binary) at /Users/rsangili/Desktop/temp/Payload/TestApp2.app/en.lproj/Localizable.strings
info: Will try to parse the plist file as XML
error: Could not parse plist file (as XML) at /Users/rsangili/Desktop/temp/Payload/TestApp2.app/en.lproj/Localizable.strings
warn: Could not parse app Localizable.strings
info: [debug] Not setting locale
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir:
info: [debug] Dynamic env:
info: [debug] Dynamic bootstrap code:
info: [debug] Dynamic bootstrap path:
info: [debug] Reusing dynamic bootstrap:
info: [debug] Fixing device was changed from:"
info: [debug] No iOS / app preferences to set
info: [debug] Starting iOS 7.* simulator log capture
info: [debug] Killing the simulator process
info: [debug] Killing any other simulator daemons
info: [debug] Checking whether instruments supports our device string
info: [debug] Getting list of devices instruments supports
info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
info: [debug] Fixing device was changed from:"
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Command failed: 
info: [debug] Error: Command failed: 
    at ChildProcess.exithandler (child_process.js:648:15)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: )","killed":true,"code":null,"signal":"SIGTERM","origValue":"Command failed: "},"sessionId":null}
info: <-- POST /wd/hub/session 500 6381.780 ms - 199 

谢谢, 拉梅什

2 个答案:

答案 0 :(得分:9)

从命令行使用Appium

安装

  1. 打开终端会话
  2. 安装自制程序(instructions
  3. 运行以下命令

  4.  $ brew install node # install node and npm
     $ npm install -g appium # globally install appium
     $ npm install wd
     $ appium # Launch your appium server!
    

    用法

    每当您想要开始appium服务器会话时,请键入appium以运行服务器。

    可以将参数添加到该命令。

    appium --app path/to/app --device-name "iPhone Simulator"

    将Appium.app检查器与服务器

    一起使用

    在我的开发环境设置中,我不使用Appium.app服务器,但我 DO 使用检查器。

    1. 使用--app--device-name参数
    2. 启动Appium服务器
    3. 单击Appium.app检查器图标
    4. iPhone模拟器将启动,可能为您提供仪器控制权限的授权提示

答案 1 :(得分:1)

设置Appium

Mac:

http://www.oracle.com/technetwork/java/javase/downloads/index.html下载并安装最新的Java 从http://developer.android.com/sdk/index.html下载并安装最新的Android SDK 在.bash配置文件中配置ANDROID_HOME和JAVA_HOME的路径 在.bash配置文件中配置Platform-tools and tools文件夹的路径 安装ruby

安装brew

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)"

从.bash个人资料

设置brew的路径
  export PATH="$HOME/.linuxbrew/bin:$PATH"
  export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
  export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"

安装节点:在终端上逐一粘贴以下命令,然后按Enter键

  brew update
  brew install node
  brew link node

安装appium

  npm install -g appium


  npm install wd

启动appium:在终端粘贴以下命令并按Enter键

  appium

安装Appium python客户端: 从中下载源代码 https://github.com/appium/python-client 解压缩,从终端导航到包含Python客户端的文件夹,然后按以下方式安装: cd python-client

python setup.py install

使用的IDE:Pycharm

Linux: 

http://www.oracle.com/technetwork/java/javase/downloads/index.html下载并安装最新的Java 从http://developer.android.com/sdk/index.html下载并安装最新的Android SDK     在.bashrc配置文件中配置ANDROID_HOME和JAVA_HOME的路径 在.bashrc配置文件中配置Platform-tools and tools文件夹的路径 命令gedit.bashrc打开bash配置文件并指定路径 安装红宝石 安装linux brew       ruby -e“$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)”

让appium在ubuntu pc上运行的步骤:

安装ruby:在终端粘贴以下命令,然后按Enter键

  sudo apt-get install build-essential curl git m4 ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev

安装linux brew:在终端粘贴以下命令并按Enter键       ruby -e“$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)”

设置brew的路径

键入:终端的gedit.bashrc,然后将其粘贴到.bashrc文件中

  export PATH="$HOME/.linuxbrew/bin:$PATH"
  export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
  export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"

安装节点:在终端上逐一粘贴以下命令,然后按Enter键

  brew update
  brew install node
  brew link node

安装appium

  npm install -g appium


  npm install wd

启动appium:在终端粘贴以下命令并按Enter键

  appium

安装Appium python客户端: 从中下载源代码 https://github.com/appium/python-client 解压缩,从终端导航到包含Python客户端的文件夹,然后按以下方式安装:       cd python-client

 python setup.py install

使用的IDE:Spyder / Pycharm 你可以通过运行命令获得spyder         Sudo apt-get安装Spyder     Windows:

https://www.python.org/downloads/下载并安装python 2.7.9 从http://www.oracle.com/technetwork/java/javase/downloads/index.html下载并安装最新的Java 从http://developer.android.com/sdk/index.html下载Android SDK 将环境变量设置为JAVA_HOME for Java,Python.exe for python和ANDROID_HOME to Android sdk,以及Android工具和平台工具。

使用的IDE:Pycharm

https://www.jetbrains.com/pycharm/下载并安装pycharm IDE 安装Appium python客户端: 从中下载源代码 https://github.com/appium/python-client 解压缩,从终端导航到包含Python客户端的文件夹,然后按以下方式安装: cd python-client

python setup.py安装 从Windows PC使用Appium gui启动节点服务器