Appium xcode8 和 ios10 升级之后的问题集中讨论帖,请勿再开贴!

恒温 · 2016年09月17日 · 最后由 lillian 回复于 2017年05月23日 · 248 次阅读
本帖已被设为精华帖!

最近升级了 xcode8 和 ios10,先说我遇到的一个问题,

  1. 使用 libimobiledevice 系列工具遇到: ERROR: Could not start service com.apple.syslog_relay.,重装即可:

    brew reinstall --HEAD libimobiledevice
    再执行 sudo chmod 777 /var/db/lockdown 注 1

  2. xcode8 移除了 UIAutomation,所以以前的 UIAutomation 那一套肯定不能用了。

[MJSONWP] Encountered internal error running command: Error: Could not find Automation.tracetemplate in any of the followinglocations /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate,/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate
at getAutomationTraceTemplatePathWithoutRetry$ (lib/xcode.js:172:9)

注 1:

Tracing failing libimobiledevice commands using opensnoop, points to /var/db/lockdown/. This directory turns out to have different permissions than those of working machines, blocking libimobiledevice from access to device plists (certificates, keys, etc). This explains why the commands work while using sudo.

This issue can only temporarily be fixed by either using chmod or repair_packages (OSX 10.11) to change the permissions back:

QA01:~$ sudo chmod 777 /var/db/lockdown
or

QA01:~$ sudo /usr/libexec/repair_packages --repair --standard-pkgs --volume /
Password:
Permissions differ on "private/var/db/lockdown", should be drwxrwxrwx , they are drwx------ .
Repaired "private/var/db/lockdown".

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

jenkins 中用 xcode 插件打包失败,提示 “Code signing is required for product type 'Application' in SDK 'iOS 10.0'”。
然而我发现 xcode8 是覆盖安装 xcode7 的,sdk 只有 iOS 10 的,而且已经默认 iOS 10,尝试在 xcode 插件的 sdk 中手动输入 iOS 10 的 sdk 路径也是无效。
现在只能换回 xcode7+iOS9.3 了

再见 UIAutomation

UIAutomation 不能用了,大家公司切走了么, appium 应该也不能用了

#3 楼 @dengwei729 据说 appium 1.6 上用 XCUITest 来代替 UIAutomation

#4 楼 @zuiniao123 我这边自动化是直接用的 UIautomation😢 , appium1.6 直接 xcuitest,我查一下

恒温 #102 · 2016年09月18日 Author

#4 楼 @zuiniao123 官方也是这样说的。

p.s macaca 已经全面支持 ios10 了。 大家可以试试看。 @xdf 快来案例下。。

xdf [该话题已被删除] 中提及了此贴 09月18日 11:17
思寒_seveniruby 将本帖设为了精华贴 09月18日 12:34

加精理由: 覆盖近期关注问题

xcuitest 支持黑盒测试么

恒温 #96 · 2016年09月18日 Author

#11 楼 @itboyst 支持,和 uiautomation 没啥差别。

#12 楼 @Lihuazhang 那去哪里选择要测试的 App 呢,貌似默认都是启动自己的工程

xcodebuild 命令打包报错

Check dependencies
BaseProject has conflicting provisioning settings. BaseProject is automatically signed, but provisioning profile InhouseTest has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor, or switch to manual signing in the project editor.
Code signing is required for product type 'Application' in SDK 'iOS 10.0'

关闭 Automatically manage signing 之后正常打包


目前是拉取新代码后通过 Shell 修改文件关闭

sed -i "" s/'ProvisioningStyle = Automatic;'/'ProvisioningStyle = Manual;'/g YourProject.xcodeproj/project.pbxproj

#1 楼 @zuiniao123
你看下完整的错误一不一样

dengweideMacBook-Pro:runScripts dengwei$ /usr/bin/instruments -w 00e630def672da63ed0bae762c3d78aebb67ea8d -t /Applications/xcode7/Xcode.app/Contents/Developer/../Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate /Users/dengwei/Documents/ios_auto/test.app -e UIASCRIPT /Users/dengwei/Documents/ios_auto/src/cases/search/aroundSearch/TC_P1_1611007.js -e UIARESULTSPATH /Users/dengwei/Documents/ios_auto/output -v
2016-09-19 10:05:58.392 instruments[452:3696] WebKit Threading Violation - initial use of WebKit from a secondary thread.
dengweideMacBook-Pro:runScripts dengwei$ 

xcode7 在 ios10 设备上,command 执行脚本,没有任何报错,大家遇到过么? 有什么法子么

92楼 已删除

#12 楼 @Lihuazhang XCUITest 怎么去测试一个已经打出 ipa 包的 app,找了百度,谷歌都没找到方法

uitesting 用了一年了,so, 转成 swift3 就完事。。嗨皮

#18 楼 @shenkai600 请教下 uitesting 截图你是怎么搞得呢

appium 1.6 beat 版本已经可以在模拟器上跑了,但是好像在真机还不行

恒温 #87 · 2016年09月20日 Author

#17 楼 @itboyst 一个已经打出 ipa 包的 app 是什么东西?

#1 楼 @zuiniao123 你切回来后,会不会报 APP installing Failed 的错误????

#21 楼 @Lihuazhang 就是没有源码的情况下,怎么去指定我要去测试的 app

#14 楼 @sanlengjingvv 经过 google 竟然搜到社区了. 我也遇到了这个问题.

#14 楼 @sanlengjingvv 这个变化十分恶心。

今天又有问题了😂
原来打包是这样指定 provison 和签名的

xcodebuild archive -workspace Project.xcworkspace -scheme Project -archivePath Project.xcarchive CODE_SIGN_IDENTITY="identity" PROVISIONING_PROFILE="11111111-1111-1111-1111-111111111111"

升级后这样没用,用了代码库中的 provision 所以报错了

Check dependencies
No profile matching 'DevelopTest' found: Xcode couldn't find a profile matching 'DevelopTest'. Install the profile (by dragging and dropping it onto Xcode's dock item) or select a different one in the General tab of the target editor.
Code signing is required for product type 'Application' in SDK 'iOS 10.0'

还是直接改文件了

sed -i ""  s/'PROVISIONING_PROFILE = ".*";'/'PROVISIONING_PROFILE = "1111111-2222-2222-1111-111111111111";'/g Project.xcodeproj/project.pbxproj
sed -i ""  s/'PROVISIONING_PROFILE_SPECIFIER = .*;'/'PROVISIONING_PROFILE_SPECIFIER = InhouseTest;'/g Project.xcodeproj/project.pbxproj
sed -i ""  s/'CODE_SIGN_IDENTITY = ".*";'/'CODE_SIGN_IDENTITY = "identity";'/g Project.xcodeproj/project.pbxproj
sed -i ""  s/'"CODE_SIGN_IDENTITY\[sdk=iphoneos\*\]" = ".*";'/'"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "identity";'/g Project.xcodeproj/project.pbxproj

xcodebuild archive -workspace Project.xcworkspace -scheme Project -archivePath Project.xcarchive

#25 楼 @skytraveler
#24 楼 @seveniruby

#26 楼 @sanlengjingvv 这苹果修改的真是任性. 看起来是变规范了. 都统一到标准的项目文件了. 按理说这个配置文件应该有对应的命令行工具直接修改

#26 楼 @sanlengjingvv

我也是 sed 修改配置文件
ProvisioningStyle = Manual 暂时解决了问题

最近临时接手,对 ios 构建还是半生不熟。发现 xcode 每次升级都要折腾我们一番。
Xcode 的这一套签名方案真够绕的,最近打算把这破玩意儿好好刷一遍,争取弄通了写一篇文章。

UIAutomation 不能用了,基于此的 monkey 测试的替换方案大家是怎么做的啊?用 EarlGrey?

上午 ci 又坏了,折腾了半天。

提供一下排查思路:
1.在 ide 上做设置,根据红色叹号做修改,然后 package,package 成功后保存工程配置文件。
2.check out 出来原来不能成功的工程配置文件,两边做比较。
3.在 ci build 前 sed 替换工程配置文件中的项。
4.目前大体看来就是 @sanlengjingvv 说的哪些项。

因为开发本地 build 和 ci 打包配置(主要是签名相关的)肯定不一样,肯定会冲掉你做的设置。所以 sed 动态修改是没有办法的办法。

@Lihuazhang
Could not find Automation.tracetemplate in any of the followinglocations
这个不行了。。就启动不了 Inspector。是换工具去查看控件吗?

#32 楼 @zq1956 appium 1.5.3 不能配合 xcode8 使用。 目前没有办法。

#30 楼 @rogergan 直接用 appium 吧,或者你用 WebDriverAgent 也行。

大赞!
整来整去把 ideviceinstaller 整坏了,用 homebrew 重新安装显示 xcode7 过时需要安装到 xcode8,更新 xcode8 后 ideviceinstaller 就不能用了.
用了楼主的方法重新安装"brew reinstall --HEAD libimobiledevice 再执行 sudo chmod 777 /var/db/lockdown"就搞定了.😍

发现在同一台机子上保留 xcode7 和 xcode8 的方法:
先将/Applications/目录下的 Xcode.app 改名为 xcode7,然后再在 app store 中升级成 xcode8,这样在 Applications 目录中就有两个 xcode 了.

@seveniruby @Lihuazhang 出了 xcode8 后,UIAutomation api 查询地址,俩位能找到么?

恒温 #69 · 2016年09月26日 Author

#38 楼 @dengwei729 直接官网没有嘛?

#39 楼 @Lihuazhang 官网没有找到,帮忙找找呗

67楼 已删除
汪汪 [该话题已被删除] 中提及了此贴 10月10日 19:30
恒温 #65 · 2016年10月10日 Author

#40 楼 @dengwei729 我也没有找到。。。

#33 楼 @Lihuazhang 那是说现在在 xcode8 和 ios10 上,appium1.5.3 已经不能用了吗?没有任何的解决方案了吗?我也是跑 case 的时候会报错 “[Xcode] Could not find Automation.tracetemplate in any of...”

62楼 已删除

使用 sudo chmod 777 /var/db/lockdown 方法没有搞定 使用 sudo /usr/libexec/repair_packages --repair --standard-pkgs --volume /就搞定了

匿名 #60 · 2016年10月12日

跟 1L 差不多报错,Xcode8 命令行打包报错,Xcode7 是正常的

Signing for "xxxx" requires a development team. Select a development team in the project editor.
Code signing is required for product type 'Application' in SDK 'iOS 10.0'

#44 楼 @rogergan 赞,你是保存了一份么,哈哈

同一套代码,可以在 uiautomation 成功运行,但是在 xcuitest 失败了,不知道什么原因。大家能帮帮忙看看是什么问题吗?https://github.com/appium/appium-xcuitest-driver/issues/235

话说现在升级到 ios10 了,大家稳定性测试怎么做的呢?

恒温 #56 · 2016年10月14日 Author

#51 楼 @dengwei729 你是说 uiautomation 的 monkey 不能跑了是吧?

#52 楼 @Lihuazhang 是的,现在 ios10 市场占有率很高了,稳定性测试需要兼容它了

恒温 #54 · 2016年10月14日 Author

#53 楼 @dengwei729 有 XCUITesting 改一套呗

#50 楼 @wenshi11019 我也遇到了同样的问题,同一套代码,在 uiautomation 成功运行,在 xcuitest 上运行失败了。Appium 的 log 中看不出什么端倪,代码报错是:An element could not be located on the page using the given search parameters。难道说用 xcuitest 时要改变 xpath 的定位路径?

恒温 #52 · 2016年10月16日 Author

#55 楼 @wanwan001 好像是听说 xpath 变了。

#27 楼 @seveniruby
减少了一部分 Shell ,换成多个 target的方式,在 xcodebuild 命令里指定不同的 Scheme ,有点像 Gradle 了。


#26 楼 @sanlengjingvv
实时替换的,希望能帮到其他人
sed -i "" "s/PROVISIONING_PROFILE = \".\";/PROVISIONING_PROFILE = \"${mobileprovision_uuid}\";/g" Project.xcodeproj/project.pbxproj
sed -i "" "s/PROVISIONING_PROFILE_SPECIFIER = .
;/PROVISIONING_PROFILE_SPECIFIER = \"${mobileProvisionOutputName}\";/g" Project.xcodeproj/project.pbxproj
sed -i "" "s/CODE_SIGN_IDENTITY = \".\";/CODE_SIGN_IDENTITY = \"${mobileCertificationOutputName}\";/g" Project.xcodeproj/project.pbxproj
sed -i "" "s/\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \".
\";/\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"${mobileCertificationOutputName}\";/g" Project.xcodeproj/project.pbxproj

在 ios10 上,使用 scrollTo 方法,结果悲剧了,appium 太贱了

自己拼的请求,报错

[JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8100/session/C4636841-6E75-4181-B828-09972EEB43CC/element] with body: {"using":"class name","value":"XCUIElementTypeTableView"}
[JSONWP Proxy] Got response with status 200: {"value":"Invalid argument for class used 'XCUIElementTypeTableView'. Did you mean XCUIElementTypeXCUIElementTypeTableView?","sessionId":"C4636841-6E75-4181-B828-09972EEB43CC","status":15}

#59 楼 @dengwei729
尝试用 swipe 方法来做:

/wd/hub/session/a07d8685-4109-48b9-8185-337da0f75c81/touch/perform {"actions":[{"action":"press","options":{"x":192,"y":467}},{"action":"wait","options":{"ms":100}},{"action":"moveTo","options":{"x":182,"y":50}},{"action":"release","options":{}}]}

大家对滑动的操作,有什么见解:

  • 下拉操作可以操作
  • 上拉 UI 反应不正常,可以说没反应

#59 楼 @dengwei729

找到原因了:
public void swipe(int startx, int starty, int endx, int endy, int duration)

endx 所传参数应该是增量
endy 所传参数应该是增量

[HTTP] --> POST /wd/hub/session/97559adb-a894-40d2-9f87-7341aac8d530/touch/perform {"actions":[{"action":"press","options":{"x":187,"y":517}},{"action":"wait","options":{"ms":300}},{"action":"moveTo","options":{"x":187,"y":50}},{"action":"release","options":{}}]}
[MJSONWP] Calling AppiumDriver.performTouch() with args: [[{"action":"press","option...
[debug] [XCUITest] Executing command 'performTouch'
[JSONWP Proxy] Proxying [POST /uiaTarget/0/dragfromtoforduration] to [POST http://localhost:8100/session/70E712D5-44E1-447B-826F-86A460A555C7/uiaTarget/0/dragfromtoforduration] with body: {"fromX":187,"fromY":517,"toX":374,"toY":567,"duration":0.3}

之前安装了 appium1.6.0-beta1,现在有了 appium1.6.0 之后想换成 1.6.0 再试试,但是安装 appium 总是报这样的错误:

wanqingyaodeMac:npm wanqingyao$ npm install -g appium
npm ERR! tar.unpack unzip error /var/folders/tf/89068tvn199bhwpk5r3hg03h0000gn/T/npm-3970-7391db21/registry.npmjs.org/appium-adb/-/appium-adb-2.6.17.tgz
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/6.9.1/bin/node" "/usr/local/bin/npm" "install" "-g" "appium"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.9
npm ERR! code Z_BUF_ERROR
npm ERR! errno -5

npm ERR! unexpected end of file
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/wanqingyao/npm/npm-debug.log

已经在 github 上提问,但是还没有收到任何回应。在网上看了一篇帖子:http://www.jianshu.com/p/f0feba219a21,按照上面的提示也没有解决问题。请教各位大神,有没有人遇到过类似的问题呢?

求帮忙啊 Appium 录制的 node.js 脚本 但是启动页滑动没用啊
该怎么改 谢谢了啊 搞定重谢😆

升级 xcode 到 8.1,升级 appium 到 1.6.0,appium-doctor 检测环境没问题。但是运行测试脚本时总是出现错误,我的测试脚本(该脚本在 appium1.5.3 上运行没问题)是:

def openApplication(self,time):
       desired_caps = {}
       desired_caps['automationName'] = 'XCUITest'
       desired_caps['appium-version'] = '1.6.0'
       desired_caps['platformName'] = 'iOS'
       desired_caps['platformVersion'] = '10.1'
       desired_caps['deviceName'] = 'iPhone SE'
       desired_caps['app'] = os.path.abspath('/Users/wanwan/Desktop/campus.app')
       self.driver=webdriver.Remote('http://0.0.0.0:4723/wd/hub',desired_caps)
       sleep(3)

self.driver=webdriver.Remote('http://0.0.0.0:4723/wd/hub',desired_caps)

这行代码总是出现如下报错:

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 417, in _read_status
    raise BadStatusLine(line)
BadStatusLine: ''

我在社区和网站上搜索了相关解决方案,问题依然无法解决。有没有遇到相同问题的伙伴,求指导。谢谢!https://testerhome.com/topics/6277https://testerhome.com/topics/729

#49 楼 @dengwei729 会用 Google 搜索很重要,机会没有找不到的资料,只要描述够清楚,哈哈哈哈哈

#35 楼 @chenhengjie123 appium 跑 monkey 测试会不会太慢了。。。。点击起来不够快

匿名 #40 · 2016年11月11日

appium 1.6 运行的时候报这个错误,是什么原因

[debug] [XCUITest] Running WebDriverAgent bootstrap script to install dependencies
[XCUITest] Error: Command '/bin/bash Scripts/bootstrap.sh -d' exited with code 1
    at ChildProcess.<anonymous> (lib/teen_process.js:66:19)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)
    at maybeClose (internal/child_process.js:850:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
 { [Error: Command '/bin/bash Scripts/bootstrap.sh -d' exited with code 1]
  stdout: '\u001b[1mFetching dependencies\n*** Downloading RoutingHTTPServer.framework binary at "v1.0.1"\n*** Downloading KissXML.framework binary at "5.0.5"\n*** Downloading peertalk.framework binary at "v1.0"\n',
  stderr: 'GitHub API request failed: NetworkError(Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={NSURLSessionDownloadTaskResumeData=<CFData 0x7f8269676390 [0x7fffd0690bd0]>{length = 7098, capacity = 16384, bytes = 0x3c3f786d6c2076657273696f6e3d2231 ... 2f706c6973743e0a}, NSErrorFailingURLKey=https://github-cloud.s3.amazonaws.com/releases/59389292/401b6b1c-1fca-11e6-8897-2cf41b29192a.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20161111%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20161111T063628Z&X-Amz-Expires=300&X-Amz-Signature=409ec20d0408341bc2e993da316507774aea88dfe0c627bf043f32c149f45477&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3DRoutingHTTPServer.framework.zip&response-content-type=application%2Foctet-stream, _kCFStreamErrorDomainKey=4, NSLocalizedDescription=The request timed out., NSErrorFailingURLStringKey=https://github-cloud.s3.amazonaws.com/releases/59389292/401b6b1c-1fca-11e6-8897-2cf41b29192a.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20161111%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20161111T063628Z&X-Amz-Expires=300&X-Amz-Signature=409ec20d0408341bc2e993da316507774aea88dfe0c627bf043f32c149f45477&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3DRoutingHTTPServer.framework.zip&response-content-type=application%2Foctet-stream, NSUnderlyingError=0x7f8269632f10 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, _kCFStreamErrorCodeKey=-2102})\n',
  code: 1 }
[XCUITest] Shutting down WebDriverAgent
[debug] [XCUITest] Reset not set, not ending sim
[debug] [iOSLog] Stopping iOS log capture
[MJSONWP] Encountered internal error running command: Error: Command '/bin/bash Scripts/bootstrap.sh -d' exited with code 1
    at ChildProcess.<anonymous> (lib/teen_process.js:66:19)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)
    at maybeClose (internal/child_process.js:850:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
[HTTP] <-- POST /wd/hub/session 500 92921 ms - 199 

#67 楼 @rogergan 和机器性能关系很大。SE 上很流畅,5S 就比较卡。不过其实 monkey 速度快慢倒问题不大,关键是支持了一台 mac 带多台 iPhone 并行运行了,节省了不少成本。

#69 楼 @chenhengjie123 哇塞,可以做到一台 mac 拖多台 iPhone?

#70 楼 @rogergan 因为和 UIAutomation 属于 instruments 的一部分不同,WDA 是通过 xcodebuild 命令启动的,而 xcodebuild 是可以多开的。

PS:不要歪楼了。。。这个帖子主要说 Xcode 8 和 iOS 10

@Tank007 这个问题解决了嘛?我也遇到了类似问题

#68 楼 @Tank007 这个问题已经解决,主要是 webdriveragent 下载依赖时,由于没有,导致一些依赖下载不下来,lantern后,再次运行问题解决

或者,也可以直接到 appium 安装目录下的 appium-xcuitest-driver -->webDriverAgent ,运行命令./Scripts/bootstrap.sh,来下载依赖

一定要先 *** 呃

@Lihuazhang
capabilities.setCapability("automationName", "XCUITest"); 报错:

raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: A new session could not be created. Details: The desiredCapabilities object was not valid for the following reason(s): automationName XCUITest not part of Appium,Selendroid,WebDriverAgent.

恒温 #33 · 2016年11月21日 Author

#74 楼 @miaomiao413 看出错日志呀。

匿名 #32 · 2016年11月21日

#73 楼 @nanccy 嗯,是的,我也是 *** 后解决的

@Lihuazhang 只有这些日志没看出啥

[BaseDriver] SessionNotCreatedError: A new session could not be created. Details: The desiredCapabilities object was not valid for the following reason(s): automationName XCUITest not part of Appium,Selendroid,WebDriverAgent.
at IosDriver.validateDesiredCaps (lib/basedriver/driver.js:120:25)
at IosDriver.validateDesiredCaps (lib/driver.js:40:16)
at IosDriver.callee$0$0$ (lib/basedriver/commands/session.js:14:8)
at tryCatch (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at invoke (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at enqueueResult (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
at new Promise (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:197:7)
at AsyncIterator.enqueue (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
at AsyncIterator.prototype.(anonymous function) as next
at Object.runtime.async (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
at IosDriver.callee$0$0 as createSession
at IosDriver.createSession$ (lib/driver.js:40:16)
at tryCatch (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at invoke (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at enqueueResult (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
at new Promise (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:197:7)
at AsyncIterator.enqueue (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
at AsyncIterator.prototype.(anonymous function) as next
at Object.runtime.async (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
at IosDriver.createSession (lib/driver.js:110:19)
at AppiumDriver.createSession$ (lib/appium.js:121:43)
at tryCatch (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js💯2
[HTTP] <-- POST /wd/hub/session 500 134 ms - 241

1)
at invoke (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at enqueueResult (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
at new Promise (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:197:7)
at AsyncIterator.enqueue (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
at AsyncIterator.prototype.(anonymous function) as next
at Object.runtime.async (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
{ [SessionNotCreatedError: A new session could not be created. Details: The desiredCapabilities object was not valid for the following reason(s): automationName XCUITest not part of Appium,Selendroid,WebDriverAgent.] jsonwpCode: 33 }

恒温 #30 · 2016年11月21日 Author

automationName XCUITest not part of Appium,Selendroid,WebDriverAgent

@Lihuazhang 看到这个错误是不知道怎么解决,1.6 按照 “Appium 1.6 ios 无缝升级 “装好了

#58 楼 @joliylee
#26 楼 @sanlengjingvv

改这一行的不起作用 CODE_SIGN_IDENTITY[sdk=iphoneos*],不过不影响打包,想搞清楚这用替换内容中有双引号的该怎么替换,试过很多次改不过来这一行

#80 楼 @Chihpin

把你的命令贴出来呀,我这样双引号没影响

sed -i ""  s/'"CODE_SIGN_IDENTITY\[sdk=iphoneos\*\]" = ".*";'/'"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: SHANGHAI TESTER HOME GROUP CO., LTD.";'/g Testerhome.xcodeproj/project.pbxproj

#20 楼 @gavingao 1.6beta 版 for mac 哪里下?githtub 下源码吗?

driver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIAButton[1]")).click();

org.openqa.selenium.WebDriverException: org.openqa.selenium.remote.JsonException: JSON command: Parameters were incorrect. We wanted {"required":["using","value"]} and you sent []

而且一分钟左右模拟器就会重启不知道为什么,求大神

#54 楼 @Lihuazhang 目前有基于 XCUITesting 的 monkey 方案吗?有没有好的开源 xcode8 上的稳定性测试工具?

我用 xcrun simctl install booted +app 路径 把 app 安装到 xcode 模拟器上 结果总是报错:
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.

恒温 #22 · 2016年12月22日 Author

#85 楼 @lynn_qin adb devices 是找 android 的。 xcrun simctl install booted +app 路径是 ios,哥们你到底在测试啥?

21楼 已删除
20楼 已删除

#86 楼 @Lihuazhang iOS 请忽略 adb devices

已解决。。。是我装错了 app

Testing failed:

[Xcode] Signing for "WebDriverAgentRunner" requires a development team. Select a development team in the project editor.
Code signing is required for product type 'UI Testing Bundle' in SDK 'iOS 10.0'
** TEST FAILED **

xcode 8 appnium 1.6.1 ,确认都已经签名,WebDriverAgentRunner 下也已经签名。。但一直报这个错,其他人有遇到过吗

#91 楼 @huhutouch 你这个问题解决了吗?

#54 楼 @Lihuazhang 能给个能用的指导文档吗?现在 ios10 的 monkey 测试还没搞定

#84 楼 @jira 同求 ios10 monkey 测试方案,谢谢

#69 楼 @chenhengjie123 有支持 ios10 的 monkey 方案吗?

恒温 回复

这个 swiftmonkey 搞起来有点复杂,我在网上找了一个简单的,也是用 swift 跑 monkey,就是效率很低,点击几乎是完全随机的,有效点击太少,而且一段出错就无法再次启动,而且要源码,想用 appium 自己写个自动化脚本跑 monkey,现在卡在环境搭建上,之前用 appium1.5.x,环境用例是可以正常跑起来的

10楼 已删除

报错如下:

16:40:19.737 xcodebuild[81666:1571339] Launching with Xcode.IDEFoundation.Launcher.PosixSpawn
16:40:19.739 xcodebuild[81666:1571339] Initializing test infrastructure.
16:40:19.928 xcodebuild[81666:1571354] Creating the test bundle connection.
16:40:19.928 xcodebuild[81666:1571354] Listening for proxy connection request from the test bundle (all platforms)
16:40:19.928 xcodebuild[81666:1571354] Resuming the connection.
16:40:19.929 xcodebuild[81666:1571354] Test connection requires daemon assistance.
16:40:19.929 xcodebuild[81666:1571339] Starting test session with ID 72A0A106-1EC4-46C0-8DC8-044AF948BD6D
16:40:19.929 xcodebuild[81666:1571339] Checking test manager availability..., will wait up to 120s
16:40:19.954 xcodebuild[81666:1571339] Test operation failure: Test operation was canceled.
16:40:19.954 xcodebuild[81666:1571339] _finishWithError:Error Domain=IDETestOperationsObserverErrorDomain Code=3 "Test operation was canceled." UserInfo={NSLocalizedDescription=Test operation was canceled.} didCancel: 1
momoko 回复

同问,这个问题解决了吗

Wang 回复

依赖我已经下载了,但是报 WebDriverAgent 需要一个 team,然后就用自己的 apple id 重新编译了下,现在还是报错,提示 profile 问题,怎么破?

2017-03-09 07:23:51:463 - [Xcode] 2017-03-09 15:23:51.462 xcodebuild[93169:1983424] Connection peer refused channel request for "dtxproxy:XCTestManager_IDEInterface:XCTestManager_DaemonConnectionInterface"; channel canceled <DTXChannel: 0x7fdd86a6e980>

2017-03-09 07:23:51:463 - [Xcode] Code signing is required for product type 'UI Testing Bundle' in SDK 'iOS 10.2'
Code signing is required for product type 'UI Testing Bundle' in SDK 'iOS 10.2'

2017-03-09 07:23:51:464 - [Xcode] 

2017-03-09 07:23:51:466 - [Xcode] 
Testing failed:
    No profiles for 'com.facebook.WebDriverAgentRunner' were found:  Xcode couldn't find a provisioning profile matching 'com.facebook.WebDriverAgentRunner'.
    Code signing is required for product type 'UI Testing Bundle' in SDK 'iOS 10.2'
** TEST FAILED **


The following build commands failed:
    Check dependencies
(1 failure)
Jackey 回复

原文 “Go to your appium installed path and go node_modules/appium-xcuitest-driver/WebDriverAgent and run bash Scripts/bootstrap.sh -d”
即在 WebDriverAgent 的目录下单独运行 $bash Scripts/bootstrap.sh -d
如果还是不行
$brew uninstall carthage(bin 里的 carthage 软链也要删掉)
$brew install carthage
$bash Scripts/bootstrap.sh -d

lightlymood 回复

请问问题解决了吗?我是 Android 自动化也遇到了相同问题

Code signing is required for product type 'UI Testing Bundle' in SDK 'iOS 10.3'
Code signing is required for product type 'UI Testing Bundle' in SDK 'iOS 10.3'

Testing failed:
Signing for "WebDriverAgentRunner" requires a development team. Select a development team in the project editor.
Code signing is required for product type 'UI Testing Bundle' in SDK 'iOS 10.3'
Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/lillian/Library/Developer/Xcode/DerivedData/WebDriverAgent-cugadjxaiofygzgpwawfegxnduse/Logs/Test/57EE696B-0562-4594-8B40-65E6937EA3CC/Session-WebDriverAgentRunner-2017-05-23_090536-eJNiMH.log
** TEST FAILED **

谁遇到过这个问题吗

huhu 回复

请问你的问题解决了吗

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