Mac上Appium设置的设置是什么

时间:2018-07-05 03:38:11

标签: node.js automation environment-variables homebrew appium-ios

我正在尝试为Appium设置mac自动化机器,并且对设置有点困惑(背景是Test automation)。我已经通过homebrew下载了Jdk,针对Mac的Eclipse IDE,xcode和homebrew +节点。 我在.bash_profile中为JDK设置了env变量,但是我不确定是否需要为Node添加env变量(我是通过自制软件安装Node的),就像Windows一样。 我也想了解在Mac .bash_profile中需要提及的所有属性。 我使用npm install -g appium安装了appium。 还可以有人建议我如何以编程方式打开我的xcode模拟器(基本上应该在哪里更新我的.app路径)?

2 个答案:

答案 0 :(得分:0)

确保正确安装了node,在终端中运行node -v:您应该获得其版本。对npm执行相同操作。

然后安装appium-doctor检查appium的环境:npm install -g appium-doctor

要检查针对iOS的环境设置是否正确完成,您需要运行: appium-doctor --ios

如果没有红色标记=>完成,否则请修复错误点(变量,路径等)

Appium将在测试之前自动启动模拟器,只需确保您设置了XCode版本支持的功能即可。

答案 1 :(得分:0)

  1. 首先,我们需要检查哪个xcode版本与我们的Mac OS兼容,请使用此链接https://en.wikipedia.org/wiki/Xcode

  2. 然后下载Xcode(https://developer.apple.com/download/more/)。安装后,将xCode移至应用程序文件夹 然后我们需要在下面的查询中执行

    sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

    要检查下面的Xcode路径是查询

    xcode-select -p

  3. 下载Java 8(http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

  4. 从此链接下载Eclipse for Java Developers并安装它。 http://www.eclipse.org/downloads/

  5. 下载节点js并安装https://nodejs.org/en/download/

  6. 安装自制软件: 打开终端,然后运行以下命令/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)“ 检查版本brew —版本

  7. 安装迦太基,然后运行此命令 brew install carthage brew install libimobiledevice –HEAD npm install -g ios-deploy ( make sure you have Xcode installed first ) brew install ideviceinstaller

  8. 运行

    Install appiumnpm install -g appium npm install wd npm install appium-doctor -g

要开始为iOS设备使用Appium和Appium检查器,必须先将webdriveragent应用程序安装到iOS设备上。

  1. cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent

  2. mkdir -p /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Resources/WebDriverAgent.bundle

  3. bash脚本/bootstrap.sh -d

  4. 从下面的链接从git hub下载Xcode Web驱动程序项目 https://github.com/facebook/WebDriverAgent

  5. 转到以下位置并打开Xcode项目

    /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent

  6. 下载appium桌面https://github.com/appium/appium-desktop/releases/tag/v1.6.2

  7. 从开发人员分发证书中获取证书Dev证书打开这些证书并添加到钥匙串中

  8. 在Xcode中更改捆绑包标识符名称/团队/签名详细信息

然后将所有功能添加到appium中并保存

{
 “platformName”: “iOS”,
 “deviceName”: “iPhone 5”,
 “platformVersion”: “11.0”,
 “app”: “/Users/sasmitabehara/Downloads/abc.ipa”,
 “automationName”: “XCUITest”,
 “udid”: “8a25b3a9b2f312dfb9b8492827d7feeded7a9afa”,
 “noReset”: true,
 “appiumVersion”: “1.8.1”,
 “agentPath”: “/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj”,
 “bootStrapPath”: “/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent”,
 “xCodeSigningId”: “iphone Developer”
}

一旦一切准备就绪,然后运行Web驱动程序代理,一旦您成功建立了味精,则打开Appium并打开已保存的功能,然后启动服务器。

谢谢:)

相关问题