Appium fruitstrap 命令检测 app 是否安装变得很不稳定

云飞凌风 · 2015年03月30日 · 最后由 云飞凌风 回复于 2015年04月03日 · 1467 次阅读

在用真机运行 appium 进行测试时,最近老是提示 app 没有安装,但有时能够提示 app 已经安装了。
目前 fruitstrap 命令也变的不稳定了么?
请问大家有遇到这样的问题吗?
如下,第一次就可以提示 app is installed
第二次就提示错误,说是 app 没有安装。

pptest1tekiMac-10:~ pptest1$ sudo /usr/local/lib/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id a0ee9c874742cdd4bef1b43f148fe72068c58265 --bundle com.25pp.ppappinstaller2
[....] Waiting for iOS device to be connected
found device id
found device id
[  0%] Found device (a0ee9c874742cdd4bef1b43f148fe72068c58265), beginning check
App is installed!
[100%] Check completed com.25pp.ppappinstaller2
pptest1tekiMac-10:~ pptest1$ sudo /usr/local/lib/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id a0ee9c874742cdd4bef1b43f148fe72068c58265 --bundle com.25pp.ppappinstaller2
[....] Waiting for iOS device to be connected
found device id
[  0%] Found device (a0ee9c874742cdd4bef1b43f148fe72068c58265), beginning check
App is installed!
Assertion failed: (AMDeviceStartService(device, CFSTR("com.apple.afc"), &afcFd, NULL) == 0), function handle_device, file fruitstrap.c, line 523.
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 10 条回复 时间 点赞

有点奇怪啊,怎么两个都有App is installed!这个 log?
google 了一下,貌似是ios-deploy的问题:
https://github.com/phonegap/ios-deploy/issues/11

#1 楼 @chenhengjie123 其实不是,那是 fruitstrap 在检测是否安装 。beginning check App is installed!

#3 楼 @chenhengjie123
为什么 ./fruitstrap -b /Users/yunfeiyang/Downloads/AppInstall.app 命令找出来的(found device)设备 UDID 跟我当前连接电脑的设备的 UDID 不一样呢?
下面找出来的两个 UDID 都不是跟我当前所连接的设备的 UDID 一样。

------ Install phase ------
[....] Waiting for iOS device to be connected
[  0%] Found device (7a04b819614dd6238888c90accebc0c6a6435612), beginning install
Assertion failed: (AMDeviceStartService(device, CFSTR("com.apple.afc"), &afcFd, NULL) == 0), function handle_device, file fruitstrap.c, line 488.

------ Install phase ------
[....] Waiting for iOS device to be connected
[  0%] Found device (acdb587858d0619c05953f2209b04b3a6b86326b), beginning install
Assertion failed: (AMDeviceStartService(device, CFSTR("com.apple.afc"), &afcFd, NULL) == 0), function handle_device, file fruitstrap.c, line 488.
Abort trap: 6

#4 楼 @wangcityboy 你的 udid 是什么?你用xcodebuild -showsdks看看输出结果里有没有你插上的设备?

#5 楼 @chenhengjie123
我的设备 udid 是:

124531c7df6aec70b297ba79bdb2232c522e41a

输入命令后:

PPdeMacBook:fruitstrap yunfeiyang$ xcodebuild -showsdks
OS X SDKs:
    OS X 10.9                       -sdk macosx10.9
    OS X 10.10                      -sdk macosx10.10

iOS SDKs:
    iOS 8.1                         -sdk iphoneos8.1

iOS Simulator SDKs:
    Simulator - iOS 8.1             -sdk iphonesimulator8.1

可以看的出来,我的设备已经连接电脑了,可以在 itunes 中可以看得到我插入的设备。

#6 楼 @wangcityboy 这就奇怪了,我目前没遇见过。
你指定device_id能装上吗(fruitstrap -b <app> [device_id]
实在不行用ios-deploy来装吧。

#7 楼 @chenhengjie123
我发现 fruitstrap 跟 ifuse 的安装会起冲动,如果系统中不安装 ifuse 就没问题,如果安装了 ifuse,就会导致 fruitstrap 的命令无法检测或者报错,如上面提到的那样。
主要是在通过 appium 启动测试应用时,会用到 fruitstrap,所以没办法更改用 ios-deploy

#8 楼 @wangcityboy Oh,软件冲突这个确实比较麻烦。
有可能是 ifuse 的依赖库和 fruitstrap 有什么冲突。。。

appium 1.4.0 dmg 已经木有这个问题啦~(≧▽≦)/~

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