Macaca Macaca App Inspector 2.0 发布

达峰的夏天 · 2017年05月24日 · 最后由 洛凉 回复于 2019年10月12日 · 9067 次阅读
本帖已被设为精华帖!

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

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

$ npm i app-inspector@2 -g

发布记录

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

项目地址:

共收到 66 条回复 时间 点赞
达峰的夏天 xpath 定位元素失败 中提及了此贴 05月24日 17:39


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

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

达峰的夏天 [公告] App Inspector 重磅升级 中提及了此贴 05月24日 20:50
达峰的夏天 app-inspector 真机查看元素设置 中提及了此贴 05月24日 20:50
思寒_seveniruby 将本帖设为了精华贴 05月24日 21:27

之前真机上还可以查元素 升级之后不查看了 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:
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

jash 回复

这个问题已解决

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

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

@xdf

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

IOS 的这种 xpath 定位不到元素

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

升级后报错,请问这是什么原因
{ 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' }

jash 回复

这个问题是怎么解的啊

jash 回复

怎么解的 啊

@xdf

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

升级时报错了,已经将 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

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:
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

61楼 已删除

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

果然好了,多谢大神

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

>> 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 盘根目录

嗯嗯呐,好的嘞~~

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

cherrycumtb 回复

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

回复

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

@cherrycumtb 能否分享一文?

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)

@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

@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.
请大神帮看下,谢谢

同問題

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)

真機 一直弄不起來 ...

mumu 回复

使用 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 ,👌

mumu 回复

請問有解決了嗎?

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

ok 回复

解决了,可以查看对象

@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

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

哆啦JJ 回复

@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)
和曦 回复

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

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

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

summe 回复

请问你是怎么解决的?

63楼 已删除

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

和曦 回复

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

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

huang 回复

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

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

huang 回复

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

@yxys01 我的也是 mac 啊😁

huang 回复

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

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

无法打开

65楼 已删除
和曦 回复

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

二哥 回复

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

@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


请问下知道怎么处理吗?

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

yang 回复

@xdf 您好 我的页面比较长,下滑后识别的元素就乱了,不知道啥情况。

没有找到Swifter插件,
你可以手动进去看看插件编译成功没?
最新版需要使用 Xcode 9 去编译,8 不行。

app-inspector -u XXX --verbose 报错,打不开对象识别页面,报错信息:

server.js:16:12 [master] pid:1184 server start with config:
{ port: 5678,
verbose: true,
udid: '9963d01d',
ip: '192.168.179.1',
host: 'DESKTOP-IC7GM4G',
loaded_time: '2018-02-26 17:22:18' }
app-inspector.js:43:12 [master] pid:1184 server start at: http://192.168.179.1:5678
uiautomator-client.js:62:14 [master] pid:1184 INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
com.macaca.android.testing.UIAutomatorWD:
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: test=MacacaTestRunner
INSTRUMENTATION_STATUS: class=com.macaca.android.testing.UIAutomatorWD
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS_CODE: 1

uiautomator-client.js:62:14 [master] pid:1184 INSTRUMENTATION_STATUS: stream=
UIAutomatorWD->http://localhost:9001<-UIAutomatorWD
INSTRUMENTATION_STATUS_CODE: 0

UIAutomatorWD http server ready
Android device started: 9963d01d
inspector start at: http://192.168.179.1:5678
uiautomator-client.js:62:14 [master] pid:1184 INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
Error in MacacaTestRunner(com.macaca.android.testing.UIAutomatorWD):
com.alibaba.fastjson.JSONException: syntax error, expect [, actual undefined, pos 0
at com.alibaba.fastjson.parser.DefaultJSONParser.parseArray(DefaultJSONParser.java:1103)
at com.alibaba.fastjson.parser.DefaultJSONParser.parseArray(DefaultJSONParser.java:1090)
at com.alibaba.fastjson.JSON.parseArray(JSON.java:487)
at com.macaca.android.testing.UIAutomatorWD.MacacaTestRunner(UIAutomatorWD.java:34)
at java.lang.reflect.Method.invoke(Native Method)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:59)
at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:262)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1886)

INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: test=MacacaTestRunner
INSTRUMENTATION_STATUS: class=com.macaca.android.testing.UIAutomatorWD
INSTRUMENTATION_STATUS: stack=com.alibaba.fastjson.JSONException: syntax error, expect [, actual undefined, pos 0
at com.alibaba.fastjson.parser.DefaultJSONParser.parseArray(DefaultJSONParser.java:1103)
at com.alibaba.fastjson.parser.DefaultJSONParser.parseArray(DefaultJSONParser.java:1090)
at com.alibaba.fastjson.JSON.parseArray(JSON.java:487)
at com.macaca.android.testing.UIAutomatorWD.MacacaTestRunner(UIAutomatorWD.java:34)
at java.lang.reflect.Method.invoke(Native Method)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:59)
at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:262)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1886)

INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS_CODE: -2
INSTRUMENTATION_RESULT: stream=

Time: 0.067
There was 1 failure:
1) MacacaTestRunner(com.macaca.android.testing.UIAutomatorWD)
com.alibaba.fastjson.JSONException: syntax error, expect [, actual undefined, pos 0
at com.alibaba.fastjson.parser.DefaultJSONParser.parseArray(DefaultJSONParser.java:1103)
at com.alibaba.fastjson.parser.DefaultJSONParser.parseArray(DefaultJSONParser.java:1090)
at com.alibaba.fastjson.JSON.parseArray(JSON.java:487)
at com.macaca.android.testing.UIAutomatorWD.MacacaTestRunner(UIAutomatorWD.java:34)
at java.lang.reflect.Method.invoke(Native Method)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:59)
at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:262)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1886)

FAILURES!!!
Tests run: 1, Failures: 1

INSTRUMENTATION_CODE: -1

@yangyang506 什么型号的设备

Macaca Inspector 升级 2.0.15 https://testerhome.com/topics/12419

和曦 回复

wda 的问题解决了么
dyld: Library not loaded: @rpath/XCTest.framework/XCTest
求助😂

66楼 已删除
jash 回复

请问这个是怎么解决的?

@xdf :macaca 最新版本支持通过 class 方式定位元素么?
例如:
self.driver.wait_for_element('class', 'com.******.ui:id/rbMine').click()
备注:
定位方式写什么?‘class’ 还是其他?

simple 专栏文章:[精华帖] 社区历年精华帖分类归总 中提及了此贴 12月13日 20:49
simple [精彩盘点] TesterHome 社区 2018 年 度精华帖 中提及了此贴 01月07日 12:08

我什么都没动,过一段时间 app-inspector 就一直 internal server error,,日志如下:

XCTestWD version: 1.4.18
Error: ENOENT: no such file or directory, scandir '/usr/local/homebrew/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/build/Build/Products'
at Object.readdirSync (fs.js:795:3)
at /usr/local/homebrew/lib/node_modules/app-inspector/node_modules/xctestwd/lib/xctest-client.js:189:26
at new Promise ()
at XCTest.startBootstrap (/usr/local/homebrew/lib/node_modules/app-inspector/node_modules/xctestwd/lib/xctest-client.js:182:12)
at startBootstrap.next ()
at onFulfilled (/usr/local/homebrew/lib/node_modules/app-inspector/node_modules/co/index.js:65:19)
at /usr/local/homebrew/lib/node_modules/app-inspector/node_modules/co/index.js:54:5
at new Promise ()
at co (/usr/local/homebrew/lib/node_modules/app-inspector/node_modules/co/index.js:50:10)
at toPromise (/usr/local/homebrew/lib/node_modules/app-inspector/node_modules/co/index.js:118:63) {
errno: -2,
syscall: 'scandir',
code: 'ENOENT',
path: '/usr/local/homebrew/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/build/Build/Products'
}
iOS device started: 25ff8f554eec8da683a00f0310291573f313a72f
inspector start at: http://172.16.48.253:5678
<-- GET /

Error: connect ECONNREFUSED 127.0.0.1:8001
at TCPConnectWrap.afterConnect as oncomplete

l 楼主解决了吗?

洛凉 回复

没有解决

@liyaoyao 你这个看上去是本地网络问题 macaca doctor 检查一下呢?

全部重装吧,我现在正常了

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