
#!/bin/shosascript -e 'tell app "iPhone Simulator" to quit'
保存此文件,然后打开Xcode首选项的行为部分,在运行完成部分将脚本文件添加到运行部分.
希望这对你有用,但是这种方法似乎有点不稳定,不幸的是我能想出的最好的方法!
祝好运!
你不是在制作OS X应用程序太糟糕了,因为这样做非常容易.这部分是无关紧要的,但谁知道,您将来可以使用它!
- (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模拟器所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)