Skip to content

Commit f891985

Browse files
jrodigerfacebook-github-bot
authored andcommitted
Update runAndroid.js to fix startServerInNewWindow() (Windows)
Summary: **Motivation** Resolves issue: #12367. The issue is that the packager does not launch automatically on Windows when running `react-native run-android` like it does on OSX. The proposed change fixes this issue, and causes the packager to be launched automatically on Windows 10. Also note the updated code uses the syntax described in the [Node.js documentation](https://nodejs.org/api/all.html#child_process_spawning_bat_and_cmd_files_on_windows) on spawning .bat files on Windows. **Test plan** Manually tested on Windows 10. Running just `react-native run-android` now results in the packager launching, without needing to run `react-native start` in a new command prompt window. **Screenshot:** ![packager](https://cloud.githubusercontent.com/assets/17132071/23641540/8d82bb7c-02c2-11e7-9c47-d1c9b582bd65.png) Closes #12755 Differential Revision: D4767321 fbshipit-source-id: a14f369ba99939aa44d0ee3403e1d262e2657e6e
1 parent 9a88c72 commit f891985

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

local-cli/runAndroid/runAndroid.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ function startServerInNewWindow() {
265265
} else if (/^win/.test(process.platform)) {
266266
procConfig.detached = true;
267267
procConfig.stdio = 'ignore';
268-
return child_process.spawn('cmd.exe', ['/C', 'start', launchPackagerScript], procConfig);
268+
return child_process.spawn('cmd.exe', ['/C', launchPackagerScript], procConfig);
269269
} else {
270270
console.log(chalk.red(`Cannot start the packager. Unknown platform ${process.platform}`));
271271
}

0 commit comments

Comments
 (0)