大佬教程收集整理的这篇文章主要介绍了在Xcode中停止应用程序时自动关闭iOS模拟器,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_404_11@
#!/bin/sh osascript -e 'tell app "iPhone Simulator" to quit'@H_404_11@保存此文件,然后打开Xcode首选项的行为部分,在运行完成部分将脚本文件添加到运行部分.
@H_404_11@你不是在制作OS X应用程序太糟糕了,因为这样做非常容易.这部分是无关紧要的,但谁知道,您将来可以使用它!
@H_404_11@
- (IBACtion)KillSim:(id)sender { NSLog (@"Sim Kill Begin"); NSDictionary* errorDict; NSAppleEventDescriptor* returnDescriptor = NULL; NSAppleScript* scriptObject = [[NSAppleScript alloc] initWithsource: @"tell application \"iPhone Simulator\" to quit"]; returnDescriptor = [scriptObject executeAndReturnError: &errorDict]; [scriptObject release]; if (returnDescriptor != NULL) { // successful execution if (kAENullEvent != [returnDescriptor descriptorType]) { // script returned an AppleScript result if (cAEList == [returnDescriptor descriptorType]) { // result is a list of other descriptors } else { // coerce the result to the appropriate ObjC type } } } else { // no script result,handle error here } NSLog (@"Sim Killed End"); }
以上是大佬教程为你收集整理的在Xcode中停止应用程序时自动关闭iOS模拟器全部内容,希望文章能够帮你解决在Xcode中停止应用程序时自动关闭iOS模拟器所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。