自动调用 iPhone 应用程序
是否可以通过 UIAutomation 调用 iPhone Simulator 并启动应用程序?如果是这样,是否可以通过shell脚本或Java调用UIAutomation脚本?
或者我可以通过 applescript 来做到这一点吗?谢谢
Is it possible to invoke iPhone Simulator and launch app through UIAutomation? If so, is it possible to invoke UIAutomation script through shell script or Java?
Or can I able to do this through applescript? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Xcode 是 Applescriptable 的。因此,您可以运行一个 shell 脚本,该脚本运行编译后的 AppleScript,该脚本运行 Xcode,并告诉它使用选定的模拟器构建和运行 iOS 应用程序,如果没有构建错误,该脚本应该启动模拟器并在模拟器中启动应用程序, ETC。
Xcode is Applescriptable. Thus you can run a shell script that runs a compiled AppleScript that runs Xcode and tells it to build and run an iOS app with the Simulator selected, which should start the Simulator and launch the app in the Simulator, if there are no build errors, etc.
是的。我们使用 Java 来启动 Instruments,运行 ApplesScript 来加载特定 Application\Device\Simulator 的 TraceTemplate,然后使用 AppleScript 来运行(记录)指定的 JavaScript。
我们已经实现了一个非常强大的自动化框架,用于使用完全“动态”测试脚本来测试 iOS 应用程序。它不需要越狱设备,也不需要将任何自动化支持库链接到正在测试的应用程序中。
SourceForge 上的 SAFSDEV!
这个开源项目有工作代码,它也是完成这些类型的事情所需的 Java、AppleScript 和 JavaScript 的很好的例子。目前它的编码支持 iOS 4.3.3 和 iOS 5。
Yes. We use Java to launch Instruments, run ApplesScript that will load a TraceTemplate for the specific Application\Device\Simulator, and then AppleScript to run (Record) a specified JavaScript.
We have implemented a very robust automation framework for testing iOS apps with entirely "dynamic" test scripting. It does not require jailbreaking the device, and it does not require linking any automation support libraries into the application being tested.
SAFSDEV on SourceForge!
This opensource project has working code which also serves as great examples of the Java, AppleScript, and JavaScript required to do these types of things. It is currently coded to support both iOS 4.3.3 and iOS 5.
嘿,可以使用以下命令来做到这一点
1.使用以下命令构建
xcodebuild -project myApps.xcodeproj -scheme myApps -configuration Debug -sdk iphonesimulator5.0 clean build
仪器 -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate /Users/sougata/Library/Application\ Support/iPhone\ Simulator/5.0/Applications/ 22667B7D-B4AF-4134-8C9A-44EEB60304A9/myApps.app/-e UIASCRIPT Regression.js -e UIARESULTSPATH ~/myreport
Hey it is possible to do that, using below commands
1.Build using the below command
xcodebuild -project myApps.xcodeproj -scheme myApps -configuration Debug -sdk iphonesimulator5.0 clean build
instruments -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate /Users/sougata/Library/Application\ Support/iPhone\ Simulator/5.0/Applications/22667B7D-B4AF-4134-8C9A-44EEB60304A9/myApps.app/ -e UIASCRIPT Regression.js -e UIARESULTSPATH ~/myreport