Fix launchChrome for chromium on Ubuntu

Summary:
On Ubuntu (and maybe other distros), the executable for the chromium browser is 'chromium-browser' instead of 'chromium'.
This commit calls 'chromium-browser' before calling 'chromium' if it exists.

Start an example app on Android with "react-native init project && react-native run-android". Open DevTools: it opens chromium correctly.

[CLI] [BUGFIX] [local-cli/server/utils/launchChrome.js] - Fix launchChrome for chromium on Ubuntu
Closes https://github.com/facebook/react-native/pull/16658

Differential Revision: D6241686

Pulled By: hramos

fbshipit-source-id: 5cd435c3c42c29f0916679298e62e7a323468e37
This commit is contained in:
Nicolas Feignon 2017-11-04 11:50:00 -07:00 committed by Facebook Github Bot
parent 9476730cc4
commit 758111a706
1 changed files with 2 additions and 0 deletions

View File

@ -36,6 +36,8 @@ function getChromeAppName(): string {
case 'linux':
if (commandExistsUnixSync('google-chrome')) {
return 'google-chrome';
} else if (commandExistsUnixSync('chromium-browser')) {
return 'chromium-browser';
} else {
return 'chromium';
}