基于新电脑刚激活后的环境部署

一、安装xcode

安装完xcode后登录,一直按照步骤到进入xcode的首页

二、安装xcode-select

xcode-select --install

 

在安装很多内容时,会提示一大串内容,安装xcode-select后就可以正常安装了

例如提示内容如下

Xcode and Apple SDKs Agreement

PLEASE SCROLL DOWN AND READ ALL OF THE FOLLOWING TERMS AND CONDITIONS CAREFULLY BEFORE USING THE APPLE SOFTWARE OR APPLE SERVICES. THIS IS A LEGAL AGREEMENT BETWEEN YOU AND APPLE. IF YOU AGREE TO BE BOUND BY ALL OF THE TERMS AND CONDITIONS, CLICK THE “AGREE” BUTTON. BY CLICKING “AGREE” OR BY DOWNLOADING, USING OR COPYING ANY PART OF THIS APPLE SOFTWARE OR USING ANY PART OF THE APPLE SERVICES, YOU ARE AGREEING ON YOUR OWN BEHALF AND/OR ON BEHALF OF YOUR COMPANY OR ORGANIZATION TO THE TERMS AND CONDITIONS STATED BELOW. IF YOU DO NOT OR CANNOT AGREE TO THE TERMS OF THIS AGREEMENT, YOU CANNOT USE THIS APPLE SOFTWARE OR THE APPLE SERVICES. DO NOT DOWNLOAD OR USE THIS APPLE SOFTWARE OR APPLE SERVICES IN THAT CASE.

1. Definitions

Whenever capitalized in this Agreement:

“Agreement” means this Xcode and Apple SDKs Agreement.

“Apple” means Apple Inc., a California corporation with its principal place of business at One Infinite Loop, Cupertino, California 95014, U.S.A.

“Apple Developer Program License Agreement” means a separate agreement that may be entered into between You and Apple regarding the development and submission of Applications to the App Store for approval and digital signing by Apple, development of libraries for iOS, watchOS, iPadOS, and/or tvOS, and the use of Apple services such as the Apple Push Notification Service, In-App Purchase, and iCloud, among other things.

“Apple Maps Service” means the mapping platform and Map Data provided by Apple via the MapKit API and/or the Apple Maps Server API (which are the documented API that enable You to add mapping features or functionality to Applications).

“Apple Services” or “Services” means the developer services that Apple provides to You under this Agreement solely for use with Your Applications and not for use by You as an end-user (e.g., Game Center, Apple Maps Service, any Apple-certificate issuance services, etc.), including any Updates thereto (if any) that may be provided to You by Apple.

“Apple Software” means the Xcode Developer Tools and the Apple SDKs, including any Updates thereto (if any) that may be provided to You by Apple.

Software License Agreements Press 'space' for more, or 'q' to quit

三、安装brew

采用国内源进行安装会比较顺利

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

四、安装node

到node官网下载地址下载自己想要的版本:node官网下载地址

下载后双击pkg后缀的文件,弹出安装界面后一直点继续即可

五、安装Java

官网下载地址:Java安装包下载地址

六、安装appium

到官网下载

七、安装cnpm

使用sudo权限,否则可能会提示权限问题

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

八、安装ios-deploy

先设置这两条这令,否则会提示

fatal: not in a git directory

Error: Command failed with exit 128: git

指令:

git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core

git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask

安装指令

brew install ios-deploy

九、安装其他依赖

安装libimobiledevice

指令:brew install --HEAD bilimobiledevice

安装carthage

指令brew install carthage

十、安装WebDriverAgent到手机

xcode安装WebDriverAgent到iPhone上

WebDriverAgent源码地址:appium的WebDriverAgent源码地址

可以直接到git上下载源码,也可以使用命令行将代码clone到本地。PS:建议到官网下载源码,本人试过git指令clone下来的在执行时候会提示编码异常

git clone https://github.com/facebook/WebDriverAgent.git

使用xcode打开WebDriverAgent.xcodeproj文件

前提条件:需要具备苹果开发者账号,目前是需要充钱开通了

1、勾选上Automatically manage signing

2、选择Team

3、Bundle Identifier可以直接在默认的后面追加一个唯一标识,因为Bundle Identifier需要时唯一的才可用,可以到网页上生成一个uuid,com.facebook.WebDriverAgentLib.xxx

在线生成uuid工具网址:UUID在线生成器

配置WebDriverAgentLib

配置WebDriverAgentRunner

Bundle Identifier与在WebDriverAgentLib配置的一样

配置IntegrationApp

Bundle Identifier与在WebDriverAgentLib配置的一样

十一、python安装weditor

pip install weditor

十二、安装tidevice

安装完成后输入tidevice version测试下是否安装成功

可能会出现的问题是tidevice命令不存在

vi ~/.zshrc

然后将如下内容输入到.zshrc文件中

export PATH="/usr/local/bin:$PATH"

按Esc,输入wq保存并退出

执行

source ~/.bash_profile

brew install tidevice

pip install tidevice

十三、python安装依赖库

pip install pygame==2.1.3.dev8

pip install --upgrade setuptools

十四、使用pip install -r requirement.txt报错

报错内容如下

with exit status 1

[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

ERROR: Failed building wheel for numpy

Failed to build numpy

ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects

[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.

│ exit code: 1

╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

处理方式TODO

精彩链接

评论可见,请评论后查看内容,谢谢!!!评论后请刷新页面。