From f891985bd853f1732c6d77ee02e5d019190ef04b Mon Sep 17 00:00:00 2001 From: jrodiger Date: Thu, 23 Mar 2017 18:11:30 -0700 Subject: [PATCH] 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 https://github.com/facebook/react-native/pull/12755 Differential Revision: D4767321 fbshipit-source-id: a14f369ba99939aa44d0ee3403e1d262e2657e6e --- local-cli/runAndroid/runAndroid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local-cli/runAndroid/runAndroid.js b/local-cli/runAndroid/runAndroid.js index 815c8ebaa74..5cc2b13bc9f 100644 --- a/local-cli/runAndroid/runAndroid.js +++ b/local-cli/runAndroid/runAndroid.js @@ -265,7 +265,7 @@ function startServerInNewWindow() { } else if (/^win/.test(process.platform)) { procConfig.detached = true; procConfig.stdio = 'ignore'; - return child_process.spawn('cmd.exe', ['/C', 'start', launchPackagerScript], procConfig); + return child_process.spawn('cmd.exe', ['/C', launchPackagerScript], procConfig); } else { console.log(chalk.red(`Cannot start the packager. Unknown platform ${process.platform}`)); }