开源测试工具 FastMonkey iOS11 踩坑记

孟德功 · 2017年10月11日 · 最后由 对酒当歌 回复于 2019年08月07日 · 2715 次阅读

*升级 Xcode9 和 iOS11 后很多工具都受到了不同程度的影响, FastMonkey 也不例外, 踩着坑已经走过来特此写一个帖子以作备忘😫 *
Fastmonkey
https://github.com/zhangzhao4444/Fastmonkey

首次安装的同学可以参考@yxys01发的扫盲帖
(https://testerhome.com/topics/9810)

*问题一: * 由于升级 Mac10.13 后, 使用 ideviceinstaller -l 会提示 Could not connect to lockdownd. Exiting. 执行 Monkey 后也会提示以下错误

解决方法:

brew uninstall ideviceinstaller
brew uninstall libimobiledevice
brew install --HEAD libimobiledevice
brew link --overwrite libimobiledevice
brew install ideviceinstaller
brew link --overwrite ideviceinstaller

*问题二: *部分文件需要手动添加到项目中 (必须执行的)

cd /Users/*******/Desktop/Fastmonkey/XCTestWD-master/XCTestWD 
打开 XCTestWD.xcodeproj
cd /XCTestWDUITests/server
将XCTestWDMonkey.swift文件拖拽到Xcode中的server文件下

cd /Users/*******/Desktop/Fastmonkey/XCTestWD-master/XCTestWD 
打开 XCTestWD.xcodeproj
cd /XCTestWDUITests/PrivateHeaders
将XCTestWDApplication.m和XCTestWDApplication.m文件拖拽到Xcode中的PrivateHeaders文件下 

*问题三: *(这个问题必须建立在问题二已经操作过后的情况下)

需要在 XCTestWDUITests-Bridging-Header.h 文件中添加


#import "XCTestWDApplication.h"

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 12 条回复 时间 点赞

先赞后实践~👏 👍 👍

测试大头兵 fastmonkey 自我扫盲贴 中提及了此贴 10月19日 17:50
烟消云散 [该话题已被删除] 中提及了此贴 10月19日 18:40
烟消云散 fastmonkey 自我扫盲贴 中提及了此贴 10月19日 18:44

👍 👍 写的很好,只是 Markdown 的格式存在一定的问题,修改一下肯定能帮助更多的朋友

XCTestWDMonkey.swift 这个文件在哪 找不到了...

左侧选择 server 文件夹,File->Add Files to "XCTestWD"->XCTestWDMonkey.swift->add

PhaseScriptExecution Run\ Script /Users/min/Library/Developer/Xcode/DerivedData/XCTestWD-cdhrejtailslktczrbnqaylvvwyv/Build/Intermediates.noindex/XCTestWD.build/Debug-iphoneos/XCTestWD.build/Script-63D408691EAB64FC00198736.sh
(1 failure)

有谁知道吗? 执行第 2 个命令,老是报错,但没有具体信息

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

Ron 回复

在 XCTestWD.XCTestWD 这个后边加一个后缀,因为你的 appleid 注册了别的项目被占用了

he following build commands failed:
CompileSwift normal arm64 /Users/ocean/Fastmonkey/XCTestWD-master/XCTestWD/XCTestWDUITests/server/controllers/Random.swift
CompileSwift normal arm64 /Users/ocean/Fastmonkey/XCTestWD-master/XCTestWD/XCTestWDUITests/server/controllers/XCTestWDSessionController.swift
CompileSwift normal arm64 /Users/ocean/Fastmonkey/XCTestWD-master/XCTestWD/XCTestWDUITests/server/controllers/XCTestWDMonkeyController.swift
CompileSwift normal arm64 /Users/ocean/Fastmonkey/XCTestWD-master/XCTestWD/XCTestWDUITests/server/controllers/XCTestWDTitleController.swift
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(5 failures)

帮忙看看这些错误,按你上面的问题二和问题三的方法已经移动文件了,还是不行

另外我的 xcode 的工程里好几处这个错误,也做了桥接,在 XCTESTWDUiTest-Briding-header.h 文件里
#import "XCTestWDApplication.h"
#import "XCTestWDApplication.m"
#import "CDStructures.h"
#import "XCUIElementQuery.h"
#import "XCUIElement.h"
#import "XCElementSnapshot.h"
#import "XCAXClient_iOS.h"
#import "XCUIApplication.h"
#import "XCAccessibilityElement.h"
#import "XCTestPrivateSymbols.h"
#import "XCUICoordinate.h"
#import "XCTestDriver.h"
#import "XCTestDaemonsProxy.h"
#import "XCTRunnerDaemonSession.h"
#import

还是没效果,我 xcode 用的 9.4.1 版本,请问有方法解决吗

wanglei 回复

您好请问问题解决了么,也遇到了同样的问题


这个问题有人遇到没😂

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册