Skip to content

Commit c0735da

Browse files
committed
Update instructions
1 parent 7e0f319 commit c0735da

File tree

1 file changed

+21
-10
lines changed
  • react-native-scripts/src/scripts

1 file changed

+21
-10
lines changed

react-native-scripts/src/scripts/start.js

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,27 @@ async function printServerInfo() {
6161
const settings = await ProjectSettings.readPackagerInfoAsync(process.cwd());
6262
// who knows why qrcode-terminal takes a callback instead of just returning a string
6363
const address = await UrlUtils.constructManifestUrlAsync(process.cwd());
64+
let emulatorHelp;
65+
if (process.platform === 'darwin') {
66+
emulatorHelp = `Press ${chalk.bold('a')} (Android) or ${chalk.bold('i')} (iOS) to start an emulator.`;
67+
} else {
68+
emulatorHelp = `Press ${chalk.bold('a')} to start an Android emulator.`;
69+
}
6470
qr.generate(address, qrCode => {
65-
log(
66-
`To view your app with live reloading, point the Expo app to this QR code.
67-
You'll find the QR scanner on the Projects tab of the app.
68-
71+
log(`
6972
${indent(qrCode, 2)}
7073
71-
Or enter this address in the Expo app's search bar:
74+
Your app is now running at URL: ${chalk.underline(chalk.cyan(address))}
75+
76+
${chalk.bold('View your app with live reloading:')}
7277
73-
${chalk.underline(chalk.cyan(address))}
78+
${chalk.underline('Android device:')}
79+
-> Point the Expo app to the QR code above.
80+
(You'll find the QR scanner on the Projects tab of the app.)
81+
${chalk.underline('iOS device:')}
82+
-> Press ${chalk.bold('s')} to email/text the app URL to your phone.
83+
${chalk.underline('Emulator:')}
84+
-> ${emulatorHelp}
7485
7586
Your phone will need to be on the same local network as this computer.
7687
For links to install the Expo app, please visit ${chalk.underline(chalk.cyan('https://expo.io'))}.
@@ -87,13 +98,13 @@ function printUsage() {
8798
}
8899
const { dim, bold } = chalk;
89100
const devMode = dev ? 'development' : 'production';
90-
const iosInfo = process.platform === 'win32'
91-
? dim('.')
92-
: `${dim(`, or`)} i ${dim(`to open iOS emulator.`)}`;
101+
const iosInfo = process.platform === 'darwin'
102+
? `${dim(`, or`)} i ${dim(`to open iOS emulator.`)}`
103+
: dim('.');
93104
log(
94105
`
95106
${dim(`\u203A Press`)} a ${dim(`to open Android device or emulator`)}${iosInfo}
96-
${dim(`\u203A Press`)} s ${dim(`to send the packager URL to your phone number or email address`)}
107+
${dim(`\u203A Press`)} s ${dim(`to send the app URL to your phone number or email address`)}
97108
${dim(`\u203A Press`)} q ${dim(`to display QR code.`)}
98109
${dim(`\u203A Press`)} r ${dim(`to restart packager, or`)} R ${dim(`to restart packager and clear cache.`)}
99110
${dim(`\u203A Press`)} d ${dim(`to toggle development mode. (current mode: ${bold(devMode)}${chalk.reset.dim(')')}`)}

0 commit comments

Comments
 (0)