Macaca Macaca App Inspector 2.0 发布

xdf · 发布于 2017年05月24日 · 最后由 yjxj1ban 回复于 2017年12月14日 · 5116 次阅读
本帖已被设为精华帖!

Inspector 2.0 版本直接使用了 Macaca 新版驱动,效率和准确性有大量提升,另外录制器 UIRecorder 也请升级到最新版。

想加入并改进 Macaca Inspector,请参考 https://testerhome.com/topics/8753

$ npm i app-inspector@2 -g

发布记录

  • 由于底层驱动已替换为XCTestWD,强制升级移除
  • xpath bug修复
  • xpath 路径优化
  • 可以剪切板直接拷贝信息

项目地址:

共收到 52 条回复
2457 xdf xpath 定位元素失败 中提及了此贴 05月24日 17:39
8a79ff


升级了macaca-android 2.0.17 和app-inspector 2.0,还是不行啊,这个xpath路径有问题吧,我这个元素没有id的,直接复制这个xpath路径,运行脚本,还是找不到元素

8a79ff

找到问题了,是因为app-inspector2.0算出来的xpath路径的index前后都加了’/',如/android.widget.FrameLayout/[1]/android.widget.FrameLayout/[1],"/[1]/”,把前面的/去掉就可以了

2457 xdf [公告] App Inspector 重磅升级 中提及了此贴 05月24日 20:50
2457 xdf app-inspector 真机查看元素设置 中提及了此贴 05月24日 20:50
2457 xdf Macaca 实现 IOS Monkey 测试 (支持 macaca2.x 版本) 中提及了此贴 05月24日 20:50
104 seveniruby 将本帖设为了精华贴 05月24日 21:27
16508

之前真机上还可以查元素 升级之后不查看了 Internal Server Error

server.js:16:12 [master] pid:19234 server start with config:
{ port: 5678,
verbose: true,
udid: '5e8f56afede9e4ec04628190ca94c1d73f50dd12',
ip: '172.18.172.223',
host: 'TianXingyangdeMacBook-Pro.local',
loaded_time: '2017-05-26 17:26:09' }
app-inspector.js:43:12 [master] pid:19234 server start at: http://172.18.172.223:5678
xctest-client.js:53:14 [master] pid:19234 project path: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
xctestwd start with port: 8002
xctest-client.js:226:14 [master] pid:19234 xcode version: 8.3.2
XCTestWD version: 1.0.25
xctest-client.js:174:14 [master] pid:19234 2017-05-26 17:26:10.914 xcodebuild[19240:1184306] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/tianxingyang/Library/Developer/Xcode/DerivedData/XCTestWD-evljajykmolwzobrozpobiggeeea/Logs/Test/0AB1D74C-67D5-4046-B4E2-326667D5CE27/Session-XCTestWDUITests-2017-05-26_172610-vpbf54.log

xctest-client.js:175:14 [master] pid:19234 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:174:14 [master] pid:19234 2017-05-26 17:26:10.914 xcodebuild[19240:1184291] [MT] IDETestOperationsObserverDebug: (74000DAD-CDBB-40D5-82DC-A603A0ED9A4D) Beginning test session XCTestWDUITests-74000DAD-CDBB-40D5-82DC-A603A0ED9A4D at 2017-05-26 17:26:10.914 with Xcode 8E2002 on target {
deviceSerialNumber: C39SM0VAHG00
identifier: 5e8f56afede9e4ec04628190ca94c1d73f50dd12
deviceClass: iPhone
deviceName: iPhone 7 Plus
deviceIdentifier: 5e8f56afede9e4ec04628190ca94c1d73f50dd12
productVersion: 10.3
buildVersion: 14E277
deviceSoftwareVersion: 10.3 (14E277)
deviceArchitecture: arm64
deviceTotalCapacity: 28161949696
deviceAvailableCapacity: 7512875008
deviceIsTransient: NO
ignored: NO
deviceIsBusy: NO
deviceIsActivated: YES
deviceActivationState: Activated
isPasscodeLocked: NO
deviceType: <0x7fae3e8caab0 xcode.devicetype.iphone>
supportedDeviceFamilies: (
1
)
applications: (null)
provisioningProfiles: (null)
activityProgress: -2
activityTitle:

hasInternalSupport: NO
isSupportedOS: YES
developerDiskMountError: (null)
(null)
bootArgs:
} (10.3 (14E277))

xctest-client.js:175:14 [master] pid:19234 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:174:14 [master] pid:19234 writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/wv/1npf6k9503lgjf0jfmnzyx2r0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/0af7f3ce2b524a3c43248d6e0828b499/5e8f56afede9e4ec04628190ca94c1d73f50dd12/ManifestCache.plist

xctest-client.js:175:14 [master] pid:19234 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:174:14 [master] pid:19234 2017-05-26 17:26:28.063 xcodebuild[19240:1184291] Error Domain=IDETestOperationsObserverErrorDomain Code=6 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}

xctest-client.js:175:14 [master] pid:19234 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:174:14 [master] pid:19234
Testing failed:

xctest-client.js:175:14 [master] pid:19234 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:174:14 [master] pid:19234 Test target XCTestWDUITests encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **

xctest-client.js:175:14 [master] pid:19234 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:257:14 [master] pid:19234 killing deviceLogProc pid: 19237
xctest-client.js:262:14 [master] pid:19234 killing runnerProc pid: 19240
xctest-client.js:268:14 [master] pid:19234 killing iproxyProc pid: 19239
xctest-client.js:185:14 [master] pid:19234 xctest client exit with code: 65, signal: null
xctest-client.js:213:14 [master] pid:19234 iproxy exit with code: null, signal: SIGKILL
xctest-client.js:147:16 [master] pid:19234 deviceconsole exit with code: null, signal: SIGKILL
xctest-client.js:249:14 [master] pid:19234 Fail to start xctest: undefined
undefined
iOS device started: 5e8f56afede9e4ec04628190ca94c1d73f50dd12
inspector start at: http://172.18.172.223:5678
<-- GET /
helper.js:97:16 [master] pid:19234 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002

Error: connect ECONNREFUSED 127.0.0.1:8002
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at TCPConnectWrap.afterConnect as oncomplete

16508
16508Jashtian 回复

这个问题已解决

8210

@xdf 更新到2.0.1之后,iOS使用xpath真机定位不到

定位我图片上红色部分的地方,我把xpath复制直接使用定位不到,请问更新的2.0.1的版本,xpath是只要复制直接使用就行了吗?

13930

@xdf

//*[@name="Blued"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[4]/XCUIElementTypeButton[1]

IOS的这种xpath定位不到元素

13930

部分页面的弹框查看器找不到控件

A972e5

升级后报错,请问这是什么原因
{ Error: Command failed: D:\android-sdk/platform-tools/adb -s F1JSA02000362 push C:\Users\Summe\AppData\Roaming\npm\node_modules\app-inspector\node_modules\uiau
tomatorwd\app\build\outputs\apk\app-debug.apk /data/local/tmp/com.macaca.android.testing

at ChildProcess.exithandler (child_process.js:204:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:886:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
killed: false,
code: 1,
signal: null,
cmd: 'D:\android-sdk/platform-tools/adb -s F1JSA02000362 push C:\Users\Summe\AppData\Roaming\npm\node_modules\app-inspector\node_modules\uiautomator
wd\app\build\outputs\apk\app-debug.apk /data/local/tmp/com.macaca.android.testing' }

96
16508Jashtian 回复

这个问题是怎么解的啊

96
16508Jashtian 回复

怎么解的 啊

A972e5

@xdf

通过xpath 定位元素 执行测试的时候提示没找到该元素

3f8154

升级时报错了,已经将npm 从5.0.2升级到了5.0.2,但是升级app-inpspector到2.0的时候还是依然报错了,请问下各位大神这是为什么呢?

npm WARN deprecated win-spawn@2.0.0: use cross-spawn or cross-spawn-async instead.
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated node-uuid@1.4.7: Use uuid module instead
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/app-inspector/node_modules/xcode/node_modules/node-uuid
npm ERR! path /usr/local/lib/node_modules/app-inspector/node_modules/xcode/node_modules/node-uuid
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access '/usr/local/lib/node_modules/app-inspector/node_modules/xcode/node_modules/node-uuid'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Cherry/.npm/_logs/2017-06-04T14_14_48_539Z-debug.log

3f8154

cnpm i app-inspector@2 -g升级后, 真机(iphone6,9.3.1)执行app-inspector -u xxx --verbose 依然还是会报错 connect ECONNREFUSED

request.js:24:12 [master] pid:14975 get remote update info failed.
server.js:16:12 [master] pid:14975 server start with config:
{ port: 5678,
verbose: true,
udid: 'e1fb98775314bd9661fa9fbf3cf7c09759dc1c1b',
ip: '192.168.1.109',
host: 'cherrys-macbook.local',
loaded_time: '2017-06-04 22:20:04' }
app-inspector.js:43:12 [master] pid:14975 server start at: http://192.168.1.109:5678
xctest-client.js:52:14 [master] pid:14975 project path: /usr/local/lib/node_modules/app-inspector/node_modules/_xctestwd@1.0.31@xctestwd/XCTestWD/XCTestWD.xcodeproj
xctestwd start with port: 8001
xctest-client.js:224:14 [master] pid:14975 xcode version: 8.3.2
XCTestWD version: 1.0.31
xctest-client.js:172:14 [master] pid:14975 2017-06-04 22:20:05.527 xcodebuild[14981:600541] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/Cherry/Library/Developer/Xcode/DerivedData/XCTestWD-fgqqpeszdnmulmdsxhggovemcylb/Logs/Test/E3EA63B0-E89E-4B5D-9256-9B213F703E72/Session-XCTestWDUITests-2017-06-04_222005-L7a4k8.log

xctest-client.js:173:14 [master] pid:14975 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/_xctestwd@1.0.31@xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:172:14 [master] pid:14975 2017-06-04 22:20:05.527 xcodebuild[14981:600529] [MT] IDETestOperationsObserverDebug: (E3D06910-6758-45EC-982D-39D70E767360) Beginning test session XCTestWDUITests-E3D06910-6758-45EC-982D-39D70E767360 at 2017-06-04 22:20:05.527 with Xcode 8E2002 on target {
deviceSerialNumber: F78P75SNG5MP
identifier: e1fb98775314bd9661fa9fbf3cf7c09759dc1c1b
deviceClass: iPhone
deviceName: iPhone
deviceIdentifier: e1fb98775314bd9661fa9fbf3cf7c09759dc1c1b
productVersion: 9.3.1
buildVersion: 13E238
deviceSoftwareVersion: 9.3.1 (13E238)
deviceArchitecture: arm64
deviceTotalCapacity: 12757483520
deviceAvailableCapacity: 8515231744
deviceIsTransient: NO
ignored: NO
deviceIsBusy: NO
deviceIsActivated: YES
deviceActivationState: Activated
isPasscodeLocked: NO
deviceType: <0x7ff2729190a0 xcode.devicetype.iphone>
supportedDeviceFamilies: (
1
)
applications: (null)
provisioningProfiles: (null)
activityProgress: -2
activityTitle:

hasInternalSupport: NO
isSupportedOS: YES
developerDiskMountError: (null)
(null)
bootArgs:
} (9.3.1 (13E238))

xctest-client.js:173:14 [master] pid:14975 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/_xctestwd@1.0.31@xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:172:14 [master] pid:14975 2017-06-04 22:20:05.776 xcodebuild[14981:600529] Error Domain=IDETestOperationsObserverErrorDomain Code=4 "Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/Cherry/Library/Developer/Xcode/DerivedData/XCTestWD-fgqqpeszdnmulmdsxhggovemcylb/Logs/Test/E3EA63B0-E89E-4B5D-9256-9B213F703E72/Session-XCTestWDUITests-2017-06-04_222005-L7a4k8.log" UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/Cherry/Library/Developer/Xcode/DerivedData/XCTestWD-fgqqpeszdnmulmdsxhggovemcylb/Logs/Test/E3EA63B0-E89E-4B5D-9256-9B213F703E72/Session-XCTestWDUITests-2017-06-04_222005-L7a4k8.log}

xctest-client.js:173:14 [master] pid:14975 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/_xctestwd@1.0.31@xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:172:14 [master] pid:14975
Testing failed:
Signing for "XCTestWD" requires a development team. Select a development team in the project editor.
Code signing is required for product type 'Application' in SDK 'iOS 10.3'
Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/Cherry/Library/Developer/Xcode/DerivedData/XCTestWD-fgqqpeszdnmulmdsxhggovemcylb/Logs/Test/E3EA63B0-E89E-4B5D-9256-9B213F703E72/Session-XCTestWDUITests-2017-06-04_222005-L7a4k8.log

xctest-client.js:173:14 [master] pid:14975 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/_xctestwd@1.0.31@xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:172:14 [master] pid:14975 ** TEST FAILED **

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

xctest-client.js:173:14 [master] pid:14975 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/_xctestwd@1.0.31@xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:255:14 [master] pid:14975 killing deviceLogProc pid: 14978
xctest-client.js:260:14 [master] pid:14975 killing runnerProc pid: 14981
xctest-client.js:266:14 [master] pid:14975 killing iproxyProc pid: 14980
xctest-client.js:183:14 [master] pid:14975 xctest client exit with code: 65, signal: null
xctest-client.js:211:14 [master] pid:14975 iproxy exit with code: null, signal: SIGKILL
xctest-client.js:145:16 [master] pid:14975 devicelog exit with code: null, signal: SIGKILL
xctest-client.js:247:14 [master] pid:14975 Fail to start xctest: undefined
undefined
iOS device started: e1fb98775314bd9661fa9fbf3cf7c09759dc1c1b
inspector start at: http://192.168.1.109:5678
<-- GET /
helper.js:97:16 [master] pid:14975 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8001

Error: connect ECONNREFUSED 127.0.0.1:8001
at Object.exports._errnoException (util.js:1034:11)
at exports._exceptionWithHostPort (util.js:1057:20)
at TCPConnectWrap.afterConnect as oncomplete

26楼 已删除
2457
xdf · #27 · 2017年06月04日 作者

@cherrycumtb log 里有提示,你可以手动处理XCTestWD 工程的证书

3f8154
2457xdf 回复

果然好了,多谢大神

2457
xdf · #29 · 2017年06月04日 作者

@cherrycumtb 期待你的分享,用户的视角非常有价值

6272
>> UIAutomatorWD http server ready
>> Android device started: C4Y7N16328000954
>> inspector start at: http://192.168.7.150:5678
{ Error: Command failed: start http://192.168.7.150:5678

    at ChildProcess.exithandler (child_process.js:252:12)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:887:16)
    at Socket.stream.socket.on (internal/child_process.js:340:11)
    at emitOne (events.js:115:13)
    at Socket.emit (events.js:210:7)
    at Pipe._handle.close [as _onclose] (net.js:548:12)
  killed: false,
  code: 1,
  signal: null,
  cmd: 'start http://192.168.7.150:5678' }
  <-- GET /
>> proxy.js:55:14 [master] pid:6176 Proxy: /wd/hub/session/:sessionId/source:GET to http://127.0.0.1:9001/wd/hub/session
/:sessionId/source:GET with body: null

你好,想问下启动的时候有报错,并弹窗提示:http://192.168.7.150:5678 找不到应用程序,但是实际在浏览器能看到控件信息,功能也正常使用,这个报错需要处理吗@xdf

PS:播个插曲,在Windows下,我nodejs的安装目录一开始在c://Program Files//nodejs,结果启动的时候执行adb命令的时候因为Program Files没带双引号导致命令执行出错,后来只能把nodejs重装在C盘根目录

3f8154
2457xdf 回复

嗯嗯呐,好的嘞~~

作为一个小白,正在iOS真机的道路上填坑,待我能够运行了自己的第一个macaca脚本,一定得总结一篇文档发给大家~~哈

96
3f8154cherrycumtb 回复

connect ECONNREFUSED 你怎么解决的,手动编译XCTestWD.xcodeproj.花费的时间也太久了,而且app-inspector 还是提示这个错误

3f8154
32yufenghaihai 回复

手动处理XCTestWD 工程的证书,设置下然后就会好了

2457
xdf · #34 · 2017年06月12日 作者

@cherrycumtb 能否分享一文?

3f8154
2457xdf 回复

app inspector的吗?可以呀,我这周找个时间总结下~~

但是,大神,我想要用真机看下能不能把我们的app launch起来,还木有通。。囧。。。

xctest-client.js:173:14 [master] pid:5319 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/_xctestwd@1.0.32@xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:255:14 [master] pid:5319 killing deviceLogProc pid: 5328
xctest-client.js:260:14 [master] pid:5319 killing runnerProc pid: 5331
xctest-client.js:266:14 [master] pid:5319 killing iproxyProc pid: 5330
xctest-client.js:183:14 [master] pid:5319 xctest client exit with code: 65, signal: null
xctest-client.js:211:14 [master] pid:5319 iproxy exit with code: null, signal: SIGKILL
xctest-client.js:145:16 [master] pid:5319 devicelog exit with code: null, signal: SIGKILL
xctest-client.js:247:14 [master] pid:5319 Fail to start xctest: undefined
responseHandler.js:54:12 [master] pid:5319 Send Error Respone to Client: undefined

InternalServerError: Internal Server Error
at Object.throw (/usr/local/lib/node_modules/macaca-cli/node_modules/koa/lib/context.js:91:23)
at Object.module.exports (/usr/local/lib/node_modules/macaca-cli/node_modules/webdriver-server/lib/server/responseHandler.js:57:17)
at module.exports.throw ()
at onRejected (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:81:24)
at process._tickCallback (internal/process/next_tick.js:109:7)

1) "before all" hook

responseHandler.js:11:12 [master] pid:5319 Recieve HTTP Request from Client[2017-06-12 14:39:56]: method: DELETE url: /wd/hub/session, jsonBody: {}
responseHandler.js:23:14 [master] pid:5319 Send HTTP Respone to Client[2017-06-12 14:39:56]: 405 Method Not Allowed
2) "after all" hook

0 passing (3s)

2 failing

1) macaca mobile sample "before all" hook:
Error: [init({"platformName":"iOS","autoAcceptAlerts":false,"udid":"xxxxx","bundleId":"com.xxxxx"})] The environment you requested was unavailable.
at node_modules/macaca-wd/wd/lib/webdriver.js:134:15
at Request._callback (node_modules/macaca-wd/wd/lib/http-utils.js:87:7)
at Request.self.callback (node_modules/macaca-wd/node_modules/request/request.js:368:22)
at Request. (node_modules/macaca-wd/node_modules/request/request.js:1219:14)
at IncomingMessage. (node_modules/macaca-wd/node_modules/request/request.js:1167:12)
at endReadableNT (_stream_readable.js:975:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

2) macaca mobile sample "after all" hook:
Error: [quit()] Unexpected data in simpleCallback.
at exports.newError (node_modules/macaca-wd/wd/lib/utils.js:139:13)
at PromiseWebdriver. (node_modules/macaca-wd/wd/lib/callbacks.js:42:12)
at cb (node_modules/macaca-wd/wd/lib/webdriver.js:165:22)
at node_modules/macaca-wd/wd/lib/webdriver.js:179:5
at Request._callback (node_modules/macaca-wd/wd/lib/http-utils.js:87:7)
at Request.self.callback (node_modules/macaca-wd/node_modules/request/request.js:368:22)
at Request. (node_modules/macaca-wd/node_modules/request/request.js:1219:14)
at IncomingMessage. (node_modules/macaca-wd/node_modules/request/request.js:1167:12)
at endReadableNT (_stream_readable.js:975:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

4442

@xdf,帮忙看看以下错误:
环境:真机(iphone6,9.3.1),XCODE8.3,Team使用的是 免费Apple ID

xctest-client.js:173:14 [master] pid:11364 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:172:14 [master] pid:11364 2017-06-17 12:57:09.846 xcodebuild[11370:146237] Error Domain=IDETestOperationsObserverErrorDomain Code=4 "Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/stephen/Library/Developer/Xcode/DerivedData/XCTestWD-evljajykmolwzobrozpobiggeeea/Logs/Test/8E7EDF9F-68C7-427C-AFBE-5D89E33A9855/Session-XCTestWDUITests-2017-06-17_125642-UA1Njz.log" UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/stephen/Library/Developer/Xcode/DerivedData/XCTestWD-evljajykmolwzobrozpobiggeeea/Logs/Test/8E7EDF9F-68C7-427C-AFBE-5D89E33A9855/Session-XCTestWDUITests-2017-06-17_125642-UA1Njz.log}

xctest-client.js:173:14 [master] pid:11364 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:172:14 [master] pid:11364
Testing failed:
Command /bin/sh failed with exit code 162
** TEST FAILED **

xctest-client.js:173:14 [master] pid:11364 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:172:14 [master] pid:11364
The following build commands failed:
PhaseScriptExecution Run\ Script /Users/stephen/Library/Developer/Xcode/DerivedData/XCTestWD-evljajykmolwzobrozpobiggeeea/Build/Intermediates/XCTestWD.build/Debug-iphoneos/XCTestWDUITests.build/Script-7F90C8321EF231B2003F2DA0.sh
(1 failure)

xctest-client.js:173:14 [master] pid:11364 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:255:14 [master]
pid:11364 killing deviceLogProc pid: 11367
xctest-client.js:260:14 [master] pid:11364 killing runnerProc pid: 11370
xctest-client.js:266:14 [master] pid:11364 killing iproxyProc pid: 11369
xctest-client.js:183:14 [master] pid:11364 xctest client exit with code: 65, signal: null
xctest-client.js:211:14 [master] pid:11364 iproxy exit with code: null, signal: SIGKILL
xctest-client.js:145:16 [master] pid:11364 devicelog exit with code: null, signal: SIGKILL
xctest-client.js:247:14 [master] pid:11364 Fail to start xctest: undefined
undefined
iOS device started: 0bd62f77103bc32857f433ebc45e8c2e813d8a4a
inspector start at: http://192.168.0.114:5678
<-- GET /
helper.js:94:16 [master] pid:11364 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8001

Error: connect ECONNREFUSED 127.0.0.1:8001
at Object.exports._errnoException (util.js:1016:11)
at exports._exceptionWithHostPort (util.js:1039:20)
at TCPConnectWrap.afterConnect as oncomplete

96

@xdf 同问,也遇到了此问题,在xcode中设置过证书的,编译没错
根据日志中的提示,运行/Users/dlxx/Library/Developer/Xcode/DerivedData/XCTestWD-evljajykmolwzobrozpobiggeeea/Build/Intermediates/XCTestWD.build/Debug-iphoneos/XCTestWDUITests.build/Script-7F90C8321EF231B2003F2DA0.sh
No devices are booted.
请大神帮看下,谢谢

96

同問題

xctest-client.js:173:14 [master] pid:15027 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:172:14 [master] pid:15027
Testing failed:
Command /bin/sh failed with exit code 162
** TEST FAILED **

The following build commands failed:
PhaseScriptExecution Run\ Script /Users/owen_ko/Library/Developer/Xcode/DerivedData/XCTestWD-csksfttfbygcrbamoobfasiylmgb/Build/Intermediates/XCTestWD.build/Debug-iphoneos/XCTestWDUITests.build/Script-7F90C8321EF231B2003F2DA0.sh
(1 failure)

真機 一直弄不起來 ...

96
32yangyang506 回复

使用xcode编辑好信息后,不用xcode构建,使用命令,可以构建成功,命令:
xcodebuild -project XCTestWD.xcodeproj \
-scheme XCTestWDUITests \
-destination 'platform=iOS,name=(设备名称,例如:iPhone6)' \
XCTESTWD_PORT=8001 \
clean test

构建成功后,运行app-inspecotr,遇到:Error Domain=IDETestOperationsObserverErrorDomain Code=6 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" 错误,日志如下:

xctest-client.js:173:14 [master] pid:7795 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/_xctestwd@1.0.37@xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:172:14 [master] pid:7795 MDMCreateDeltaDirectory:1920 calling MDMDirectoryDiff with:
state->old_bundle: /var/folders/fb/vqg8m_xd13902672dtrvw1jh0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/b9f87b95bff57093271c0edbc9857746/cbf57ea4f5a49ff38eeda6c52df395e882580b7c/XCTestWDUITests-Runner.app
state->new_bundle: /Users/dlxx/Library/Developer/Xcode/DerivedData/XCTestWD-ccvxdwxqeiiwoaaqndjnsjrgtcql/Build/Products/Debug-iphoneos/XCTestWDUITests-Runner.app
state->dst_bundle: /var/folders/fb/vqg8m_xd13902672dtrvw1jh0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/XCTestWDUITests-Runner.app.8p1uxM/XCTestWDUITests-Runner.app_sparse.ipa/Payload//XCTestWDUITests-Runner.app, binaryDiff flag: FALSE
dst_ipa: /var/folders/fb/vqg8m_xd13902672dtrvw1jh0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/XCTestWDUITests-Runner.app.8p1uxM/XCTestWDUITests-Runner.app_sparse.ipa

xctest-client.js:173:14 [master] pid:7795 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/_xctestwd@1.0.37@xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:172:14 [master] pid:7795 __MDMDirectoryDiff_block_invoke.37:1473 calling writeDictToFile with: /var/folders/fb/vqg8m_xd13902672dtrvw1jh0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/XCTestWDUITests-Runner.app.8p1uxM/XCTestWDUITests-Runner.app_sparse.ipa/ManifestCache.plist

xctest-client.js:173:14 [master] pid:7795 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/_xctestwd@1.0.37@xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:172:14 [master] pid:7795 writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/fb/vqg8m_xd13902672dtrvw1jh0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/XCTestWDUITests-Runner.app.8p1uxM/XCTestWDUITests-Runner.app_sparse.ipa/ManifestCache.plist

xctest-client.js:173:14 [master] pid:7795 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/_xctestwd@1.0.37@xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:172:14 [master] pid:7795 2017-06-19 14:40:33.121 xcodebuild[7801:248868] Error Domain=IDETestOperationsObserverErrorDomain Code=6 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}

xctest-client.js:173:14 [master] pid:7795 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/_xctestwd@1.0.37@xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:172:14 [master] pid:7795
Testing failed:

xctest-client.js:173:14 [master] pid:7795 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/_xctestwd@1.0.37@xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:172:14 [master] pid:7795 Test target XCTestWDUITests encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **

xctest-client.js:173:14 [master] pid:7795 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/_xctestwd@1.0.37@xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:255:14 [master] pid:7795 killing deviceLogProc pid: 7798
xctest-client.js:260:14 [master] pid:7795 killing runnerProc pid: 7801
xctest-client.js:266:14 [master] pid:7795 killing iproxyProc pid: 7800
xctest-client.js:183:14 [master] pid:7795 xctest client exit with code: 65, signal: null
xctest-client.js:211:14 [master] pid:7795 iproxy exit with code: null, signal: SIGKILL
xctest-client.js:145:16 [master] pid:7795 devicelog exit with code: null, signal: SIGKILL
xctest-client.js:247:14 [master] pid:7795 Fail to start xctest: undefined
undefined
iOS device started: cbf57ea4f5a49ff38eeda6c52df395e882580b7c
inspector start at: http://192.168.1.108:5678
<-- GET /
helper.js:94:16 [master] pid:7795 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8001

Error: connect ECONNREFUSED 127.0.0.1:8001

将手机重启后,再次运行app-inspector ,👌

96
32yangyang506 回复

請問有解決了嗎?

13930

@xdf app-inspector 2.0.5 使用查看器,终端输入命令后app-inspector -u ****** 后,真机一直无法启动XCTestWD, 配置没毛病😂

96
32ok 回复

解决了,可以查看对象

5876da

@xdf @yangyang506 @ok 请问下这个错要怎么解呢?谢谢
A shell task (/usr/bin/xcrun codesign --force --sign F241E5B352893895A20CCF39D73B6AC0F0B3F89D --preserve-metadata=identifier,entitlements /Users/kugou/Library/Developer/Xcode/DerivedData/XCTestWD-csksfttfbygcrbamoobfasiylmgb/Build/Products/Debug-iphoneos/XCTestWD.app/Frameworks/Swifter.framework) failed with exit code 1:
/Users/kugou/Library/Developer/Xcode/DerivedData/XCTestWD-csksfttfbygcrbamoobfasiylmgb/Build/Products/Debug-iphoneos/XCTestWD.app/Frameworks/Swifter.framework: unknown error -1=ffffffffffffffff

Command /bin/sh failed with exit code 1

2017-06-20 15:10:51.883 xcodebuild[60370:1208566] Error Domain=IDETestOperationsObserverErrorDomain Code=4 "Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/kugou/Library/Developer/Xcode/DerivedData/XCTestWD-csksfttfbygcrbamoobfasiylmgb/Logs/Test/1C7E6532-35C7-48B8-9ACD-DA27D4139ACC/Session-XCTestWDUITests-2017-06-20_150947-W752l8.log" UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/kugou/Library/Developer/Xcode/DerivedData/XCTestWD-csksfttfbygcrbamoobfasiylmgb/Logs/Test/1C7E6532-35C7-48B8-9ACD-DA27D4139ACC/Session-XCTestWDUITests-2017-06-20_150947-W752l8.log}

Testing failed:
Command /bin/sh failed with exit code 1
** TEST FAILED **

The following build commands failed:
PhaseScriptExecution Run\ Script /Users/kugou/Library/Developer/Xcode/DerivedData/XCTestWD-csksfttfbygcrbamoobfasiylmgb/Build/Intermediates/XCTestWD.build/Debug-iphoneos/XCTestWD.build/Script-63D408691EAB64FC00198736.sh

13748

各位大神指导一下,这是什么情况,我落了什么步骤吗?

2106
13748byJJ 回复

@xdf
我这也有#45楼同样的问题,
Macaca Version:
2.0.4

Macaca Doctor Logs:
macaca-doctor version: 2.0.1

Node.js checklist:

node env: /usr/local/bin/node
node version: v7.7.1

iOS checklist:

Xcode Command Line Tools is ready, version: 2347.
xcodebuild version: 8.3.2
iproxy[usbmuxd] is installed at: /usr/local/bin/iproxy
ios_webkit_debug_proxy is installed at: /usr/local/bin/ios_webkit_debug_proxy
carthage is installed, version: 0.24.0

Android checklist:

JAVA version is 1.8.0_121
JAVA_HOME is set to /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
ANDROID_HOME is set to /Users/xiaoxue/Library/android-sdk-macosx
Platforms is set to /Users/xiaoxue/Library/android-sdk-macosx/platforms/android-25
ADB tool is set to /Users/xiaoxue/Library/android-sdk-macosx/platform-tools/adb
gradle is installed, version: 3.5

Installed driver list:

android: 2.0.30
chrome: 1.0.6
electron: 1.1.7
ios: 2.0.20

Operate System:
OSX 10.12.3

macaca-ios 2.0.22完全有问题,降级到2.0.20后,启动app-inspector连接真机,
刚开始浏览器出现“Waiting device start”,此时日志为:

>> xctest-client.js:173:14 [master] pid:11683 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
  <-- GET /
  --> GET / 200
  <-- GET /
  --> GET / 200
  <-- GET /
  --> GET / 200
  <-- GET /
  --> GET / 200
  <-- GET /
  --> GET / 200
  <-- GET /
  --> GET / 200
  <-- GET /
  --> GET / 200
>> xctest-client.js:172:14 [master] pid:11683 writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/f3/fsxd3f315vg22yc0997bxrl00000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/5a6ae50258fe0588d34604fc5261dbbd/e01d730b625c83ad877fb699701bc35ea3e800ec/ManifestCache.plist

>> xctest-client.js:173:14 [master] pid:11683 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
  <-- GET /
  --> GET / 200

再过一会,浏览器就显示“Internal Server Error”

>> xctest-client.js:172:14 [master] pid:11683 2017-07-27 19:23:16.512 xcodebuild[11689:124808] Error Domain=IDETestOperationsObserverErrorDomain Code=6 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}

>> xctest-client.js:173:14 [master] pid:11683 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
>> xctest-client.js:172:14 [master] pid:11683
Testing failed:

>> xctest-client.js:173:14 [master] pid:11683 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
>> xctest-client.js:172:14 [master] pid:11683   Test target XCTestWDUITests encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **


>> xctest-client.js:173:14 [master] pid:11683 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
>> xctest-client.js:255:14 [master] pid:11683 killing deviceLogProc pid: 11686
>> xctest-client.js:260:14 [master] pid:11683 killing runnerProc pid: 11689
>> xctest-client.js:266:14 [master] pid:11683 killing iproxyProc pid: 11688
>> xctest-client.js:183:14 [master] pid:11683 xctest client exit with code: 65, signal: null
>> xctest-client.js:145:16 [master] pid:11683 devicelog exit with code: null, signal: SIGKILL
>> xctest-client.js:247:14 [master] pid:11683 Fail to start xctest: undefined
undefined
>> iOS device started: e01d730b625c83ad877fb699701bc35ea3e800ec
>> inspector start at: http://192.168.199.187:5678
>> xctest-client.js:211:14 [master] pid:11683 iproxy exit with code: null, signal: SIGKILL
  <-- GET /
>> helper.js:94:16 [master] pid:11683 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8001

  Error: connect ECONNREFUSED 127.0.0.1:8001
      at Object.exports._errnoException (util.js:1029:11)
      at exports._exceptionWithHostPort (util.js:1052:20)
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1093:14)

  <-- GET /
>> helper.js:94:16 [master] pid:11683 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8001

  Error: connect ECONNREFUSED 127.0.0.1:8001
      at Object.exports._errnoException (util.js:1029:11)
      at exports._exceptionWithHostPort (util.js:1052:20)
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1093:14)
2106
2106laiyuncong8404 回复

折腾了几天,终于搞好了,呜呜呜~
解决办法

2106 laiyuncong8404 ATX 文档 - iOS 真机如何安装 WebDriverAgent 中提及了此贴 07月28日 16:22
13748
2106laiyuncong8404 回复

哈哈~ 我也是折腾了几天才弄好的,慢慢填坑吧~😅

F58ce0
A972e5aecho 回复

请问你是怎么解决的?

51楼 已删除
A21b50
2457xdf 回复

https://testerhome.com/topics/8896这篇文章中,处理 XPath那看不太明白怎么使用,能举个例子说下怎么使用/[@resource-id="${ID}"]或者/[@text="${ID}"]这类返回吗?
2、inspector获取到/[@resource-id="${ID}"]或者/[@text="${ID}"]是在XPath_lite中不是XPath中,请问有什么区别吗?

25f875
2106laiyuncong8404 回复

事实证明,除了这一步,还要restart your iPhone,不然还是会报错的

10998

@yxys01 配置了路径,重启了手机,但是还是报ld: warning: directory not found for option '-F/Users/nd-mac/Desktop/test/XCTestWD/XCTestWD/../Carthage/Build/iOS'
异常

25f875
10998huangejuan 回复

你在Runpath Search paths里面添加路径了吗?

10998

@yxys01 是的,
(inherited)
@executable_path/Frameworks
$(SRCROOT)/../Carthage/Build/iOS
$(PROJECT_DIR)/Carthage/Build/iOS

25f875
10998huangejuan 回复

我的是mac,Windows的我不是很清楚耶~~~你问下社区其他大神吧,不好意思哈

10998

@yxys01 我的也是mac啊😁

25f875
10998huangejuan 回复

我大概知道你哪的问题了,你是单独下载的XCTestWD,没有安装依赖到macaca里面,肯定报错啊
你要去这个路径下面找/usr/local/lib/node_modules/macaca-ios/node_modules/_xctestwd@1.0.42@xctestwd/XCTestWD/XCTestWD.xcodeproj

9cb50c

XCTestWD version: 1.1.8
undefined
iOS device started: fdee392bbfbbb95c272c5ac5842479819fc9f79f
inspector start at: http://10.10.10.26:5678
<-- GET /

Error: connect ECONNREFUSED 127.0.0.1:8001
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at TCPConnectWrap.afterConnect as oncomplete

无法打开

61楼 已删除
46713e
2106laiyuncong8404 回复

你的工程不是WebDriverAgent吗?怎么又变成XCTestWD了

2106
46713eerge 回复

WebDriverAgent搞不定,转投XCTestWD怀抱了😊

6504

@laiyuncong8404

d: warning: directory not found for option '-F/usr/local/lib/node_modules/app-inspector/node_modules/_xctestwd@1.3.10@xctestwd/XCTestWD/../Carthage/Build/iOS'
ld: framework not found Swifter
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Showing All Issues
ld: warning: directory not found for option '-F/usr/local/lib/node_modules/app-inspector/node_modules/_xctestwd@1.3.10@xctestwd/XCTestWD/../Carthage/Build/iOS'

ld: framework not found Swifter


请问下知道怎么处理吗?

96

不知道为啥,我跑出来app-inspector,图片上点击任意地方,整个页面都是红色的。位置跟图片不能对应,不是h5。有人遇到这个问题吗?

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