此篇介紹如何安裝WebDriverAgent,下一篇介紹facebook-wda庫的安裝使用以及自動化指令碼的開發。
前言:
對於iOS的應用的測試,如果不需要用到影像識別,推薦使用這個專案facebook-wda
目錄:
一、前提準備條件 返回目錄
環境配置
- MacOs
- Xcode(建議更新為最新版本)
- npm
- carthage
安裝npm和Carthage
# 安裝 node
brew install node
# 檢視npm版本
npm -v
6.2.0
# 安裝Carthage:
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更換國內映象提升下載速度》
從github中克隆WebDriverAgent專案
cd到自定義的資料夾下下載:
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.
*執行初始化指令碼
首先需要先進入到WebDriverAgent專案的根目錄下
# 進入到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
二、證照配置 返回目錄
1、Xcode開啟WebDriverAgent目錄下的WebDriverAgent.xcodeproj檔案。
(1)按照下面圖的步驟依次執行點選,先配置WebDriverAgentLib:
(2)按照下面圖的步驟依次執行點選,再配置WebDriverAgentRunner:
但是會提示問題:
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中的選項,將其內容修改為唯一識別的字串,如下圖所示
不報錯了:
三、執行與測試 返回目錄
1、iphone手機連線Mac,並新增信任
設定=》通用=》裝置管理=》開發者應用=》驗證應用
2、選擇Product->Destination->你的裝置
3、選擇Product->Scheme->WebDriverAgentRunner
4、然後進行執行,Product中選擇test
執行後會提示輸入密碼:
一直輸入密碼,直到它不提示為止,此密碼應該為登入密碼。
參考文章:《codesign 想要訪問您的鑰匙串中的金鑰》
但是,執行後建立成功,但是證照有問題。
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安裝成功了。
四、埠轉發 返回目錄
但是可能頁面重新整理出不來:
# 使用--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手機成功!!!!
五、擴充套件:用命令啟動webDriverAgent(特別推薦)
參考文章:
Doris_Liu:《mac虛擬機器搭建自動化環境-wda和python wda client》
1、新建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
6)最後,一定要轉發介面:
iproxy 8100 8100
7)輸入:http://localhost:8100/status,成功的話會顯示json。
命令列啟動WDA完畢!!!!
最終彙總: 命令列啟動WDA ① cd Desktop/m/S/Git/WebDriverAgent/ ./start.sh ②iproxy 8100 8100
六、附:感謝文章 返回目錄
彙總:
非常感謝:
①codeskyblue的文章:《ATX ATX 文件 - iOS 真機如何安裝 WebDriverAgent》
②Nuanyang2333的文章:《課前準備——WebDriverAgent 安裝》
③碧霄問鼎的文章:《Xcode因為證照問題經常報的那些錯》
====================================================
以及其他暫時還沒用到的文章:
③yxys01的文章:《WebDriverAgent 天坑記》
④wonderfei的文章:《基於Facebook-WDA的iOS-UI自動化測試》
⑤Winnie_zi 的文章:《iOS 自動化—wda 搭建流程》