How to use the node-simctl.launch function in node-simctl

To help you get started, we’ve selected a few node-simctl 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 / test / functional / simulator-e2e-specs.js View on Github external
it('should find both a data and bundle directory for TestApp', async function () {
      let sim = await getSimulator(udid);
      await sim.run({startupTimeout: LONG_TIMEOUT});

      // install & launch test app
      await installApp(sim, app);
      await simctl.launch(udid, BUNDLE_ID);

      let dirs = await sim.getAppDirs('TestApp', BUNDLE_ID);
      dirs.should.have.length(2);
      dirs[0].should.contain('/Data/');
      dirs[1].should.contain('/Bundle/');

      await sim.getUserInstalledBundleIdsByBundleName('TestApp').should.eventually.not.empty;
    });
github appium / appium-ios-simulator / test / functional / simulator-e2e-specs.js View on Github external
console.log('Application installed'); // eslint-disable-line no-console

      (await sim.isAppInstalled(BUNDLE_ID)).should.be.true;

      // this remains somewhat flakey
      await retryInterval(5, 1000, async () => {
        await simctl.launch(udid, BUNDLE_ID, 1);
      });

      console.log('Application launched'); // eslint-disable-line no-console

      await sim.removeApp(BUNDLE_ID);

      // should not be able to launch anymore
      await simctl.launch(udid, BUNDLE_ID, 1)
        .should.eventually.be.rejectedWith(error);

      (await sim.isAppInstalled(BUNDLE_ID)).should.be.false;

      console.log('Test case finished'); // eslint-disable-line no-console
    });
github electrode-io / electrode-native / ern-local-cli / src / lib / miniapp.js View on Github external
// but we just care about launching simulator with chosen UDID
    }

    if (!fs.existsSync('ios')) {
      log.info(`Generating runner iOS project`)
      await generateRunner(runnerConfig)
    } else {
      log.info(`Re-generating runner container`)
      await generateContainerForRunner(runnerConfig)
    }

    const device = answer.device
    shell.cd(`${this.path}/ios`)
    execSync(`xcodebuild -scheme ErnRunner -destination 'platform=iOS Simulator,name=${device.name}' SYMROOT="${this.path}/ios/build" build`)
    await simctl.installApp(device.udid, `${this.path}/ios/build/Debug-iphonesimulator/ErnRunner.app`)
    await simctl.launch(device.udid, 'com.yourcompany.ernrunner')
  }
github appium / appium-ios-simulator / test / functional / simulator-e2e-specs.js View on Github external
await retryInterval(5, 1000, async () => {
        await simctl.launch(udid, BUNDLE_ID, 1);
      });
github appium / appium-xcuitest-driver / lib / driver.js View on Github external
async launchApp () {
    const APP_LAUNCH_TIMEOUT = 20 * 1000;

    this.logEvent('appLaunchAttempted');
    await launch(this.opts.device.udid, this.opts.bundleId);

    let checkStatus = async () => {
      let response = await this.proxyCommand('/status', 'GET');
      let currentApp = response.currentApp.bundleID;
      if (currentApp !== this.opts.bundleId) {
        throw new Error(`${this.opts.bundleId} not in foreground. ${currentApp} is in foreground`);
      }
    };

    log.info(`Waiting for '${this.opts.bundleId}' to be in foreground`);
    let retries = parseInt(APP_LAUNCH_TIMEOUT / 200, 10);
    await retryInterval(retries, 200, checkStatus);
    log.info(`${this.opts.bundleId} is in foreground`);
    this.logEvent('appLaunched');
  }
github electrode-io / electrode-native / ern-util / src / ios.js View on Github external
export async function launchApplication (deviceUdid: string, bundleId: string) {
  return simctl.launch(deviceUdid, bundleId)
}