How to use the appium-xcode.getPath function in appium-xcode

To help you get started, we’ve selected a few appium-xcode 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 appium / appium-ios-simulator / lib / simulator-xcode-6.js View on Github external
async startUIClient (opts = {}) {
    opts = Object.assign({
      scaleFactor: null,
      connectHardwareKeyboard: false,
      startupTimeout: this.startupTimeout,
    }, opts);

    const simulatorApp = path.resolve(await getXcodePath(), 'Applications', this.simulatorApp);
    const args = ['-Fn', simulatorApp, '--args', '-CurrentDeviceUDID', this.udid];

    if (opts.scaleFactor) {
      const stat = await this.stat();
      const formattedDeviceName = stat.name.replace(/\s+/g, '-');
      const argumentName = `-SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.${formattedDeviceName}`;
      args.push(argumentName, opts.scaleFactor);
    }

    if (_.isBoolean(opts.connectHardwareKeyboard)) {
      args.push('-ConnectHardwareKeyboard', opts.connectHardwareKeyboard ? '1' : '0');
    }

    log.info(`Starting Simulator UI with command: open ${args.join(' ')}`);
    try {
      await exec('open', args, {timeout: opts.startupTimeout});