Appium 官方 iOS 例子在 mac 上不能运行,模拟器和真机都报 error,是我哪里配置错了?

hunter · July 20, 2015 · Last by graice replied at July 21, 2015 · 1523 hits

android的例子我之前在windows上测试过,都没有问题,现在mac上从配置到运行都需要前辈帮我看看

mac 10.10.4,jdk 1.7.79,eclipse 4.4.2,appium 1.3.7 /1.4.1,Xcode6.3.3,selenium两个包为2.46和java-clinet2.1,都是maven自己下载的。iOS 模拟器是iPhone 6 8.3,真机是y(iPhone4 7.1.2)
只测试iOS,所以没有配置javahome,使用的是appium img安装包,所以没有单独安装nodejs。TestApp.app是我下载了例子工程在xcode里重新build的,真机上的TestApp我也已经用Xcode安装进去。

先问两个初级问题:
1.ipa文件不能用App Store里的,那么要用xcode用开发者证书build的?
2.我直接用的签名前的app文件,就是xcode里build后release目录下的app吗?

现在测试官方例子SimpleTest都不行,配置信息和错误log如下:
1.模拟器
appium

setup()

错误log,模拟器已经被正常启动,但是在首页面(Safari图标页面)下拉几下后就退出了

info: [IOS_SYSLOG_ROW ] Jul 20 09:58:02 TeddeMac-mini.local SpringBoard[437]: Unable to get pid for 'UIKitApplication:io.appium.TestApp[0xd784]': No such process (err 3)
info: [IOS_SYSLOG_ROW ] Jul 20 09:58:02 TeddeMac-mini.local SpringBoard[437]: Application 'UIKitApplication:io.appium.TestApp[0xd784]' exited voluntarily.

info: [IOS_SYSLOG_ROW ] Jul 20 09:58:02 TeddeMac-mini.local SpringBoard[437]: Unable to deliver -[UIRemoteApplication showTopMostMiniAlertWithSynchronizationPort:] message to port 0: (ipc/send) invalid destination port
info: [IOS_SYSLOG_ROW ] Jul 20 09:58:02 TeddeMac-mini com.apple.CoreSimulator.SimDevice.157CF203-4814-48C4-9382-E693418BB543.launchd_sim[423] (UIKitApplication:io.appium.TestApp[0xca48][491]): Program specified by service does not contain one of the requested architectures: "
info: [IOS_SYSLOG_ROW ] Jul 20 09:58:02 TeddeMac-mini.local SpringBoard[437]: Unable to get pid for 'UIKitApplication:io.appium.TestApp[0xca48]': No such process (err 3)
info: [IOS_SYSLOG_ROW ] Jul 20 09:58:02 TeddeMac-mini.local SpringBoard[437]: Application 'UIKitApplication:io.appium.TestApp[0xca48]' exited voluntarily.

info: [IOS_SYSLOG_ROW ] Jul 20 09:58:02 TeddeMac-mini assertiond[441]: assertion failed: 14E46 12F69: assertiond + 12334 [8E465C14-E4AE-36E9-AFBE-D28459602962]: 0x1

info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: Failed looking up pid of launched process

info: [debug] [INSTSERVER] Instruments exited with code 253

2.真机
appium

setup

错误log

info: [debug] Creating iDevice object with udid b2d4962079986582b389d7db432c9d8da1d7bae6
info: [debug] Couldn't find ideviceinstaller, trying built-in at /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller

error: Log capture did not start in a reasonable amount of time

info: [debug] Cleaning up appium session
info: [debug] Error: Could not initialize ideviceinstaller; make sure it is installed and works on your system
at [object Object].IOS.getIDeviceObj (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios.js:909:13)
at [object Object].IOS.installToRealDevice (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios.js:856:32)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:607:21
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:246:17
at iterate (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:146:13)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:157:25
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:248:21
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:612:34
at [object Object].<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios.js:1527:14)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/underscore/underscore.js:890:21
at [object Object]._onTimeout (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios-log.js:166:7)
at Timer.listOnTimeout (timers.js:110:15)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Could not initialize ideviceinstaller; make sure it is installed and works on your system)","origValue":"Could not initialize ideviceinstaller; make sure it is installed and works on your system"},"sessionId":null}
info: <-- POST /wd/hub/session 500 10059.953 ms - 300

error: Could not initialize ideviceinstaller; make sure it is installed and works on your system
error: Failed to start an Appium session, err was: Error: Could not initialize ideviceinstaller; make sure it is installed and works on your system
共收到 7 条回复 时间 点赞

error: Could not initialize ideviceinstaller; make sure it is installed and works on your system
百度一下。要copy个东西过去。

hunter #2 · July 20, 2015 作者

#1楼 @pighero001 是说的appium 1.3.7的idevice文件有问题,要重新从1.3.3copy一个过来? 我查过,1.3.7的里面要替换的文件其实是一个目录,根本就不是一个文件。我觉得网上写的不对,所以没有贸然替换

楼主ios测试是必须在mac机器上么?还有楼主学习这个ios测试都参考什么文档?我Android的会了,最近想学习ios的,一窍不通啊,不知道从哪里下手,望指点一二

在真机上测试要花钱么?
“IOS如果在真机测试需要申请apple developer team账户 并且下载证书?我去APPLE看了下,那个是不是要交99美元呀?

--是的”

hunter #4 · July 20, 2015 作者

#3楼 @nancy2896 我也不是太熟悉iOS上的测试方式,所以才想通过官方的小例子学习一下。你的关注一下这个问题,如果有人解答了我相信你的问题也能得到解答。

hunter #5 · July 20, 2015 作者

#3楼 @nancy2896 我也不是太熟悉iOS上的测试方式,所以才想通过官方的小例子学习一下。你的关注一下这个问题,如果有人解答了我相信你的问题也能得到解答。

hunter #6 · July 20, 2015 作者

Could not initialize ideviceinstaller 自问自答一记;github上有这个问题的描述,appium的作者解释了ideviceinstaller是系统环境所需的,并不在appium中,所以这个也不能算appium的bug吧,至少1.4.0和1.4.1仍存在这个问题。我去试试安装ideviceinstaller是否可以解决这个问题。

brew install ideviceinstaller
缺什么就install什么

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up