Initial support for KaiOS device plugins
Summary: Introduces basic KaiOSDevice class. Since kaios phones support adb, it is inherited from AndroidDevice Reviewed By: jknoxville Differential Revision: D17608605 fbshipit-source-id: 6b2c5834a1f5862b864c8e76202d0d401e58cbcc
This commit is contained in:
committed by
Facebook Github Bot
parent
1c9fc75457
commit
dda800c4a3
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
import AndroidDevice from '../devices/AndroidDevice';
|
||||
import KaiOSDevice from '../devices/KaiOSDevice';
|
||||
import child_process from 'child_process';
|
||||
import {Store} from '../reducers/index';
|
||||
import BaseDevice from '../devices/BaseDevice';
|
||||
@@ -33,11 +34,16 @@ function createDevice(
|
||||
if (type === 'emulator') {
|
||||
name = (await getRunningEmulatorName(device.id)) || name;
|
||||
}
|
||||
const androidDevice = new AndroidDevice(device.id, type, name, adbClient);
|
||||
const isKaiOSDevice = Object.keys(props).some(
|
||||
name => name.startsWith('kaios') || name.startsWith('ro.kaios'),
|
||||
);
|
||||
const androidLikeDevice = new (isKaiOSDevice
|
||||
? KaiOSDevice
|
||||
: AndroidDevice)(device.id, type, name, adbClient);
|
||||
if (ports) {
|
||||
androidDevice.reverse([ports.secure, ports.insecure]);
|
||||
androidLikeDevice.reverse([ports.secure, ports.insecure]);
|
||||
}
|
||||
resolve(androidDevice);
|
||||
resolve(androidLikeDevice);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user