Appium - 命令行 [英] Appium - Command line
问题描述
团队,
你能指导我或给我一些教程来通过命令行运行 Appium 吗?我在 MAC 上看到 Appium.app 有很多问题.如果您可以分享您的知识或材料,让我继续通过命令行使用 appium 运行示例应用程序,那就太好了.请参考我在 appium.app 中的设置以供参考.
Can you please guide me or point me some tutorials to run Appium through command line? I see lot of issues with Appium.app on MAC. It would be great, if you can share your knowledge or materials for me to move forward to run a sample application with appium through command line. Please refer my settings in appium.app for your reference.
日志:
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
谢谢,拉梅什
推荐答案
从命令行使用 Appium
安装
- 打开终端会话
- 安装自制软件(说明)
- 运行以下命令
<小时>
$ brew install node # install node and npm
$ npm install -g appium # globally install appium
$ npm install wd
$ appium # Launch your appium server!
用法
每当你想开始一个 appium 服务器会话时,输入 appium
来运行服务器.
可以向该命令添加参数.
Arguments can be added to that command.
appium --app path/to/app --device-name "iPhone 模拟器"
在我的开发环境设置中,我不使用 Appium.app 服务器,但我确实使用检查器.
In my development env setup, I don't use the Appium.app server, but I DO use the inspector.
- 使用
--app
和--device-name
参数启动你的 Appium 服务器 - 点击 Appium.app 检查器图标
- iPhone 模拟器将启动,并且可能给你一个授权提示让 Instruments 控制它
- Start your Appium server with the
--app
and--device-name
arguments - Click on the Appium.app inspector icon
- The iPhone Simulator will launch, and may give you an authorization prompt for Instruments to control it
这篇关于Appium - 命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!