How to use the xdl.ProjectSettings.readPackagerInfoAsync function in xdl

To help you get started, we’ve selected a few xdl 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 react-community / create-react-native-app / react-native-scripts / src / util / packager.js View on Github external
async function cleanUpPackager(projectDir) {
  const result = await Promise.race([
    Project.stopAsync(projectDir),
    new Promise((resolve, reject) => setTimeout(resolve, 1000, 'stopFailed')),
  ]);

  if (result === 'stopFailed') {
    // find RN packager pid, attempt to kill manually
    try {
      const { packagerPid } = await ProjectSettings.readPackagerInfoAsync(projectDir);
      process.kill(packagerPid);
    } catch (e) {
      process.exit(1);
    }
  }
}
github NervJS / taro / packages / taro-rn-runner / src / util / packager.js View on Github external
async function cleanUpPackager (projectDir) {
  const result = await Promise.race([
    Project.stopAsync(projectDir),
    new Promise((resolve, reject) => setTimeout(resolve, 1000, 'stopFailed'))
  ])

  if (result === 'stopFailed') {
    // find RN packager pid, attempt to kill manually
    try {
      const { packagerPid } = await ProjectSettings.readPackagerInfoAsync(projectDir)
      process.kill(packagerPid)
    } catch (e) {
      process.exit(1)
    }
  }
}
github react-community / create-react-native-app / react-native-scripts / src / scripts / start.js View on Github external
async function printServerInfo() {
  const settings = await ProjectSettings.readPackagerInfoAsync(process.cwd());
  // who knows why qrcode-terminal takes a callback instead of just returning a string
  const address = await UrlUtils.constructManifestUrlAsync(process.cwd());
  let emulatorHelp;
  if (process.platform === 'darwin') {
    emulatorHelp = `Press ${chalk.bold('a')} (Android) or ${chalk.bold('i')} (iOS) to start an emulator.`;
  } else {
    emulatorHelp = `Press ${chalk.bold('a')} to start an Android emulator.`;
  }
  qr.generate(address, qrCode => {
    log(`
${indent(qrCode, 2)}

Your app is now running at URL: ${chalk.underline(chalk.cyan(address))}

${chalk.bold('View your app with live reloading:')}
github NervJS / taro / packages / taro-rn-runner / src / index.js View on Github external
async function printServerInfo () {
  await ProjectSettings.readPackagerInfoAsync(projectDir)
  // who knows why qrcode-terminal takes a callback instead of just returning a string
  const address = await UrlUtils.constructManifestUrlAsync(projectDir)
  let emulatorHelp
  if (process.platform === 'darwin') {
    emulatorHelp = `Press ${chalk.bold('a')} (Android) or ${chalk.bold('i')} (iOS) to start an emulator.`
  } else {
    emulatorHelp = `Press ${chalk.bold('a')} to start an Android emulator.`
  }
  qr.generate(address, qrCode => {
    log(`
${indent(qrCode, 2)}
Your app is now running at URL: ${chalk.underline(chalk.cyan(address))}
${chalk.bold('View your app with live reloading:')}
  ${chalk.underline('Android device:')}
    -> Point the Expo app to the QR code above.
       (You'll find the QR scanner on the Projects tab of the app.)