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 吊起來了  然後 環境就搭建好了 

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