Add architecture and sdk version information

Summary: This diff adds abilist and sdk version information in the AndroidDevice.

Reviewed By: mweststrate

Differential Revision: D22210225

fbshipit-source-id: cda3dea9d89fdaa62a08aa000c93e39177c67bdd
This commit is contained in:
Pritesh Nandgaonkar
2020-06-25 04:24:03 -07:00
committed by Facebook GitHub Bot
parent ca64e2455a
commit dafe493930
2 changed files with 17 additions and 1 deletions

View File

@@ -21,10 +21,14 @@ export default class AndroidDevice extends BaseDevice {
deviceType: DeviceType,
title: string,
adb: ADBClient,
abiList: Array<string>,
sdkVersion: string,
) {
super(serial, deviceType, title, 'Android');
this.adb = adb;
this.icon = 'icons/android.svg';
this.abiList = abiList;
this.sdkVersion = sdkVersion;
this.adb.openLogcat(this.serial).then((reader) => {
reader.on('entry', (entry) => {
let type: LogLevel = 'unknown';
@@ -60,6 +64,8 @@ export default class AndroidDevice extends BaseDevice {
}
adb: ADBClient;
abiList: Array<string> = [];
sdkVersion: string | undefined = undefined;
pidAppMapping: {[key: number]: string} = {};
private recordingProcess?: Promise<string>;

View File

@@ -36,6 +36,9 @@ function createDevice(
.then(async (props) => {
try {
let name = props['ro.product.model'];
const abiString = props['ro.product.cpu.abilist'];
const sdkVersion = props['ro.build.version.sdk'];
const abiList = abiString.length > 0 ? abiString.split(',') : [];
if (type === 'emulator') {
name = (await getRunningEmulatorName(device.id)) || name;
}
@@ -44,7 +47,14 @@ function createDevice(
);
const androidLikeDevice = new (isKaiOSDevice
? KaiOSDevice
: AndroidDevice)(device.id, type, name, adbClient);
: AndroidDevice)(
device.id,
type,
name,
adbClient,
abiList,
sdkVersion,
);
if (ports) {
await androidLikeDevice
.reverse([ports.secure, ports.insecure])