我们在MAC OSX 10.7.3上使用sikuli工具进行移动自动化我编写了一个shell脚本来打开模拟器并在模拟器上运行脚本:
SikuliScript.sh
/Users/ezprintsqa/Downloads/FoneMonkey/bin/iphonesim launch /Users/ezprintsqa/Documents/Xcode/DerivedData/SnapCards-btmjdowsgmixpvdyfxfvhxtoihab/Build/Products/Debug-iphonesimulator/SnapCardsFoneMonkey.app&
/Users/ezprintsqa/Downloads/Sikuli-IDE.app/sikuli-ide.sh -r /Users/ezprintsqa/Downloads/SikuliWorkSpace/SnapcardsTestSuite1.sikuli
当我从命令行执行时,我可以看到模拟器打开,脚本在模拟器上执行。 但是当我从Jenkins运行时,我收到以下错误:
[JavaAppLauncher Error] CFBundleCopyResourceURL() failed loading MRJApp.properties file
[DEBUG] Could not start simulator session: Error Domain=DTiPhoneSimulatorErrorDomain Code=5 "Operation failed with underlying error 4294956486." UserInfo=0x100305c70 {NSLocalizedDescription=Operation failed with underlying error 4294956486., NSUnderlyingError=0x100300610 "The operation couldn’t be completed. (OSStatus error -10810.)"}
[LaunchRunner Error] No main class specified
[JavaAppLauncher Error] CallStaticVoidMethod() threw an exception
Exception in thread "main" java.lang.NullPointerException
at apple.launcher.LaunchRunner.run(LaunchRunner.java:113)
at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:51)
at apple.launcher.JavaApplicationLauncher.main(JavaApplicationLauncher.java:61)
任何建议都会非常有用
答案 0 :(得分:2)
它看起来像是一个许可问题。 Mac的官方Jenkins安装程序设置Jenkins以用户“守护进程”或用户“jenkins”运行。您需要使Jenkins所需的工具可由该用户读取和执行。此外,它们需要位于该用户可读和可执行的目录中。
但是,即使您修复了权限,您的测试运行也可能会有进一步的问题。适用于Mac的官方Jenkins安装程序设置Jenkins作为启动守护程序运行。它们在系统上下文中运行,并且它们无法访问任何桌面或GUI会话,这意味着无法在屏幕上绘制窗口=>任何显示窗口的工具,如iPhone模拟器或Sikuli都会失败。
您可以尝试我的非官方Jenkins.app,这应该可以解决您的问题。它可以在https://github.com/stisti/jenkins-app下载(在“下载”标签下下载。)