Appium study test automation framework (2) - to build IOS environment

 

  Today's article about iOS of A ppium environment to build.

  For iOS , the only Mac installed on your Appium , as well as the various components needed.

  Some people might ask, can in Windows using the system Appium test iOS phone, that does not need to spend money to buy a Mac yet? The answer is no, because Appium essential is the automated test script we wrote, translated into Mac in UIAutomator script, so the only Mac to do, W indows system can not handle. However, you can install the black Apple to solve this problem.

  This article does not mention our black apple, but describes how the mac installation can run on a laptop iOS automated testing appium .

  The following 6 steps, in the last article, we have introduced, please refer to the previous article. .

     1 ) mounting the Node .

     2 ) Use Node download Appium Server .

     3 ) Download and install Appium Desktop.

     4 ) Download and install Python 3 .

     5 ) Use pip download Appium Client .

     6 ) Installation Appium Doctor .

 

  Why iOS support Appium trouble it, because even perform the following steps:

     1 ) Install the latest version of XCode , go to App Store to download and install the latest version can

  To ensure XCode version and the IPhone version is compatible, otherwise upgrade the system.

 

      2 ) install Xcode Command Line Tools

      To the official website Line Tools Download the Command , and before this man is XCode tied together installed, then the separation of single too, so go Developer Apple 's official website to download and install a separate download address is:

       https://developer.apple.com/download/more/

 

 

  Do not attempt to use Xcode-the SELECT --install , it failed.

 

     3 ) install homebrew , for mac software package download system. Execute the following script:

/usr/bin/ruby -e "$(curl –fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

 

     4 ) Installation Carthage, a dependency management, the following command:

brew install carthage

 

    5 ) Installation  libimobiledevice , for Appium connected iOS device

brew install libimobiledevice –HEAD –g

 

    6 ) installation ideviceinstaller , for managing installed on the phone App :

brew install ideviceinstaller –g

 

    If this command is executed given as follows:

    Could not connect to lockdownd. Exiting.

 The solution is to increase lockdown privileges, execute the following command:

    sudo chmod –R 777 /var/db/lockdown

 

    7 ) Installation iOS-Deploy , iOS10 system only needs to be installed above

    npm install -g ios-deploy

 

    8 ) Set WebDriverAgent project Signing

    Appium for iOS supported by WebDriverAgent to achieve, this is the Facebook open source project, built in Appium Desktop Located in following the path:

    /Application/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj

  But we installed Appium after, it does not specify a built-in WebDriverAgent developer account, so to enter the directory, manually.

  With XCode open WebDriverAgent.xcodeproj , and two configuration the Targets , one WebDriverAgentLib , the other is WebDriverAgentRunner , configuration Signing , provided Team developers can account.

 

 

 

       9 ) In addition, I also encountered an error message, saying that the Apple Developer Developer accounts need a new agreement, need I landed up clicking agree, according to what it says to do, log in to the Apple Developer click Agree enough.

 

  So far, in Appium you can run on iOS automated testing, and these steps are indispensable. It can be said Hong eighty-one difficult step in a pit, I do this full toss three or four days, just configured.

      10 ) If the previous homework done, that appium basically you can use. In the execution appium-doctor command, you will see some warnings:

 

 

      Let's address these one by one warning.

      1.opencv4nodejs cannot be found

  到官网下载CMake并安装,地址如下所示:

     https://cmake.org/download/

  把CMake的路径添加到全局变量PATH中,如下所示:

     export CMAKE_ROOT=/Applications/CMake.app/Contents/bin/

     export PATH=$CMAKE_ROOT:$PATH

 

      最后执行命令:

       npm install opencv4nodejs 

 

       2. ffmpeg cannot be found

  解决方案:输入brew install ffmpeg

 

       3. mjpeg-comsumer cannot be found

  解决方案:输入npm i -g mjpeg-consumer

 

      4. idb and idb_companion are not installed

      执行以下命令

      brew tap facebook/fb
      brew install idb-companion
      pip3.7 install fb-idb

      注意pip3.7是我的python的版本号。可以去全局变量中检查一下是否设置了pip的路径,有的是3.6或别的版本。

 

      5. applesimutils cannot be found

     执行以下命令:

     brew tap wix/brew
     brew install applesimutils

 

      6. bundletool.jar cannot be found

  到https://github.com/google/bundletool/releases下载bundletool.jar的最新版本,下载到的这个jar的文件名可能有带版本号,无论是什么,都改名为bundletool.jar

  在前面创建的sdk目录下,创建一个子目录bundle-tool,把bundletool.jar放在这个子目录下。

  给这个子目录和这个jar文件,增加权限。执行下面的脚本:

      chmod +x 

      chmod +x bundletool.jar

 

  在全局变量PATH中,增加bundletool.jar的路径,如下所示:

     expert PATH=${PATH}:$ANDROID_HOME/bundle-tool

 

  在下一篇文章中,我将介绍电脑如何连接AndroidiOS真机和模拟器,以及准备合适的DesiredCapabilities,从而在Appium中启动App

Guess you like

Origin www.cnblogs.com/Jax/p/12203004.html