Fix emulator usage on linux
Summary: emulator isn't on the path in CI machines, but we already have ANDROID_HOME set so we can work out where it is. Reviewed By: danielbuechele Differential Revision: D15080422 fbshipit-source-id: 2c50a3de27909d2bfc82ea0210d06a0cc32357d7
This commit is contained in:
committed by
Facebook Github Bot
parent
221bf1cc75
commit
a4164c89a0
@@ -40,6 +40,7 @@ class DevicesButton extends Component<Props> {
|
||||
// On Linux, you must run the emulator from the directory it's in because
|
||||
// reasons ...
|
||||
whichPromise('emulator')
|
||||
.catch(e => `${process.env.ANDROID_HOME || ''}/tools/emulator`)
|
||||
.then(emulatorPath => {
|
||||
const child = spawn(emulatorPath, [`@${name}`], {
|
||||
detached: true,
|
||||
|
||||
@@ -64,7 +64,9 @@ function getRunningEmulatorName(id: string): Promise<?string> {
|
||||
export default (store: Store, logger: Logger) => {
|
||||
const watchAndroidDevices = () => {
|
||||
// get emulators
|
||||
promisify(which)('emulator').then(emulatorPath => {
|
||||
promisify(which)('emulator')
|
||||
.catch(e => `${process.env.ANDROID_HOME || ''}/tools/emulator`)
|
||||
.then(emulatorPath => {
|
||||
child_process.exec(
|
||||
`${emulatorPath} -list-avds`,
|
||||
(error: ?Error, data: ?string) => {
|
||||
|
||||
Reference in New Issue
Block a user