Use full emulator path when running it
Summary: This is required on linux or it isn't found. It's already done elsewhere this way. Reviewed By: passy Differential Revision: D14303606 fbshipit-source-id: 8b3fca776d43076cdc2f814de19b0b381350dcc9
This commit is contained in:
committed by
Facebook Github Bot
parent
d8a1a80338
commit
fac138ded3
@@ -12,6 +12,8 @@ import type BaseDevice from '../devices/BaseDevice';
|
|||||||
import type {Logger} from '../fb-interfaces/Logger.js';
|
import type {Logger} from '../fb-interfaces/Logger.js';
|
||||||
import {registerDeviceCallbackOnPlugins} from '../utils/onRegisterDevice.js';
|
import {registerDeviceCallbackOnPlugins} from '../utils/onRegisterDevice.js';
|
||||||
import {getAdbClient} from '../utils/adbClient';
|
import {getAdbClient} from '../utils/adbClient';
|
||||||
|
import {default as which} from 'which';
|
||||||
|
import {promisify} from 'util';
|
||||||
|
|
||||||
function createDevice(
|
function createDevice(
|
||||||
adbClient: any,
|
adbClient: any,
|
||||||
@@ -62,20 +64,22 @@ function getRunningEmulatorName(id: string): Promise<?string> {
|
|||||||
export default (store: Store, logger: Logger) => {
|
export default (store: Store, logger: Logger) => {
|
||||||
const watchAndroidDevices = () => {
|
const watchAndroidDevices = () => {
|
||||||
// get emulators
|
// get emulators
|
||||||
child_process.exec(
|
promisify(which)('emulator').then(emulatorPath => {
|
||||||
'emulator -list-avds',
|
child_process.exec(
|
||||||
(error: ?Error, data: ?string) => {
|
`${emulatorPath} -list-avds`,
|
||||||
if (error != null || data == null) {
|
(error: ?Error, data: ?string) => {
|
||||||
console.error(error || 'Failed to list AVDs');
|
if (error != null || data == null) {
|
||||||
return;
|
console.error(error || 'Failed to list AVDs');
|
||||||
}
|
return;
|
||||||
const payload = data.split('\n').filter(Boolean);
|
}
|
||||||
store.dispatch({
|
const payload = data.split('\n').filter(Boolean);
|
||||||
type: 'REGISTER_ANDROID_EMULATORS',
|
store.dispatch({
|
||||||
payload,
|
type: 'REGISTER_ANDROID_EMULATORS',
|
||||||
});
|
payload,
|
||||||
},
|
});
|
||||||
);
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
getAdbClient()
|
getAdbClient()
|
||||||
.then(client => {
|
.then(client => {
|
||||||
|
|||||||
Reference in New Issue
Block a user