How to use the @expo/osascript.execAsync function in @expo/osascript

To help you get started, we’ve selected a few @expo/osascript examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / expo-cli / packages / xdl / src / Simulator.ts View on Github external
export async function _isSimulatorInstalledAsync() {
  let result;
  try {
    result = (await osascript.execAsync('id of app "Simulator"')).trim();
  } catch (e) {
    console.error(
      "Can't determine id of Simulator app; the Simulator is most likely not installed on this machine",
      e
    );
    Logger.global.error(XCODE_NOT_INSTALLED_ERROR);
    return false;
  }
  if (
    result !== 'com.apple.iphonesimulator' &&
    result !== 'com.apple.CoreSimulator.SimulatorTrampoline'
  ) {
    console.warn(
      "Simulator is installed but is identified as '" + result + "'; don't know what that is."
    );
    Logger.global.error(XCODE_NOT_INSTALLED_ERROR);
github expo / expo-cli / packages / xdl / src / Simulator.ts View on Github external
export async function _isSimulatorRunningAsync() {
  let zeroMeansNo = (
    await osascript.execAsync(
      'tell app "System Events" to count processes whose name is "Simulator"'
    )
  ).trim();
  if (zeroMeansNo === '0') {
    return false;
  }

  return true;
}
github expo / expo-cli / packages / xdl / src / Simulator.ts View on Github external
export async function _quitSimulatorAsync() {
  return await osascript.execAsync('tell application "Simulator" to quit');
}

@expo/osascript

Tools for running an osascripts in Node

MIT
Latest version published 25 days ago

Package Health Score

89 / 100
Full package analysis