Macaca [公告] App Inspector 重磅升级

xdf · 2016年08月29日 · 最后由 pliue 回复于 2017年08月14日 · 4819 次阅读
本帖已被设为精华帖!

App Inspector 是运行在浏览器端的移动设备 UI 查看器,使用树状态结构查看 UI 布局,并且能自动生成 XPath,方便脚本的编写和生成。

安装

$ npm install app-inspector -g

使用

$ app-inspector -u YOUR-DEVICE-ID

相关链接

共收到 111 条回复 时间 点赞

好东西

启动了。游览器一直显示Waiting Device start...


Lihuazhang 将本帖设为了精华贴 08月29日 11:35

好工具,能打造成通用的就好了。appium,macaca,wda 等等

也遇到了同样的问题,浏览器一直显示Waiting Device start。

恩,和前2位遇到了同样的问题

WDA也要重新拉取吧?

xdf #8 · 2016年08月29日 作者

#7楼 @Tank007 wda 随着升级会自动下载新的啊

xdf #9 · 2016年08月29日 作者

@freeskyday @rik782 问题麻烦回复下issue,真机还是模拟器?型号,哪个平台

#9楼 @xdf 三星note3 安卓平台,这个还需要安装其他的依赖吗?

#9楼 @xdf 我是真机,iOS 手机是6s

xdf #12 · 2016年08月29日 作者

@rik782 macaca doctor 检查下你的系统环境

@xdf 我的是真机,三星note3,android

@xdf macaca doctor 检测的系统环境截图

Waiting Device start。 模拟器,android

#12楼 @xdf 环境都检测OK了,发现还是存在此问题

给达峰赞一个

我也是 orz,一直就没能用上过

Python3.4安装的,虚拟机和魅族真机都试过了,都是显示下图

有个朋友在Python 2.7.9安装的WIN上面OK,Mac上面也是显示上图,不清楚是不是版本问题

xdf #20 · 2016年08月29日 作者

@nana_2016 不依赖python环境啊,安装中的报错贴出来

整了半天还是显示waiting devices start,安卓机、模拟器都试了

xdf #23 · 2016年08月29日 作者

安装中有报错,代表安装有问题,肯定有问题的啊

同上述问题 一直 waitingdevice start。真机ios

#23楼 @xdf android真机没有问题,但是iOS 一直提示waiting device start. macaca doctor检查都是没有问题的

xpath 在滑动页面之后,获取的好像有问题。。

xdf #27 · 2016年08月29日 作者

问题麻烦提issue,方便一一处理

因崔斯特,一直觉得appium inspector有点重,因为我appium server不用UI的,尝试用这个工具替代
我也是waiting device start... iPhone6真机,这个inspector需要macaca环境支持吗?

这个能否增加获取元素的id,这样会更加方便吧

xdf #30 · 2016年09月01日 作者

#29楼 @fengmiss source-id 就是

#30楼 @xdf 我的显示没有source-id,这是我弄得方式有问题吗?
bounds
isEnabled
isVisible
value
label
type
name
rawIdentifier
class
XPath

xdf #32 · 2016年09月01日 作者

@fengmiss 你是iOS?

xdf #34 · 2016年09月02日 作者

resouce-id android才有哦

xdf [该话题已被删除] 中提及了此贴 09月05日 22:10
xdf [该话题已被删除] 中提及了此贴 09月17日 17:20

安装报错
环境 win7 sp1 x86 + node 4.4.0
1、安装了cnpm
2、安装了macaca主程序(安装正确)
3、用macaca doctor检查环境(全绿色,PATH已经配置)
4、安装app-inspector报错,错误如下:

5、尝试运行,报错如下:

我也尝试了一下,报错了......
环境 win10 + node 4.4.4
1、安装了cnpm
2、安装了macaca主程序(安装正确)
3、用macaca doctor检查环境(全绿色,PATH已经配置)

4、安装app-inspector报错,错误如下:

5、真机尝试


检查环境没有问题,install app-inspector -g报上面的错误;

一直等待中啊

我也是一直等待中。。。。。

#38楼 @ws96apt 相同的问题,环境检查ok,uiautomator-client报错

xdf [该话题已被删除] 中提及了此贴 10月21日 15:45

@xdf 这个支持XCUITest,以及iOS10的系统吗?
谢谢

#45楼 @Lihuazhang @xdf
求指点

1.我在安装过程中,执行npm install app-inspector -g 命令,出现以下error:

/usr/local/lib/node_modules/app-inspector/node_modules/uiautomator-client/scripts/build.js:178
throw e;
^

Error: $JAVA_HOME is not set
at checkJavaHome.then.catch.then.then.catch.then.std (/usr/local/lib/node_modules/app-inspector/node_modules/java-home/lib/java-home.js:89:25)
at process._tickCallback (internal/process/next_tick.js:103:7)

但是我是配置了JAVA_HOME的,通过echo $JAVA_HOME 也能看到值。

localhost:bin junewang$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home

2.之后,执行app-inspector -u YOUR-DEVICE-ID
没有出现http的地址,自己在浏览器中手动输入localhost:5678
一直出现Waiting Devices start

能指导一下你是如何安装成功并使用的吗?谢谢

安卓执行app-inspector -u YOUR-DEVICE-ID,能成功,但是ios就不行。
macaca doctor 环境都是可以的

xdf [该话题已被删除] 中提及了此贴 10月26日 18:21

支持真机iOS10.1吗?

#46楼 @junewang 我也遇到同样问题,期待解决方案

#46楼 @junewang @holyzhang
回复一下46楼遇到的问题:

通过定位,原因为:使用了sudo命令执行,而采用sudo执行时,获取不到JAVA_HOME的环境变量。

详细解释如下:
我因为权限问题,使用了sudo命令,来执行npm install app-inspector -g.具体为:

sudo npm install app-inspector -g

后面查看了以下,发现如果使用sudo命令,是不能检测到set了JAVA_HOME的。具体参考地址为:https://github.com/macacajs/app-inspector/issues/32

给/User/xxxx/.nvm下面的具体路径,通过chmod命令,设置读写权限后,执行

npm install app-inspector -g

即可安装正常运行

你试试,希望也能正常运行。

#47楼 @466895041 我使用模拟器也跟你一样,解决了吗?是什么问题?

安装和检查环境都没有任何问题,但是运行app-inspector -u (UDID)后,网页没有任何UI viewer显示,请问是什么问题呢?运行结果如图:

运行一直报错,截图如下

xdf [公告] Macaca 已支持 iOS10 和 Android7 中提及了此贴 12月01日 16:28

我用app-inspector -u xxxxxx --verbose连接安卓机器,无法连接上,log如下:

>> server.js:16:12 [master] pid:6307 server start with config:
{ port: 5678,
verbose: true,
udid: 'xxxx',
ip: '192.168.1.36',
host: 'local',
loaded_time: '2016-12-05 14:30:13' }
>> app-inspector.js:42:10 [master] pid:6307 server start at: http://192.168.1.36:5678

我打开http://192.168.1.36:5678,页面上显示 *waiting device start... * 。

我去看了一下源码,发现执行到 /usr/local/lib/node_modules/app-inspector/node_modules/uiautomator-client/lib/uiautomator-client.js 的line27

yield this.adb.rm(`${ANDROID_TMP_DIR}/${FILE_NAME}.jar`);

就没有执行下去了。
问了人,说
this.adb.rm(${ANDROID_TMP_DIR}/${FILE_NAME}.jar)没有返回值,所以停在这边不往下执行,查看adb.rm()的返回值 为:{}
打开 abd shell, 执行 rm /data/local/tmp/uiautomator-bootstrap.jar

shell@hwedison:/ $ rm /data/local/tmp/uiautomator-bootstrap.jar
rm: /data/local/tmp/uiautomator-bootstrap.jar: No such file or directory

怀疑是adb的问题,但是不知道如果验证和修改了?请问是什么问题?
@xdf

终于在iOS上成功部署了App Inspector,写个经验给后来的人
iOS9以上的系统由于安全性要求,需要信任签名证书对应的开发者,具体操作方式:直接打开WebDriverAgent,会有安全提示,具体操作步骤可以参考:http://jingyan.baidu.com/article/b0b63dbfea0bfa4a49307077.html

再补充一点,手机wifi跟mac需要在同一个网段

您好,请问我昨天还能用的,今天提示我升级app-inspector,升级后启动页面就直接白屏了是什么原因呀?Failed to load resource: the server responded with a status of 404 (Not Found)

#42楼 @boxiangcen xport JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home
export CLASS_PATH=$JAVA_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$CLASS_PATH
配置完成的java环境,就可以了

请问Mac 上app-inspector启动后报这个错,是什么原因,如何解决呀?
at /usr/local/lib/node_modules/app-inspector/node_modules/.4.6.0@co/index.js:54:5

app-inspector.js:42:10 [master] pid:4384 server start at: http://172.11.22.182:5678
xctest-client.js:58:14 [master] pid:4384 project path not found
app-inspector:66:44 [master] pid:4384 Error: >> xctest-client.js:58:14 [master] pid:4384 project path not found
at Logger.error (/usr/local/lib/node_modules/app-inspector/node_modules/.1.0.6@xlogger/lib/xlogger.js:169:9)
at XCTest.checkProjectPath (/usr/local/lib/node_modules/app-inspector/node_modules/.1.0.29@xctest-client/lib/xctest-client.js:58:14)
at XCTest.init (/usr/local/lib/node_modules/app-inspector/node_modules/.1.0.29@xctest-client/lib/xctest-client.js:51:10)
at XCTest (/usr/local/lib/node_modules/app-inspector/node_modules/.1.0.29@xctest-client/lib/xctest-client.js:39:10)
at Object.exports.initDevice (/usr/local/lib/node_modules/app-inspector/lib/ios.js:90:12)
at exports.initDevice.next ()
at onFulfilled (/usr/local/lib/node_modules/app-inspector/node_modules/.4.6.0@co/index.js:65:19)
at /usr/local/lib/node_modules/app-inspector/node_modules/.4.6.0@co/index.js:54:5
at co (/usr/local/lib/node_modules/app-inspector/node_modules/.4.6.0@co/index.js:50:10)
at toPromise (/usr/local/lib/node_modules/app-inspector/node_modules/.4.6.0@co/index.js:118:63)
(node:4384) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: >> app-inspector:66:44 [master] pid:4384 Error: >> xctest-client.js:58:14 [master] pid:4384 project path not found
at Logger.error (/usr/local/lib/node_modules/app-inspector/node_modules/.1.0.6@xlogger/lib/xlogger.js:169:9)
at XCTest.checkProjectPath (/usr/local/lib/node_modules/app-inspector/node_modules/.1.0.29@xctest-client/lib/xctest-client.js:58:14)
at XCTest.init (/usr/local/lib/node_modules/app-inspector/node_modules/.1.0.29@xctest-client/lib/xctest-client.js:51:10)
at XCTest (/usr/local/lib/node_modules/app-inspector/node_modules/.1.0.29@xctest-client/lib/xctest-client.js:39:10)
at Object.exports.initDevice (/usr/local/lib/node_modules/app-inspector/lib/ios.js:90:12)
at exports.initDevice.next ()
at onFulfilled (/usr/local/lib/node_modules/app-inspector/node_modules/.4.6.0@co/index.js:65:19)
at /usr/local/lib/node_modules/app-inspector/node_modules/.4.6.0@co/index.js:54:5
at co (/usr/local/lib/node_modules/app-inspector/node_modules/.4.6.0@co/index.js:50:10)
at toPromise (/usr/local/lib/node_modules/app-inspector/node_modules/.4.6.0@co/index.js:118:63)
(node:4384) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@fffhigh0315 ,遇到了相同的问题,解决了吗?

app-inspector:66:44 [master] pid:5083 undefined

这个怎么解决?

通过这个工具获取的 xml 文件, 和 通过 driver.source 获取的 xml 文件不同.
这个工具获取的 xml 文件内容比较精简, 没有展示的内容没有显示在 xml 文件中. 这个是怎么做到的?

#54楼 @CamillaDan 报相同的错。请问你的问题解决了吗?

nicoledeMac-mini:~ nicole$ app-inspector -u A055DCB7-131C-44AE-9F26-5B062135253C
>> xctest-client start with port: 8900
>> WebDriverAgent version: 1.0.39
>> app-inspector:66:44 [master] pid:6280 undefined
(node:6280) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: >> app-inspector:66:44 [master] pid:6280 undefined
(node:6280) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

App Inspector 是不是不支持安卓模拟器的连接?真机我是都可以连接成功的.
模拟器运行后,执行: adb devices 获取的设备号是:emulator-5554 device
浏览器无法获得手机的界面.

#66楼 @wanwan001 你的问题解决了么?我这练IOS真机一直报这个错

@xdf 今天升级app-inspector@1.2.18后,浏览器打开IP:5678,在UI上点击控件,不出现红色的框框了,怎么回事?升级之前都是可以的,定位到一个button上自动显示红框,右侧就可以看到name什么,现在要把树结构一个个点开,猜才行

mac10.12.1 node 7.3.0安装macaca失败, 求解,

#62楼 @fffhigh0315 我也有这个问题,解决了吗

#66楼 @wanwan001 请问这个问题解决了吗,我的也报同样的错

#54楼 @CamillaDan 请问你的这个问题解决了没

#74楼 @lynn_qin

  1. 在执行app-inspector -u [udid]这条命令的后面加上“--verbose”,即执行 app-inspector -u [udid] --verbose
  2. 执行结果得到错误“pid:6280 undefined”,同时会提示app-inspector目录下的webdriveragent的路径,打开该目录 open /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent
  3. 使用XCode打开该工程,尝试build会发现无法build成功,因为这个工程里WebDriverAgentLib的Bundle Id还是“com.facebook.WebDriverAgentLib”,WebDriverAgentRunner的bundle id还是“com.enchantin.WebDriverAgentRunner”,而需要做的就是修改他们的bundle id使得可以build成功,具体修改步骤请参考在 MAC 上搭建 appium1.6.3 过程的第12步
  4. build成功后,将iPhone上已经安装的WebDriverAgent先卸载,然后再运行app-inspector -u就可以看到mac上自动打开http://localhost:5678的页面了

以上就是我在我的mac上解决这个问题的方法,不知道是否也适合你们的情况~

@u1449475793 我运行app-inspector -u [udid] --verbose, 报的是其他错貌似:

server.js:16:12 [master] pid:12516 server start with config:
{ port: 5678,
verbose: true,
udid: 'bb1f6c5abfef652ef6b087f434acb8de105b90d4',
ip: '10.48.18.78',
host: 'cd-yh-huangqin.local',
loaded_time: '2017-01-13 17:54:29' }
app-inspector.js:42:10 [master] pid:12516 server start at: http://10.48.18.78:5678
xctest-client.js:56:14 [master] pid:12516 project path: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client start with port: 8900
xctest-client.js:233:14 [master] pid:12516 xcode version: 8.2.1
WebDriverAgent version: 1.0.41
xctest-client.js:170:14 [master] pid:12516 2017-01-13 17:54:31.047 xcodebuild[12522:404331] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/beyondsoft/Library/Developer/Xcode/DerivedData/WebDriverAgent-ceakatlydgitcjebccsbdhchgrpn/Logs/Test/94DA19C9-9472-41C1-BFF2-2E553C43A88D/Session-WebDriverAgentRunner-2017-01-13_175431-gxDQSv.log
2017-01-13 17:54:31.047 xcodebuild[12522:404330] [MT] IDETestOperationsObserverDebug: (718F959D-5B1B-47D4-9C49-E75A060790A6) Beginning test session WebDriverAgentRunner-718F959D-5B1B-47D4-9C49-E75A060790A6 at 2017-01-13 17:54:31.046 with Xcode 8C1002 on target {
deviceSerialNumber: F2PLDGB3FQ0Y
identifier: bb1f6c5abfef652ef6b087f434acb8de105b90d4
deviceClass: iPhone
deviceName: iPhone
deviceIdentifier: bb1f6c5abfef652ef6b087f434acb8de105b90d4
productVersion: 10.0.1
buildVersion: 14A403
deviceSoftwareVersion: 10.0.1 (14A403)
deviceArchitecture: armv7s
deviceTotalCapacity: 13092655104
deviceAvailableCapacity: 8088752128
deviceIsTransient: NO
ignored: NO
deviceIsBusy: NO
deviceIsActivated: YES
deviceActivationState: Activated
deviceType: <0x7fc5f5e607f0 xcode.devicetype.iphone>
supportedDeviceFamilies: (
1
)
applications: (null)
provisioningProfiles: (null)
activityProgress: -2
activityTitle:

hasInternalSupport: NO
isSupportedOS: YES
developerDiskMountError: (null)
(null)
} (10.0.1 (14A403))

xctest-client.js:171:14 [master] pid:12516 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:12516 writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/sv/0x5js8lj6k1gbk3gv45k171w0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/d40c6571a14c026f3c9845448b045354/bb1f6c5abfef652ef6b087f434acb8de105b90d4/ManifestCache.plist

xctest-client.js:171:14 [master] pid:12516 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:12516 2017-01-13 17:54:50.908 xcodebuild[12522:404330] Error Domain=com.apple.dtdevicekit Code=-402652994 "App installation failed" UserInfo={NSLocalizedFailureReason=This application's application-identifier entitlement does not match that of the installed application. These values must match for an upgrade to be allowed., com.apple.dtdevicekit.stacktrace=(
0 DTDeviceKitBase 0x000000010bf0137b DTDKCreateNSError + 113
1 DTDeviceKitBase 0x000000010bf01ab9 DTDK_AMDErrorToNSError + 791
2 DTDeviceKitBase 0x000000010bf419df __90-[DTDKRemoteDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 158
3 DVTFoundation 0x000000010310e989 DVTInvokeWithStrongOwnership + 75
4 DTDeviceKitBase 0x000000010bf41725 -[DTDKRemoteDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1181
5 IDEiOSSupportCore 0x000000010be37e1f __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.336 + 4597
6 DVTFoundation 0x0000000103232cb7 __DVTDispatchAsync_block_invoke + 827
7 libdispatch.dylib 0x00007fffd29b3f5f _dispatch_call_block_and_release + 12
8 libdispatch.dylib 0x00007fffd29ab128 _dispatch_client_callout + 8
9 libdispatch.dylib 0x00007fffd29c1b97 _dispatch_queue_serial_drain + 896
10 libdispatch.dylib 0x00007fffd29b3d41 _dispatch_queue_invoke + 1046
11 libdispatch.dylib 0x00007fffd29acee0 _dispatch_root_queue_drain + 476
12 libdispatch.dylib 0x00007fffd29accb7 _dispatch_worker_thread3 + 99
13 libsystem_pthread.dylib 0x00007fffd2bf8736 _pthread_wqthread + 1299
14 libsystem_pthread.dylib 0x00007fffd2bf8211 start_wqthread + 13
), NSLocalizedRecoverySuggestion=This application's application-identifier entitlement does not match that of the installed application. These values must match for an upgrade to be allowed., NSLocalizedDescription=App installation failed}
2017-01-13 17:54:50.908 xcodebuild[12522:404330] Error Domain=IDETestOperationsObserverErrorDomain Code=5 "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:171:14 [master] pid:12516 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:12516
Testing failed:

xctest-client.js:171:14 [master] pid:12516 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:12516 Test target WebDriverAgentRunner encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **

xctest-client.js:171:14 [master] pid:12516 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:267:14 [master] pid:12516 killing deviceLogProc pid: 12519
xctest-client.js:272:14 [master] pid:12516 killing runnerProc pid: 12522
xctest-client.js:278:14 [master] pid:12516 killing iproxyProc pid: 12521
xctest-client.js:181:14 [master] pid:12516 xctest client exit with code: 65, signal: null
xctest-client.js:145:16 [master] pid:12516 deviceconsole exit with code: null, signal: SIGKILL
xctest-client.js:255:14 [master] pid:12516 Fail to start xctest: undefined
app-inspector:66:44 [master] pid:12516 undefined
(node:12516) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: >> app-inspector:66:44 [master] pid:12516 undefined
(node:12516) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
xctest-client.js:209:14 [master] pid:12516 iproxy exit with code: null, signal: SIGKILL

#76楼 @lynn_qin 你的报错日志里有我说的“Please check project...”


请问你试过我后面说的步骤了么?Xcode打开工程后bundle id确认过了么?建议跑app-inspector -u [udid] --verbose前先卸载掉原先安装的WebDriverAgent~

试过了, 两个文件的bundle id都修改过, 也build成功了。而且每次实验之前都是把之前的版本卸载掉的

#78楼 @lynn_qin 那我也不知道怎么回事了。。我这边现在使用都很正常了

@ u1449475793 我卸载了重装有又重新修改文件并build也成功了,但还是报这个错😭

#80楼 @lynn_qin 卸载后重装是运行app-inspector时自动安装的么?

不是, 是把macaca相关的都卸载了,重新装了一遍

@u1449475793 我知道了,我安装app-inspector的时候build inspector是失败的
一直没成功过 不知道是什么原因

求助:大神

终端输入macaca doctor之后出现这种情况,
怎么配置java_home,android_home?

#46楼 @junewang 你好,你的JAVA_HOME环境是怎么配置的?总是失败

#46楼 @junewang 你的问题解决了吗?我现在出现的问题跟你的一模一样的,怎么解决的?

app-inspector:66:44 [master] pid:1812 undefined
请问这是什么意思?

#75楼 @xdf @u1449475793 HI 你好,我按照你的办法解决了报错了,运行 app-inspector -u 设备udid MAC可以自动打开查看元素的页面,但是怎么能去查看我的被测APP的元素树呢?我打开了被测APP之后再打开inspector 也会返回到桌面,之后网页上显示的就是桌面上的元素了。。

#89楼 @yefnegjun 在网页上显示桌面上元素的前提下,再次打开目标APP,然后刷新网页不行么?手机端每次页面变化后,都需要重新刷新网页哦~

@lynn_qin 你的问题解决了么?我有和你一样的问题,求解决方法

93楼 已删除
xdf Macaca 升级策略调整 [2017-02] 中提及了此贴 02月17日 14:18
xdf uiautomator2.0 获取不到界面元素 中提及了此贴 02月19日 19:16

输入命令 app-inspector -u iosudid 然后报错,报错的信息好像是无法用adb启动这个设备,,求解

#83楼 @lynn_qin 请问你是怎么解决的 一开始跟你遇到的一模一样的问题 然后按照你们在上面的讨论都一一试过了, 可是你后来也没贴出来解决没有, 卡在这里几天了 😟 🙏

安卓模拟器,报这个错,请问有解吗?

  ~ app-inspector -u 127.0.0.1:62001
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
com.android.uiautomator.client.Initialize:
>> socket server ready
>> socket client ready
>> Android device started: 127.0.0.1:62001
>> inspector start at: http://192.168.31.20:5678
<-- GET /
recive: {"cmd":"getSource","args":{}}

return: {"data":{"value":true,"status":0},"success":true}

>> Dump Android XML success, save to /usr/local/lib/node_modules/app-inspector/.temp/android.json

TypeError: Cannot read property 'node' of undefined
at Object.exports.dumpXMLAndScreenShot (/usr/local/lib/node_modules/app-inspector/lib/android.js:55:31)
at next (native)
at onFulfilled (/usr/local/lib/node_modules/app-inspector/node_modules/co/index.js:65:19)
at process._tickCallback (internal/process/next_tick.js:103:7)

<-- GET /favicon.ico
--> GET /favicon.ico 404

@xiguamaomaoqiu @Sandu1213 😷 我放弃了。。。换成了appium-ios-inspector
因为到最后都没解决

这工具定位很烂,也没人改改

Android inspector界面显示横屏是怎么回事?

app-inspector 1.2.22版本更新依然报错。如下:
INSTRUMENTATION_STATUS: numtests=1

INSTRUMENTATION_STATUS: stream=
Error in testStartServer:
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.android.uiautomator.client.CommandBase.execute(org.json.JSONObject)' on a null object reference
at com.android.uiautomator.client.Command.handleInput(Command.java:49)
at com.android.uiautomator.client.SocketServer.listen(SocketServer.java:60)
at com.android.uiautomator.client.Initialize.testStartServer(Initialize.java:28)
at com.android.uiautomator.testrunner.UiAutomatorTestRunner.start(UiAutomatorTestRunner.java:160)
at com.android.uiautomator.testrunner.UiAutomatorTestRunner.run(UiAutomatorTestRunner.java:96)
at com.android.commands.uiautomator.RunTestCommand.run(RunTestCommand.java:91)
at com.android.commands.uiautomator.Launcher.main(Launcher.java:83)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:251)

INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
INSTRUMENTATION_STATUS: test=testStartServer
INSTRUMENTATION_STATUS: class=com.android.uiautomator.client.Initialize
INSTRUMENTATION_STATUS: stack=java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.android.uiautomator.client.CommandBase.execute(org.json.JSONObject)' on a null object reference
at com.android.uiautomator.client.Command.handleInput(Command.java:49)
at com.android.uiautomator.client.SocketServer.listen(SocketServer.java:60)
at com.android.uiautomator.client.Initialize.testStartServer(Initialize.java:28)
at com.android.uiautomator.testrunner.UiAutomatorTestRunner.start(UiAutomatorTestRunner.java:160)
at com.android.uiautomator.testrunner.UiAutomatorTestRunner.run(UiAutomatorTestRunner.java:96)
at com.android.commands.uiautomator.RunTestCommand.run(RunTestCommand.java:91)
at com.android.commands.uiautomator.Launcher.main(Launcher.java:83)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:251)

INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS_CODE: -1

INSTRUMENTATION_STATUS: stream=
Test results for WatcherResultPrinter=.E
Time: 0.52

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

INSTRUMENTATION_STATUS_CODE: -1

求助,我的appium1.6.4-beta和app-inspector都遇到了这个问题,按#75楼的方法没解决。
@u1449475793 @lynn_qin
环境:
Xcode:8.3
OSX:10.12.3
iPhone:10.3
npm:4.1.2
node: 7.7.1
app-inspector: 1.2.23
appium:1.6.4-beta
我更新了DEVELOPMENT_TEAM_ID且参考 https://testerhome.com/topics/6507https://github.com/appium/appium/issues/7066 都没有解决。

Macbook $ app-inspector -u e01d730b625c83ad877fb699701bc35ea3e800ec --verbose
>> server.js:16:12 [master] pid:15055 server start with config:
{ port: 5678,
verbose: true,
udid: 'e01d730b625c83ad877fb699701bc35ea3e800ec',
ip: '192.168.199.187',
host: 'Macbook-Air.local',
loaded_time: '2017-04-05 16:11:59' }
>> app-inspector.js:42:10 [master] pid:15055 server start at: http://192.168.199.187:5678
>> xctest-client.js:56:14 [master] pid:15055 project path: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
>> xctest-client start with port: 8900
>> xctest-client.js:233:14 [master] pid:15055 xcode version: 8.3
>> WebDriverAgent version: 1.1.4
>> xctest-client.js:170:14 [master] pid:15055 2017-04-05 16:12:00.966 xcodebuild[15061:180065] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/xiaoxue/Library/Developer/Xcode/DerivedData/WebDriverAgent-ceakatlydgitcjebccsbdhchgrpn/Logs/Test/C8410ABE-7B7D-4BC9-9C2B-164C8FC8BF93/Session-WebDriverAgentRunner-2017-04-05_161200-jXjtOI.log

>> xctest-client.js:171:14 [master] pid:15055 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
>> xctest-client.js:170:14 [master] pid:15055 2017-04-05 16:12:00.966 xcodebuild[15061:180059] [MT] IDETestOperationsObserverDebug: (0B81C369-7C6E-418B-B384-10B7618E1E72) Beginning test session WebDriverAgentRunner-0B81C369-7C6E-418B-B384-10B7618E1E72 at 2017-04-05 16:12:00.966 with Xcode 8E162 on target <DVTiOSDevice: 0x7fa024135640> {
deviceSerialNumber: F18PJBB1G5MQ
identifier: e01d730b625c83ad877fb699701bc35ea3e800ec
deviceClass: iPhone
deviceName: iPhone 6
deviceIdentifier: e01d730b625c83ad877fb699701bc35ea3e800ec
productVersion: 10.3
buildVersion: 14E277
deviceSoftwareVersion: 10.3 (14E277)
deviceArchitecture: arm64
deviceTotalCapacity: 12242530304
deviceAvailableCapacity: 6803267584
deviceIsTransient: NO
ignored: NO
deviceIsBusy: NO
deviceIsActivated: YES
deviceActivationState: Activated
isPasscodeLocked: NO
deviceType: <DVTDeviceType:0x7fa023ba9a80 Xcode.DeviceType.iPhone>
supportedDeviceFamilies: (
1
)
applications: (null)
provisioningProfiles: (null)
activityProgress: -2
activityTitle:
hasInternalSupport: NO
isSupportedOS: YES
developerDiskMountError: (null)
(null)
bootArgs: <unavailable>
} (10.3 (14E277))

>> xctest-client.js:171:14 [master] pid:15055 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
>> xctest-client.js:170:14 [master] pid:15055 MDMCreateDeltaDirectory:1920 calling MDMDirectoryDiff with:
state->old_bundle: /var/folders/f3/fsxd3f315vg22yc0997bxrl00000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/d1223d9c623a1a7f824cae92774bd47a/e01d730b625c83ad877fb699701bc35ea3e800ec/WebDriverAgentRunner-Runner.app
state->new_bundle: /Users/xiaoxue/Library/Developer/Xcode/DerivedData/WebDriverAgent-ceakatlydgitcjebccsbdhchgrpn/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app
state->dst_bundle: /var/folders/f3/fsxd3f315vg22yc0997bxrl00000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.Hj9Hh6/WebDriverAgentRunner-Runner.app_sparse.ipa/Payload//WebDriverAgentRunner-Runner.app, binaryDiff flag: FALSE
dst_ipa: /var/folders/f3/fsxd3f315vg22yc0997bxrl00000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.Hj9Hh6/WebDriverAgentRunner-Runner.app_sparse.ipa

>> xctest-client.js:171:14 [master] pid:15055 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
>> xctest-client.js:170:14 [master] pid:15055 __MDMDirectoryDiff_block_invoke.37:1473 calling writeDictToFile with: /var/folders/f3/fsxd3f315vg22yc0997bxrl00000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.Hj9Hh6/WebDriverAgentRunner-Runner.app_sparse.ipa/ManifestCache.plist

>> xctest-client.js:171:14 [master] pid:15055 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
>> xctest-client.js:170:14 [master] pid:15055 writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/f3/fsxd3f315vg22yc0997bxrl00000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.Hj9Hh6/WebDriverAgentRunner-Runner.app_sparse.ipa/ManifestCache.plist

>> xctest-client.js:171:14 [master] pid:15055 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
>> xctest-client.js:170:14 [master] pid:15055 2017-04-05 16:12:08.004 xcodebuild[15061:180059] 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:171:14 [master] pid:15055 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
>> xctest-client.js:170:14 [master] pid:15055
Testing failed:
Test target WebDriverAgentRunner encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)

>> xctest-client.js:171:14 [master] pid:15055 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
>> xctest-client.js:170:14 [master] pid:15055 ** TEST FAILED **


>> xctest-client.js:171:14 [master] pid:15055 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
>> xctest-client.js:265:14 [master] pid:15055 killing deviceLogProc pid: 15058
>> xctest-client.js:270:14 [master] pid:15055 killing runnerProc pid: 15061
>> xctest-client.js:276:14 [master] pid:15055 killing iproxyProc pid: 15060
>> xctest-client.js:181:14 [master] pid:15055 xctest client exit with code: 65, signal: null
>> xctest-client.js:145:16 [master] pid:15055 deviceconsole exit with code: null, signal: SIGKILL
>> xctest-client.js:257:14 [master] pid:15055 Fail to start xctest: undefined
>> app-inspector:66:44 [master] pid:15055 undefined
(node:15055) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: >> app-inspector:66:44 [master] pid:15055 undefined
(node:15055) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
>> xctest-client.js:209:14 [master] pid:15055 iproxy exit with code: null, signal: SIGKILL
laiyuncong8404 MacOs 环境安装配置 macaca 总结记 中提及了此贴 04月05日 17:39

你好 ,有遇到这样的问题吗。环境检查都是i 正常的,安装时候提示安卓环境设置的错误直接忽略了(只需要ios环境)。
运行会报如下图错误,并且卡死在这里

Xcode:8.3
OSX:10.12.4
iPhone:10.1.1
npm:4.2.0
node: v7.8.0
app-inspector: 1.2.23
appium:1.6.3



junewang 回复

你好,你这个问题好了吗。我是配置了java环境,没有配置安卓环境,只需要用iOS。
然后也是提示类似错误,请问你的解决了吗

CamillaDan 回复

你好,你问题解决了吗。我现在也是同样的问题

app inspector在浏览器里可以录制脚本吗?appium图形界面是不是可以直接启动 inspector录制,命令行可以吗?感谢😀

CamillaDan 回复

我的也是,真机启动过后闪退,然后就这样了,你的解决了吗?

xdf 回复

嗯,看到了,现在在配置app inspector真机运行跑不起来报和66楼一样的错误,你那遇到过这种问题吗?

升级app-inspector 1.2.25,连不上手机了,有人碰到过吗

@tlllly 你的问题解决了吗,我是把app-inspector更新到1.2.27,出现了这个问题

TesterWang 回复

没有解决,我准备用appium的desktop版本去获取元素

tlllly 回复

@tlllly 我用的https://github.com/mykola-mokhnach/Appium-iOS-Inspector 这个工具,appium自带的,可以用

我早上app-inspector 升级到了1.2.27,也尝试了各种办法,macaca doctor也都没有问题。
运行命令 app-inspector -u XXXXX --verbose能看到显示5个swift编译失败
最后把xcode升级到最新版。
然后再运行,app-inspector终于又能用了!!!!!

ericzhang 回复

好坑,我的xcode是8.1,我的也是提示swift编译失败,去升级看看,谢谢。

xdf #119 · 2017年05月10日 作者

升级macaca-cli 执行macaca doctor 更新环境

ELes 回复

你好 我也是这个问题,请问解决了吗

@xdf 最新版的貌似是XCTestWD 这个可以不可以提两个要求 1.是会生成两个app 能不能合并成一个 2.source 只有json格式的能不能提供个xml的 非常感谢

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