【Mac + Python3.6 + ATX基於facebook-wda】之IOS自動化(一):WebDriverAgent安裝

 此篇介紹如何安裝WebDriverAgent,下一篇介紹facebook-wda庫的安裝使用以及自動化腳本的開發

 前言:

對於iOS的應用的測試,若是不須要用到圖像識別,推薦使用這個項目facebook-wda

 

目錄:

 

1、前提準備條件             返回目錄

環境配置css

  1. MacOs
  2. Xcode(建議更新爲最新版本)
  3. npm
  4. carthage

 

安裝npm和Carthage

 
 
# 安裝 node
brew install node
# 查看npm版本
npm -v

6.2.0

  # 安裝Carthage:html

brew install Carthage

# 若是隻是更新請輸入
brew upgrade carthage

注:若是用brew安裝十分的慢,採用國內鏡像

# 長期替換(建議使用此項配置)  
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles'>>   ~/.bash_profile    #執行.bash_profile腳本讓配置即時生效
source ~/.bash_profile 

參考:《Homebrew更換國內鏡像提高下載速度java

從github中克隆WebDriverAgent項目

cd到自定義的文件夾下下載:node

git clone https://github.com/facebook/WebDriverAgent
Cloning into 'WebDriverAgent'... remote: Enumerating objects: 18281, done. remote: Total 18281 (delta 0), reused 0 (delta 0), pack-reused 18281 Receiving objects: 100% (18281/18281), 15.61 MiB | 52.00 KiB/s, done. Resolving deltas: 100% (6909/6909), done.

*運行初始化腳本python

首先須要先進入到WebDriverAgent項目的根目錄下react

# 進入到WDA 根目錄
cd WebDriverAgent/

# 運行初始化腳本
./Scripts/bootstrap.sh

 

Fetching dependencies Please update to the latest Carthage version: 0.31.1. You currently are on 0.30.1
*** Checking out RoutingHTTPServer at "v1.0.1"
*** Cloning RoutingHTTPServer *** xcodebuild output can be found in /var/folders/gf/jjhn56c97293xtjvtwlnwr8h0000gp/T/carthage-xcodebuild.RROZOv.log *** Downloading RoutingHTTPServer.framework binary at "v1.0.1" Building Inspector Creating bundle directory... Fetching Inspector dependencies... npm WARN deprecated css-list@0.1.3: Deprecated. npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated browserslist@0.4.0: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. > fsevents@1.2.4 install /Users/zhan/Desktop/mine/Stu資料/Git/WebDriverAgent/Inspector/node_modules/fsevents > node install [fsevents] Success: "/Users/zhan/Desktop/mine/Stu資料/Git/WebDriverAgent/Inspector/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" already installed Pass --update-binary to reinstall or --build-from-source to recompile npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN react-dom@15.6.2 requires a peer of react@^15.6.2 but none is installed. You must install peer dependencies yourself. npm WARN web-driver-inspector@1.0.0 No repository field. added 759 packages from 536 contributors and audited 2620 packages in 69.318s found 9 vulnerabilities (4 low, 4 high, 1 critical) run `npm audit fix` to fix them, or `npm audit` for details Validating Inspector Building Inspector... > web-driver-inspector@1.0.0 build /Users/zhan/Desktop/mine/Stu資料/Git/WebDriverAgent/Inspector > webpack --progress --colors Hash: 0acdc7e8b3b0d143afc5 Version: webpack 1.15.0 Time: 7085ms Asset Size Chunks Chunk Names inspector.js 862 kB       0 [emitted] main [0] multi main 28 bytes {0} [built] + 226 hidden modules Done

2、證書配置               返回目錄

一、Xcode打開WebDriverAgent目錄下的WebDriverAgent.xcodeproj文件。webpack

(1)按照下面圖的步驟依次執行點擊,先配置WebDriverAgentLibios

 

(2)按照下面圖的步驟依次執行點擊,再配置WebDriverAgentRunnergit

可是會提示問題:github

The app ID "com.facebook.WebDriverAgentRunner" cannot be registered to your development team. Change your bundle identifier to a unique string to try again.

 

請進入WebDriverAgentRunner -> Build Settings設置中,找到Packaging中的選項,將其內容修改成惟一識別的字符串,以下圖所示

 

不報錯了:

3、運行與測試            返回目錄

一、iphone手機鏈接Mac,並添加信任

設置=》通用=》設備管理=》開發者應用=》驗證應用

二、選擇Product->Destination->你的設備

 

三、選擇Product->Scheme->WebDriverAgentRunner

 四、而後進行運行,Product中選擇test

 

 運行後會提示輸入密碼:

 

一直輸入密碼,直到它不提示爲止,此密碼應該爲登陸密碼。

參考文章:《codesign 想要訪問您的鑰匙串中的密鑰

========================================

(2019.12.28更新)

這款iPhone 6s Plus運行的是iOS 12.1(16B92),這個版本的Xcode可能不支持它。

 

提示當前的xcode版本不支持IOS12.1,我當前的xcode是10,手機是12.1.
解決辦法有兩個:
一是,更新xcode版本,若是有時間仍是建議xcode升級到最新的11吧
二是,增長xcode10中對12.4的支持包。放到設備支持路徑下。

參考文章:

IOS調試報錯「xxxx is running iOS 12.4 (16G77), which may not be supported by this version of Xcode.」

iOS 真機調試包集合 包含 iOS 12.4

①下載包地址:

iOS 真機調試包集合,包含 iOS 12,下載地址:https://pan.baidu.com/s/1lav6Xiy16lpEA9lUl16m6w 密碼: w53z

②解壓後放到路徑:

快捷鍵:command + shift +G

拷貝到路徑:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/

 

 重啓xcode,從新鏈接手機。

還會報錯:

Verify the Developer App certificate for your account is trusted on your device. Open Settings on iPhone6sPlus and navigate to General -> Profiles & Device Management, then select your Developer App certificate to trust it.

驗證您的設備上是否信任您賬戶的開發人員應用程序證書。打開iPhone6sPlus上的設置並導航到「常規」->「配置文件和設備管理」,而後選擇要信任的開發者應用證書。

 

 

 打開手機設置->通用->設備管理

 

 

========================================

可是,運行後建立成功,可是證書有問題。

 

The certificate used to sign "WebDriverAgentRunner-Runner" has either expired or has been revoked. An updated certificate is required to sign and install the application.

 

用於簽署「WebDriverAgentRunner Runner」的證書已過時或被撤銷。須要更新的證書來簽署和安裝應用程序。

 

 打開「鑰匙串訪問」,查看【個人證書】得知,原來是證書過時了。

 

 右鍵刪除此證書。

 

 

刪除證書後 ,再從新添加,以下圖

 

 再次運行Xcode,先刪除以前的運行的,Product->Clean Build Folder

 

 

此時,不出意外 WDA在手機中安裝成功,而且下面控制檯輸出下面的效果。

打開控制檯方法:選擇view->Debug Area->Activate console打開底部控制檯。

 

 而後控制檯會輸出IP地址和端口,例如:http://192.168.0.0:8100/status,輸入在瀏覽器中,

確認WDA是否運行成功。若是出現一串JSON輸出,說明WDA安裝成功了。

4、端口轉發               返回目錄

可是可能頁面刷新出不來:

# 使用--HEAD安裝最新版本
$ brew install libimobiledevice --HEAD $ iproxy 8100 8100

 可是會提示你須要更新:

Warning: libimobiledevice HEAD-26373b3_2 is already installed and up-to-date To reinstall HEAD_3, run `brew reinstall libimobiledevice` $ brew reinstall libimobiledevice

更新後:

# 運行命令後會顯示以下:
$ iproxy 8100 8100 waiting for connection

參考文章:《【轉自Testerhome】iOS 真機如何安裝 WebDriverAgent

此時瀏覽器輸入:http://localhost:8100/status ,確認WDA是否運行成功。

 

 

 而inspector的地址是http://localhost:8100/inspector, inspector是用來查看UI的圖層,方便寫測試腳本用的

 

 

 至此安裝WDA以及鏈接IOS手機成功!!!!

 

5、擴展:用命令啓動webDriverAgent(特別推薦)

參考文章:

Doris_Liu:《mac虛擬機搭建自動化環境-wda和python wda client

一、新建start.sh文件:

1)進入webDriverAgent目錄,建立start.sh文件:

# 建立文件
touch start.sh # 進入編輯模式
vi start.sh

 

2)按下鍵盤上的「i」鍵,進入編輯狀態。能夠看到命令的下方出現了「--INSERT--」字樣,表示成功進入了編輯模式。

3)輸入如下內容

# 解鎖keychain,以即可以正常的簽名應用,
PASSWORD="123"
security unlock-keychain -p $PASSWORD ~/Library/Keychains/login.keychain

# 獲取設備的UDID
UDID=$(idevice_id -l | head -n1)

# 運行測試
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination "id=$UDID" test

4)輸入完成後,按下「Esc」鍵,退出編輯模式。並在此時輸入「:wq」以退出並保存剛剛輸入的內容。

這樣就將啓動webDriverAgent的命令保存在了start.sh文件中了

5)執行start.sh文件:

①進入WebDriverAgent,若是一直保留在此路徑能夠忽略此操做
cd /xxx/xxx/WebDriverAgent 
②重置Xcode路徑,否則會報錯: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

解決辦法參考:《MAC 蘋果電腦 Xcode文件路徑》《重置Xcode路徑

 

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
③執行start.sh文件

執行下面命令時會報錯:Permission denied,就是沒有權限。

解決辦法參考:《在mac中怎麼運行.sh文件

# 修改文件start.sh 的權限,使用命令:
chmod 777 start.sh # 執行start.sh文件
./start.sh

建立成功顯示以下:

note: Using new build system note: Planning build note: Constructing build description ProcessInfoPlistFile /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentLib.framework/Info.plist /Users/zhan/Desktop/mine/Stu資料/Git/WebDriverAgent/WebDriverAgentLib/Info.plist (in target: WebDriverAgentLib) cd /Users/zhan/Desktop/mine/Stu資料/Git/WebDriverAgent builtin-infoPlistUtility /Users/zhan/Desktop/mine/Stu資料/Git/WebDriverAgent/WebDriverAgentLib/Info.plist -expandbuildsettings -format binary -platform iphoneos -requiredArchitecture arm64 -o /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentLib.framework/Info.plist ProcessProductPackaging "" /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Intermediates.noindex/WebDriverAgent.build/Debug-iphoneos/WebDriverAgentRunner.build/WebDriverAgentRunner.xctest.xcent (in target: WebDriverAgentRunner) cd /Users/zhan/Desktop/mine/Stu資料/Git/WebDriverAgent Entitlements: { "application-identifier" = "QTXY6MWF7T.com.facebook.WebDriverAgentRunner.zc1224"; "com.apple.developer.team-identifier" = QTXY6MWF7T; "get-task-allow" = 1; "keychain-access-groups" = ( "QTXY6MWF7T.com.facebook.WebDriverAgentRunner.zc1224" ); } builtin-productPackagingUtility -entitlements -format xml -o /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Intermediates.noindex/WebDriverAgent.build/Debug-iphoneos/WebDriverAgentRunner.build/WebDriverAgentRunner.xctest.xcent ProcessInfoPlistFile /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Info.plist /Users/zhan/Desktop/mine/Stu資料/Git/WebDriverAgent/WebDriverAgentRunner/Info.plist (in target: WebDriverAgentRunner) cd /Users/zhan/Desktop/mine/Stu資料/Git/WebDriverAgent builtin-infoPlistUtility /Users/zhan/Desktop/mine/Stu資料/Git/WebDriverAgent/WebDriverAgentRunner/Info.plist -expandbuildsettings -format binary -platform iphoneos -additionalcontentfile /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Intermediates.noindex/WebDriverAgent.build/Debug-iphoneos/WebDriverAgentRunner.build/ProductTypeInfoPlistAdditions.plist -requiredArchitecture arm64 -o /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Info.plist GenerateDSYMFile /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest.dSYM /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/WebDriverAgentRunner (in target: WebDriverAgentRunner) cd /Users/zhan/Desktop/mine/Stu資料/Git/WebDriverAgent /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/WebDriverAgentRunner -o /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest.dSYM PBXCp /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentLib.framework /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework (in target: WebDriverAgentRunner) cd /Users/zhan/Desktop/mine/Stu資料/Git/WebDriverAgent builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -exclude Headers -exclude PrivateHeaders -exclude Modules -exclude *.tbd -resolve-src-symlinks /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentLib.framework /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks CodeSign /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework (in target: WebDriverAgentRunner) cd /Users/zhan/Desktop/mine/Stu資料/Git/WebDriverAgent export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate Signing Identity: "iPhone Developer: shiqimai@yeah.net (X8469AR773)" Provisioning Profile: "iOS Team Provisioning Profile: com.facebook.WebDriverAgentRunner.zc1224" (e9ebe6ed-22af-4dea-9e74-7e8975c312cd) /usr/bin/codesign --force --sign 5E827A54DD3782E0E5E309A2D714E459B885A8ED --preserve-metadata=identifier,entitlements,flags --timestamp=none /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework CodeSign /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest (in target: WebDriverAgentRunner) cd /Users/zhan/Desktop/mine/Stu資料/Git/WebDriverAgent export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate Signing Identity: "iPhone Developer: shiqimai@yeah.net (X8469AR773)" Provisioning Profile: "iOS Team Provisioning Profile: com.facebook.WebDriverAgentRunner.zc1224" (e9ebe6ed-22af-4dea-9e74-7e8975c312cd) /usr/bin/codesign --force --sign 5E827A54DD3782E0E5E309A2D714E459B885A8ED --entitlements /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Intermediates.noindex/WebDriverAgent.build/Debug-iphoneos/WebDriverAgentRunner.build/WebDriverAgentRunner.xctest.xcent --timestamp=none /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest: replacing existing signature CodeSign /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app (in target: WebDriverAgentRunner) cd /Users/zhan/Desktop/mine/Stu資料/Git/WebDriverAgent export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate Signing Identity: "iPhone Developer: shiqimai@yeah.net (X8469AR773)" Provisioning Profile: "iOS Team Provisioning Profile: com.facebook.WebDriverAgentRunner.zc1224" (e9ebe6ed-22af-4dea-9e74-7e8975c312cd) /usr/bin/codesign --force --sign 5E827A54DD3782E0E5E309A2D714E459B885A8ED --entitlements /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Intermediates.noindex/WebDriverAgent.build/Debug-iphoneos/WebDriverAgentRunner.build/WebDriverAgentRunner.xctest.xcent --timestamp=none /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app: replacing existing signature Testing started on 'iPhone5s' 2018-10-18 10:30:03.605 xcodebuild[38271:11567089]  IDETestOperationsObserverDebug: Writing diagnostic log for test session to: /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Logs/Test/Test-WebDriverAgentRunner-2018.10.18_10-29-57-+0800.xcresult/1_Test/Diagnostics/WebDriverAgentRunner-FB0817B6-DB84-49E7-BF12-CF544E27BFA2/WebDriverAgentRunner-C1D7E40B-C971-46AB-B0E5-8BD193DA3092/Session-WebDriverAgentRunner-2018-10-18_103003-Jywmso.log 2018-10-18 10:30:03.605 xcodebuild[38271:11566499] [MT] IDETestOperationsObserverDebug: (A2DAA1DE-CD7B-40B0-A273-CA3C7F8A9294) Beginning test session WebDriverAgentRunner-A2DAA1DE-CD7B-40B0-A273-CA3C7F8A9294 at 2018-10-18 10:30:03.605 with Xcode 10A255 on target 📱<DVTiOSDevice (0x7fe73d5820b0), iPhone5s, iPhone, 10.3.3 (14G60), 42ebab931b6b2d6a140b1a4f5bd55305dbfe2ff0> { deviceSerialNumber: DNPLDF3VFP6L identifier: 42ebab931b6b2d6a140b1a4f5bd55305dbfe2ff0 deviceClass: iPhone deviceName: iPhone5s deviceIdentifier: 42ebab931b6b2d6a140b1a4f5bd55305dbfe2ff0 productVersion: 10.3.3 buildVersion: 14G60 deviceSoftwareVersion: 10.3.3 (14G60) deviceArchitecture: arm64 deviceTotalCapacity: 28423372800 deviceAvailableCapacity: 22324436992 deviceIsTransient: NO ignored: NO deviceIsBusy: NO deviceIsPaired: YES deviceIsActivated: YES deviceActivationState: Activated isPasscodeLocked: NO deviceType: <DVTDeviceType:0x7fe73d621e60 Xcode.DeviceType.iPhone> supportedDeviceFamilies: ( 1 ) applications: (null) provisioningProfiles: (null) hasInternalSupport: NO isSupportedOS: YES developerDiskMountError: (null) (null) bootArgs: (null) connected: yes isWirelessEnabled: no connectionType: direct hostname: (null) bonjourServiceName: d8:96:95:69:36:71@fe80::da96:95ff:fe69:3671._apple-mobdev2._tcp.local. } (10.3.3 (14G60)) MDMCreateDeltaDirectory:1920 calling MDMDirectoryDiff with: state->old_bundle: /var/folders/gf/jjhn56c97293xtjvtwlnwr8h0000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/e93f6b18ff676e94e854b42d8d5b2894/42ebab931b6b2d6a140b1a4f5bd55305dbfe2ff0/WebDriverAgentRunner-Runner.app state->new_bundle: /Users/zhan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gqxpqcfouthzlnexjrgulyutyzkz/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app state->dst_bundle: /var/folders/gf/jjhn56c97293xtjvtwlnwr8h0000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.M5GL54/WebDriverAgentRunner-Runner.app_sparse.ipa/Payload//WebDriverAgentRunner-Runner.app, binaryDiff flag: FALSE dst_ipa: /var/folders/gf/jjhn56c97293xtjvtwlnwr8h0000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.M5GL54/WebDriverAgentRunner-Runner.app_sparse.ipa MDMDirectoryDiff_block_invoke:1473 calling writeDictToFile with: /var/folders/gf/jjhn56c97293xtjvtwlnwr8h0000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.M5GL54/WebDriverAgentRunner-Runner.app_sparse.ipa/ManifestCache.plist writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/gf/jjhn56c97293xtjvtwlnwr8h0000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.M5GL54/WebDriverAgentRunner-Runner.app_sparse.ipa/ManifestCache.plist 2018-10-18 10:30:14.316962+0800 WebDriverAgentRunner-Runner[3607:780184] Running tests... 2018-10-18 10:30:15.384715+0800 WebDriverAgentRunner-Runner[3607:780184] Continuing to run tests in the background with task ID 1 Test Suite 'All tests' started at 2018-10-18 10:30:15.575 Test Suite 'WebDriverAgentRunner.xctest' started at 2018-10-18 10:30:15.584 Test Suite 'UITestingUITests' started at 2018-10-18 10:30:15.587 Test Case '-[UITestingUITests testRunner]' started. t =     0.00s Start Test at 2018-10-18 10:30:15.592 t =     0.01s Set Up 2018-10-18 10:30:15.617816+0800 WebDriverAgentRunner-Runner[3607:780184] Built at Oct 16 2018 10:18:37
2018-10-18 10:30:15.670584+0800 WebDriverAgentRunner-Runner[3607:780184] ServerURLHere->http://192.168.3.63:8100<-ServerURLHere
View Code

6)最後,必定要轉發接口:

iproxy 8100 8100

7)輸入:http://localhost:8100/status,成功的話會顯示json。

命令行啓動WDA完畢!!!!

 

最終彙總: 命令行啓動WDA ① cd Desktop/m/S/Git/WebDriverAgent/ ./start.sh ②iproxy 8100 8100

 

6、附:感謝文章             返回目錄

彙總:

很是感謝:

codeskyblue的文章:《ATX ATX 文檔 - iOS 真機如何安裝 WebDriverAgent》 

Nuanyang2333的文章:《課前準備——WebDriverAgent 安裝

碧霄問鼎的文章:《Xcode由於證書問題常常報的那些錯

奔狼的春曉的文章:《IOS調試報錯「xxxx is running iOS 12.4 (16G77), which may not be supported by this version of Xcode.」

====================================================

以及其餘暫時還沒用到的文章:

yxys01的文章:《WebDriverAgent 天坑記

wonderfei的文章:《基於Facebook-WDA的iOS-UI自動化測試

Winnie_zi 的文章:《iOS 自動化—wda 搭建流程

相關文章
相關標籤/搜索