mac 10.14.2 安装appium 1.10.0 并且配置IOS 12.1.4环境 及其demo

我的环境变量 自己看着配置

node 

brew install node@8

npm install appium-doctor

如下,画圈圈的不要配置

若 install 时出现 少了xx.json 那么执行 npm init -f 然后继续执行

执行下面的操作 就好了

sudo npm install -g appium --unsafe-perm=true --allow-root

然后就好了 

记得科学上网·····

更新时间2019-3-8 好日子

要写ios 了 然后就捡起来了

mac 10.14.3 iphone 12.1.4

所以呢 就只能 使用那个facebook 开源的东东了

由于我的appium 是已经搭建好的 就直接配置

首先

1、安装libimobiledevice

brew install libimobiledevice --HEAD

2、安装 carthage

brew install carthage

3、安装ios-deploy、xcpretty

npm install -g ios-deploy
gem install xcpretty

4、安装opencv4nodejs:


brew install cmake
npm install -g opencv4nodejs
5、 安装fbsimctl:


brew tap facebook/fb
brew install fbsimctl
6、 安装applesimutil:


brew tap wix/brew
brew install applesimutil 

7、安装appium-xcuitest-driver依赖

不要去github上面 下载 然后编辑 是用xcode 进入/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent 这里

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

mkdir -p Resources/WebDriverAgent.bundle

sh ./Scripts/bootstrap.sh

然后使用 xcode  file - open

打开 WebDriverAgent

然后 设置 那个 agentlib

 在然后 还是在lib 

再然后 点击xcode 三角号 进行编译 成功了 会显示 这样

 

然后进入 agent runner 那个 build setting

然后在general 

然后编译一下 成功 了 与lib 一致

然后(必须要执行,记得在手机与pc 在同一网段

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

xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=真机的udid' test

然后 在手机设备描述里面信任 你的东东

然后 就可以了

运行一个demo

class IOSBasisOperation(TestCase_):
    def setUp(self):
        self.udid = get_ios_udid()

        self.desired_caps = {'platformName': 'iOS', 'deviceName': 'iPhone7 Plus', 'device': 'iOS',
                             'bundleId': 'com.zld.XXXX', 'version': '12.1.4', 'udid': self.udid,
                             'automationName': 'XCUITest', 'showXcodeLog': 'true'}
        self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', self.desired_caps)

    def tearDown(self):
        pass

    def test_01_pr(self):
        print(self.udid)

然后 就把你的 app 吊起来了  然后 环境就搭建好了 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章