简体   繁体   中英

Close Simulator from Xcode: Running AppleScript on iOS

I have an AppleScript that I setup to close the iOS simulator after X amount of time. I know that in objective-c using the Cocoa framework for a Mac app, I would just easily do:

NSString *scriptSource = @"tell application \"iOS Simulator\" to quit";
NSAppleScript *script = [[NSAppleScript alloc] initWithSource:scriptSource];
NSError *error = nil;

[script executeAndReturnError:&error];

Obviously I can't do this in iOS. Is there anything that will run my AppleScript in iOS? Or does anyone know of any workarounds or ways to do this?

Or, is there a way to close the iOS Simulator from within the app using natively Objective-C, another scripting language, or add it to the build phase?

No.

You can't run AppleScript on an iOS device.

And there is no way to quit the iOS simulator from an iOS app.

Sorry.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM