How to use the appium-ios-simulator.killAllSimulators function in appium-ios-simulator

To help you get started, we’ve selected a few appium-ios-simulator 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-xcuitest-driver / test / functional / helpers / simulator.js View on Github external
async function killAllSimulators () {
  if (process.env.CLOUD) {
    return;
  }

  const allDevices = _.flatMap(_.values(await getDevices()));
  const bootedDevices = allDevices.filter((device) => device.state === 'Booted');

  for (const {udid} of bootedDevices) {
    // It is necessary to stop the corresponding xcodebuild process before killing
    // the simulator, otherwise it will be automatically restarted
    await resetTestProcesses(udid, true);
    await shutdown(udid);
  }
  await simKill();
}
github appium-boneyard / appium-instruments / lib / instruments.js View on Github external
} catch (err) {
        log.error(`Error launching instruments: ${err.message}`);
        let errIsCatchable = err.message === ERR_NEVER_CHECKED_IN ||
                             err.message === ERR_CRASHED_ON_STARTUP;
        if (!errIsCatchable) {
          throw err;
        }
        if (launchTries <= this.flakeyRetries) {
          if (this.gotFBSOpenApplicationError) {
            log.debug('Got the FBSOpenApplicationError, not killing the ' +
                      'sim but leaving it open so the app will launch');
            this.gotFBSOpenApplicationError = false; // clear out for next launch
            await B.delay(1000);
          } else {
            if (!this.realDevice) {
              await killAllSimulators();
            }
            await B.delay(5000);
          }
        } else {
          log.errorAndThrow('We exceeded the number of retries allowed for ' +
                            'instruments to successfully start; failing launch');
        }
      }
    } while (true);
  }
github appium / appium-ios-driver / lib / instruments / instruments.js View on Github external
} catch (err) {
        log.error(`Error launching instruments: ${err.message}`);
        let errIsCatchable = err.message === ERR_NEVER_CHECKED_IN ||
                             err.message === ERR_CRASHED_ON_STARTUP;
        if (!errIsCatchable) {
          throw err;
        }
        if (launchTries <= this.flakeyRetries) {
          if (this.gotFBSOpenApplicationError) {
            log.debug('Got the FBSOpenApplicationError, not killing the ' +
                      'sim but leaving it open so the app will launch');
            this.gotFBSOpenApplicationError = false; // clear out for next launch
            await B.delay(1000);
          } else {
            if (!this.realDevice) {
              await killAllSimulators();
            }
            await B.delay(5000);
          }
        } else {
          log.errorAndThrow('We exceeded the number of retries allowed for ' +
                            'instruments to successfully start; failing launch');
        }
      }
    } while (true); // eslint-disable-line no-constant-condition
  }