美文网首页
iOS自动化测试系统搭建--appuim

iOS自动化测试系统搭建--appuim

作者: 胡志强 | 来源:发表于2019-12-05 14:50 被阅读0次

    我今天对于整体的自动化测试还是个小白,以前使用的都是iOS平台的自动化测试工具,现在为了测试小白可以使用,所以使用Appium+python搭建自动化测试品平台
    appium下载地址
    python-client这个是appium的客户端现在我也不知道干什么用的,我先下下来看看
    因为mac自带python2.7 可以直接使用下载

    pip install Appium-Python-Client
    

    我执行完是这个鸟结果

    Last login: Tue Dec  3 13:50:02 on ttys001
     admin@zhiqiang ~ pip intall
    ERROR: unknown command "intall" - maybe you meant "install"
     ✘ admin@zhiqiang ~ pip install Appium-Python-Client
    DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
    Collecting Appium-Python-Client
      Downloading https://files.pythonhosted.org/packages/9b/f2/a02eade6a1cd3c463b5493453cc4c7fecf6eada448844af1c416bcf0f971/Appium-Python-Client-0.48.tar.gz (54kB)
         |████████████████████████████████| 61kB 334kB/s
    Collecting selenium<4,>=3.14.1 (from Appium-Python-Client)
      Downloading https://files.pythonhosted.org/packages/80/d6/4294f0b4bce4de0abf13e17190289f9d0613b0a44e5dd6a7f5ca98459853/selenium-3.141.0-py2.py3-none-any.whl (904kB)
         |████████████████████████████████| 911kB 1.0MB/s
    Collecting urllib3 (from selenium<4,>=3.14.1->Appium-Python-Client)
      Downloading https://files.pythonhosted.org/packages/b4/40/a9837291310ee1ccc242ceb6ebfd9eb21539649f193a7c8c86ba15b98539/urllib3-1.25.7-py2.py3-none-any.whl (125kB)
         |████████████████████████████████| 133kB 2.6MB/s
    Installing collected packages: urllib3, selenium, Appium-Python-Client
    ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/urllib3'
    Consider using the `--user` option or check the permissions.
    
     ✘ admin@zhiqiang ~ ECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
    

    大概意思是:弃用:Python2.7将于2020年1月1日结束其生命。请升级您的Python,因为Python 2.7在该日期之后将不会被维护。pip的未来版本将不再支持Python 2.7。有关pip中Python 2支持的更多详细信息,请访问https://pip.pypa.io/en/latest/development/release process/#Python-2-support
    错误:由于环境错误,无法安装程序包错误:[Errno 13]权限被拒绝:'/Library/Python/2.7/site packages/urllib3'
    考虑使用“--user”选项或检查权限。

    这样我就先升级下python

    升级python我使用的是Homebrew,我电脑上没安Homebrew,我先安下,

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

    结果是这个样子

     admin@zhiqiang ~ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
    ==> This script will install:
    /usr/local/bin/brew
    /usr/local/share/doc/homebrew
    /usr/local/share/man/man1/brew.1
    /usr/local/share/zsh/site-functions/_brew
    /usr/local/etc/bash_completion.d/brew
    /usr/local/Homebrew
    ==> The following existing directories will be made group writable:
    /usr/local/lib/pkgconfig
    ==> The following existing directories will have their owner set to admin:
    /usr/local/lib/pkgconfig
    
    Press RETURN to continue or any other key to abort
    

    妈的我都服了,查了下意思是:按“返回”继续,或按任何其他键中止,都怪我英文不好不是报错哈哈,按下回车。就是这个样子

    ==> /usr/bin/sudo /bin/chmod u+rwx /usr/local/lib/pkgconfig
    Password:
    Sorry, try again.
    Password:
    ==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/lib/pkgconfig
    ==> /usr/bin/sudo /usr/sbin/chown admin /usr/local/lib/pkgconfig
    ==> Downloading and installing Homebrew...
    remote: Enumerating objects: 3028, done.
    remote: Counting objects: 100% (3028/3028), done.
    remote: Total 5751 (delta 3028), reused 3028 (delta 3028), pack-reused 2723
    Receiving objects: 100% (5751/5751), 1.65 MiB | 409.00 KiB/s, done.
    Resolving deltas: 100% (4350/4350), completed with 652 local objects.
    From https://github.com/Homebrew/brew
       099b04734..1c9e30e24  master     -> origin/master
     * [new tag]             2.1.10     -> 2.1.10
     * [new tag]             2.1.11     -> 2.1.11
     * [new tag]             2.1.12     -> 2.1.12
     * [new tag]             2.1.13     -> 2.1.13
     * [new tag]             2.1.14     -> 2.1.14
     * [new tag]             2.1.15     -> 2.1.15
     * [new tag]             2.1.16     -> 2.1.16
     * [new tag]             2.1.3      -> 2.1.3
     * [new tag]             2.1.4      -> 2.1.4
     * [new tag]             2.1.5      -> 2.1.5
     * [new tag]             2.1.6      -> 2.1.6
     * [new tag]             2.1.7      -> 2.1.7
     * [new tag]             2.1.8      -> 2.1.8
     * [new tag]             2.1.9      -> 2.1.9
     * [new tag]             2.2.0      -> 2.2.0
    HEAD is now at 1c9e30e24 Merge pull request #6799 from MikeMcQuaid/clt-download-more
    
    //////////////中间省略吧//////////////////////
    
    mtl                       nordugrid-arc              whirr
    grib-api                   openssl                    wine
    guile@2.0                  packetbeat                 xar-mackyle
    hana                       pbrt
    httest                     percona-server-mongodb
    ==> Installation successful!
    
    ==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
    Read the analytics documentation (and how to opt-out) here:
      https://docs.brew.sh/Analytics
    
    ==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
      https://github.com/Homebrew/brew#donations
    ==> Next steps:
    - Run `brew help` to get started
    - Further documentation:
        https://docs.brew.sh
    
    
    

    好想是好了
    安装 python3 brew install python3
    结果

    admin@zhiqiang ~ 
     admin@zhiqiang ~ brew install python3
    Updating Homebrew...
    ==> Installing dependencies for python: gdbm, openssl@1.1, readline, sqlite and xz
    ==> Installing python dependency: gdbm
    ==> Downloading https://homebrew.bintray.com/bottles/gdbm-1.18.1.mojave.bottle.1
    ######################################################################## 100.0%
    ==> Pouring gdbm-1.18.1.mojave.bottle.1.tar.gz
      /usr/local/Cellar/gdbm/1.18.1: 20 files, 586.9KB
    ==> Installing python dependency: openssl@1.1
    ==> Downloading https://homebrew.bintray.com/bottles/openssl@1.1-1.1.1d.mojave.b
    ==> Downloading from https://akamai.bintray.com/10/104ef018b7bb8fcc49f57e5a60359
    ######################################################################## 100.0%
    ==> Pouring openssl@1.1-1.1.1d.mojave.bottle.tar.gz
    ==> Caveats
    A CA file has been bootstrapped using certificates from the system
    keychain. To add additional certificates, place .pem files in
      /usr/local/etc/openssl@1.1/certs
    
    and run
      /usr/local/opt/openssl@1.1/bin/c_rehash
    
    openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
    because openssl/libressl is provided by macOS so don't link an incompatible version.
    
    If you need to have openssl@1.1 first in your PATH run:
      echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc
    
    For compilers to find openssl@1.1 you may need to set:
      export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
      export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
    
    ==> Summary
      /usr/local/Cellar/openssl@1.1/1.1.1d: 7,983 files, 18.0MB
    ==> Installing python dependency: readline
    ==> Downloading https://homebrew.bintray.com/bottles/readline-8.0.1.mojave.bottl
    ==> Downloading from https://akamai.bintray.com/3c/3c754391e9d243835811d128771ca
    ######################################################################## 100.0%
    ==> Pouring readline-8.0.1.mojave.bottle.tar.gz
    ==> Caveats
    readline is keg-only, which means it was not symlinked into /usr/local,
    because macOS provides the BSD libedit library, which shadows libreadline.
    In order to prevent conflicts when programs look for libreadline we are
    defaulting this GNU Readline installation to keg-only.
    
    For compilers to find readline you may need to set:
      export LDFLAGS="-L/usr/local/opt/readline/lib"
      export CPPFLAGS="-I/usr/local/opt/readline/include"
    
    ==> Summary
      /usr/local/Cellar/readline/8.0.1: 48 files, 1.5MB
    ==> Installing python dependency: sqlite
    ==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.30.1.mojave.bottle
    ==> Downloading from https://akamai.bintray.com/5e/5e6fef2d754e0e4009d502c40ad18
    #######                                                                    9.9%b######################################################################## 100.0%
    ==> Pouring sqlite-3.30.1.mojave.bottle.tar.gz
    ==> Caveats
    sqlite is keg-only, which means it was not symlinked into /usr/local,
    because macOS provides an older sqlite3.
    
    If you need to have sqlite first in your PATH run:
      echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.zshrc
    
    For compilers to find sqlite you may need to set:
      export LDFLAGS="-L/usr/local/opt/sqlite/lib"
      export CPPFLAGS="-I/usr/local/opt/sqlite/include"
    
    ==> Summary
      /usr/local/Cellar/sqlite/3.30.1: 11 files, 3.9MB
    ==> Installing python dependency: xz
    ==> Downloading https://homebrew.bintray.com/bottles/xz-5.2.4.mojave.bottle.tar.
    ==> Downloading from https://akamai.bintray.com/01/010667293df282c8bceede3bcd369
    ######################################################################## 100.0%
    ==> Pouring xz-5.2.4.mojave.bottle.tar.gz
      /usr/local/Cellar/xz/5.2.4: 92 files, 1MB
    ==> Installing python
    ==> Downloading https://homebrew.bintray.com/bottles/python-3.7.5.mojave.bottle.
    ==> Downloading from https://akamai.bintray.com/bc/bcbdc3612a10d06facca7ec949926
    ######################################################################## 100.0%
    ==> Pouring python-3.7.5.mojave.bottle.tar.gz
    ==> /usr/local/Cellar/python/3.7.5/bin/python3 -s setup.py --no-user-cfg install
    ==> /usr/local/Cellar/python/3.7.5/bin/python3 -s setup.py --no-user-cfg install
    ==> /usr/local/Cellar/python/3.7.5/bin/python3 -s setup.py --no-user-cfg install
    ==> Caveats
    Python has been installed as
      /usr/local/bin/python3
    
    Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
    `python3`, `python3-config`, `pip3` etc., respectively, have been installed into
      /usr/local/opt/python/libexec/bin
    
    If you need Homebrew's Python 2.7 run
      brew install python@2
    
    You can install Python packages with
      pip3 install <package>
    They will install into the site-package directory
      /usr/local/lib/python3.7/site-packages
    
    See: https://docs.brew.sh/Homebrew-and-Python
    ==> Summary
      /usr/local/Cellar/python/3.7.5: 3,972 files, 60.7MB
    ==> Caveats
    ==> openssl@1.1
    A CA file has been bootstrapped using certificates from the system
    keychain. To add additional certificates, place .pem files in
      /usr/local/etc/openssl@1.1/certs
    
    and run
      /usr/local/opt/openssl@1.1/bin/c_rehash
    
    openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
    because openssl/libressl is provided by macOS so don't link an incompatible version.
    
    If you need to have openssl@1.1 first in your PATH run:
      echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc
    
    For compilers to find openssl@1.1 you may need to set:
      export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
      export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
    
    ==> readline
    readline is keg-only, which means it was not symlinked into /usr/local,
    because macOS provides the BSD libedit library, which shadows libreadline.
    In order to prevent conflicts when programs look for libreadline we are
    defaulting this GNU Readline installation to keg-only.
    
    For compilers to find readline you may need to set:
      export LDFLAGS="-L/usr/local/opt/readline/lib"
      export CPPFLAGS="-I/usr/local/opt/readline/include"
    
    ==> sqlite
    sqlite is keg-only, which means it was not symlinked into /usr/local,
    because macOS provides an older sqlite3.
    
    If you need to have sqlite first in your PATH run:
      echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.zshrc
    
    For compilers to find sqlite you may need to set:
      export LDFLAGS="-L/usr/local/opt/sqlite/lib"
      export CPPFLAGS="-I/usr/local/opt/sqlite/include"
    
    ==> python
    Python has been installed as
      /usr/local/bin/python3
    
    Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
    `python3`, `python3-config`, `pip3` etc., respectively, have been installed into
      /usr/local/opt/python/libexec/bin
    
    If you need Homebrew's Python 2.7 run
      brew install python@2
    
    You can install Python packages with
      pip3 install <package>
    They will install into the site-package directory
      /usr/local/lib/python3.7/site-packages
    
    See: https://docs.brew.sh/Homebrew-and-Python
    

    我们在验证下
    在终端输入python3

     admin@zhiqiang ~ python3
    Python 3.7.5 (default, Nov  1 2019, 02:16:32)
    [Clang 11.0.0 (clang-1100.0.33.8)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    

    这样就好了
    但是我们需要先换下默认python版本
    vim ~/.bash_profile(打开配置环境变量)输入 alias python="/usr/local/Cellar/python/3.7.5/bin/python3"保存然后source ~/.bash_profile(刷新)

    然后我们接着安装python-client

    pip install Appium-Python-Client
    

    但是还是不行后来突然想到使用

    pip3 install Appium-Python-Client
    

    哈哈好使了

    Collecting Appium-Python-Client
      Using cached https://files.pythonhosted.org/packages/9b/f2/a02eade6a1cd3c463b5493453cc4c7fecf6eada448844af1c416bcf0f971/Appium-Python-Client-0.48.tar.gz
    Collecting selenium<4,>=3.14.1
      Using cached https://files.pythonhosted.org/packages/80/d6/4294f0b4bce4de0abf13e17190289f9d0613b0a44e5dd6a7f5ca98459853/selenium-3.141.0-py2.py3-none-any.whl
    Collecting urllib3
      Using cached https://files.pythonhosted.org/packages/b4/40/a9837291310ee1ccc242ceb6ebfd9eb21539649f193a7c8c86ba15b98539/urllib3-1.25.7-py2.py3-none-any.whl
    Building wheels for collected packages: Appium-Python-Client
      Building wheel for Appium-Python-Client (setup.py) ... done
      Created wheel for Appium-Python-Client: filename=Appium_Python_Client-0.48-cp37-none-any.whl size=77193 sha256=27aa5c184f2f8f2626340517e92ac43a1741a05b9e409a9dacfbaf8c281e78fa
      Stored in directory: /Users/admin/Library/Caches/pip/wheels/62/4d/c5/8c78bdddbde2832a91e8a61edeb60b8aa7e14452559b15f632
    Successfully built Appium-Python-Client
    Installing collected packages: urllib3, selenium, Appium-Python-Client
    Successfully installed Appium-Python-Client-0.48 selenium-3.141.0 urllib3-1.25.7
      admin@zhiqiang ~ python
    Python 3.7.5 (default, Nov  1 2019, 02:16:32)
    [Clang 11.0.0 (clang-1100.0.33.8)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    

    验证下

      admin@zhiqiang ~ python
    Python 3.7.5 (default, Nov  1 2019, 02:16:32)
    [Clang 11.0.0 (clang-1100.0.33.8)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import selenium
    >>> selenium.__version__
    '3.141.0'
    

    然后appium是node弄出来的在装个node

    brew install node
    

    结果

     ✘  admin@zhiqiang ~ brew install node
    Updating Homebrew...
    ==> Installing dependencies for node: icu4c
    ==> Installing node dependency: icu4c
    ==> Downloading https://homebrew.bintray.com/bottles/icu4c-64.2.mojave.bottle.ta
    ==> Downloading from https://akamai.bintray.com/e8/e858556120acc0c2d52b8fb572b67
    #                                                                          2.3%
    curl: (56) LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
    ######################################################################## 100.0%
    ==> Pouring icu4c-64.2.mojave.bottle.tar.gz
    ==> Caveats
    icu4c is keg-only, which means it was not symlinked into /usr/local,
    because macOS provides libicucore.dylib (but nothing else).
    
    If you need to have icu4c first in your PATH run:
      echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.zshrc
      echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.zshrc
    
    For compilers to find icu4c you may need to set:
      export LDFLAGS="-L/usr/local/opt/icu4c/lib"
      export CPPFLAGS="-I/usr/local/opt/icu4c/include"
    
    ==> Summary
      /usr/local/Cellar/icu4c/64.2: 257 files, 69.2MB
    ==> Installing node
    ==> Downloading https://homebrew.bintray.com/bottles/node-13.2.0.mojave.bottle.t
    ==> Downloading from https://akamai.bintray.com/81/81afcc0c973d27127810a3fe527f7
    ######################################################################## 100.0%
    ==> Pouring node-13.2.0.mojave.bottle.tar.gz
    ==> Caveats
    Bash completion has been installed to:
      /usr/local/etc/bash_completion.d
    ==> Summary
      /usr/local/Cellar/node/13.2.0: 4,654 files, 58.8MB
    ==> Caveats
    ==> icu4c
    icu4c is keg-only, which means it was not symlinked into /usr/local,
    because macOS provides libicucore.dylib (but nothing else).
    
    If you need to have icu4c first in your PATH run:
      echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.zshrc
      echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.zshrc
    
    For compilers to find icu4c you may need to set:
      export LDFLAGS="-L/usr/local/opt/icu4c/lib"
      export CPPFLAGS="-I/usr/local/opt/icu4c/include"
    
    ==> node
    Bash completion has been installed to:
      /usr/local/etc/bash_completion.d
    

    然后在安装cnpm 好像和npm一样先下着在说

    npm install -g cnpm --registry=https://registry.npm.taobao.org
    

    结果

      admin@zhiqiang ~ npm install -g cnpm --registry=https://registry.npm.taobao.org
    /usr/local/bin/cnpm -> /usr/local/lib/node_modules/cnpm/bin/cnpm
    + cnpm@6.1.0
    added 680 packages from 933 contributors in 12.462s
    

    验证下cpm -v

     ✘  admin@zhiqiang ~ cnpm -v
    cnpm@6.1.0 (/usr/local/lib/node_modules/cnpm/lib/parse_argv.js)
    npm@6.13.1 (/usr/local/lib/node_modules/cnpm/node_modules/npm/lib/npm.js)
    node@13.2.0 (/usr/local/Cellar/node/13.2.0/bin/node)
    npminstall@3.25.0 (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/index.js)
    prefix=/usr/local
    darwin x64 18.5.0
    registry=https://r.npm.taobao.org
    

    安装carthage
    类似cocoapods管理第三方代码,自动将工程编译为动态库,仅支持iOS8以上。

    brew install carthage
    

    5.安装其他工具
    libimobiledevice 使用指南

    brew install libimobiledevice --HEAD
    

    ideviceinstaller 负责给iOS设备安装卸载应用或者备份应用。该工具是基于libmobiledevice的,因此首先要完成libmobiledevice的编译安装

    brew install ideviceinstaller
    

    ideviceinstaller不支持iOS10。所以我们还需要安装ios-deploy,ios-deploy是一个使用命令行安装iosapp到连接的设备的工具,原理是根据osx命令行工程调用系统底层函数,获取连接的设备、查询/安装/卸载app。

    cnpm install -g ios-deploy
    

    xcpretty 用于对xcodebuild的输出进行格式化,可以不安装

    sudo gem install xcpretty
    

    会报错You don't have write permissions for the /usr/bin directory.
    修改为

    sudo gem install xcpretty -n /usr/local/bin
    

    App Inspector 是运行在浏览器端的移动设备 UI 查看器,使用树状态结构查看 UI 布局,并且能自动生成 XPath,方便脚本的编写和生成。查看AppInspector用法

    cnpm install app-inspector -g
    

    然后下载appium-doctor

    cnpm install -g appium-doctor
    

    看这里小孩子(点击蓝色字体) 推荐! 还可以选择下载Appium-desktop安装包,打开Appium-desktop的dmg包,复制Appium.app到Applications文件夹中,即完成安装。

    然后我发现我按两个Appium 一个叫appium 一个叫appium 2结果悲剧了,出了些小麻烦,解决办法是将 appium 2=>appium2空格去掉完美

    上面的要下载(下载完后来发现没什么用哈哈)

    这里比较诡异 往后看看

    配置appium-xcuitest-driver

    安装完了需要配置下路径

    cd /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
    

    不出意外又报错了哈哈

     admin@zhiqiang ~ cd /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
    cd: no such file or directory: /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
    

    发现路径不一样哈哈耗时老久了,伤心
    修改下路径发现也不行 ---算了先不弄了( 该文章第八条我没弄

    后来我研究了下上面的教程就是为了执行个脚我找了下就在这个位置本/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-youiengine-driver/node_modules/appium-webdriveragent然后cd下

    执行

     admin@zhiqiang /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-youiengine-driver/node_modules/appium-webdriveragent sh ./Scripts/bootstrap.sh
    

    我太聪明了哈哈 然后发现又不对哈哈,真尼玛刺激
    在沉思之后我发现文档你妈写错了,算了我原谅你了,
    目前我觉得的:正确流程应该是
    下载WebDriverAgent https://github.com/facebookarchive/WebDriverAgent
    执行然后将文件挪到他的那个目录下

    结果

    > web-driver-inspector@1.0.0 build /Users/admin/Downloads/WebDriverAgent-master/Inspector
    > webpack --progress --colors
    
    Hash: 48970279c4bb77165fd3
    Version: webpack 1.15.0
    Time: 1909ms
           Asset    Size  Chunks             Chunk Names
    inspector.js  876 kB       0  [emitted]  main
       [0] multi main 28 bytes {0} [built]
        + 229 hidden modules
    Done
    

    参考链接:
    Appium 1.6.5 and ios 10.3.3 真机测试
    WebDriverAgent 天坑记
    iOS 真机如何安装 WebDriverAgent

    配置Android_HOME、JAVA_HOME
    下载Android SDK Manager推荐链接, 下载成功后,打开终端,输入cd到Android SDK的tools目录所在路径(从下载可见tools目录,将tools目录直接拖入到cd后面即可自动补全路径)
    再输入命令./android sdk,然后就

    image.png

    哈哈再来下载java点击这里,百度网盘提取码:c62d 也可去官网下太慢了就是。所以我在百度上找了个,开心

    弹出SDK Manager,如下图:


    image.png

    然后修改环境配置

    vi ~/.bash_profile
    

    添加配置HOME路径:

    export JAVA_HOME=$(/usr/libexec/java_home)
    export PATH=$JAVA_HOME/bin:$PATH
    export CLASS_PATH=$JAVA_HOME/lib
    export ANDROID_HOME=/usr/local/android-sdk-macosx
    

    执行sources命令:

    source ~/.bash_profile
    

    再次运行appium-doctor查看结果,此时:也不行开心不
    后来我有修改了配置路径

    export JAVA_HOME=$(/usr/libexec/java_home)
    export PATH=$JAVA_HOME/bin:$PATH
    export CLASS_PATH=$JAVA_HOME/lib
    export ANDROID_HOME=/Users/admin/Downloads/android-sdk-macosx
    export PATH=$PATH:$ANDROID_HOME/tools
    export PATH=$PATH:$ANDROID_HOME/platform-tools
    
    cat .bash_profile 查看配置
    echo $ANDROID_HOME打印空就是没配置好
    echo $JAVA_HOME
    

    后来找同事帮忙研究了下,他来了就好了,说什么都没改,我仔细研究了下,他是在相同终端中先执行source ~/.bash_profile 在执行appium-doctor,我后来试了下在两个终端就是不行。

    以后研究下

    到此环境我就好想是配置完了。

    相关文章

      网友评论

          本文标题:iOS自动化测试系统搭建--appuim

          本文链接:https://www.haomeiwen.com/subject/kiecgctx.html