Summary: Original commit changeset: 471470c5ca91 Original Phabricator Diff: D35356211 (501abc6b55) Recently, bloks users reported that android emulators lost connection upon launching Flipper. (S270689) Manual bisecting indicates that remote emulators won't crash on v0.142.362128844 (4/6) but crash on 0.143.365099607 (4/21). Looking at https://www.internalfb.com/code/fbsource/[history]/xplat/scripts/.flipperversion.v2, and backing out D35356211 (501abc6b55) fixes the issue. It's still unclear why setting `setIntoPermissiveMode` would crash/disconnect the android emulators, I'd defer Flipper team to investigate this further but this diff should unblock all the android bloks emulator + Flipper use case. Reviewed By: lblasa Differential Revision: D36263724 fbshipit-source-id: e8674730c0185457f6eda347ce7d9a41f9e1a2a4
80 lines
2.3 KiB
TypeScript
80 lines
2.3 KiB
TypeScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
declare module 'adbkit' {
|
|
export interface Device {
|
|
id: string;
|
|
type: 'emulator' | 'device' | 'offline';
|
|
}
|
|
|
|
interface Util {
|
|
readAll: (stream: NodeJS.ReadStream) => Promise<Buffer>;
|
|
}
|
|
|
|
// https://github.com/openstf/adbkit#pulltransfer
|
|
export interface PullTransfer extends NodeJS.WriteStream {
|
|
cancel: () => this;
|
|
on(
|
|
event: 'progress',
|
|
listener: (stats: {bytesTransferred: number}) => void,
|
|
): this;
|
|
on(event: 'error', listener: (err: Error) => void): this;
|
|
on(event: 'end', listener: () => void): this;
|
|
on(event: 'resize', listener: () => void): this;
|
|
}
|
|
|
|
interface DeviceTracker extends NodeJS.EventEmitter {
|
|
on(event: 'add', listener: (device: Device) => void): this;
|
|
on(event: 'remove', listener: (device: Device) => void): this;
|
|
on(event: 'change', listener: (device: Device) => void): this;
|
|
on(
|
|
event: 'changeSet',
|
|
listener: (changes: {
|
|
added: Device[];
|
|
removed: Device[];
|
|
changed: Device[];
|
|
}) => void,
|
|
): this;
|
|
on(event: 'error', listener: (err: Error) => void): this;
|
|
on(event: 'end', listener: () => void): this;
|
|
}
|
|
const util: Util;
|
|
const adbkit: any;
|
|
export interface Client {
|
|
listDevices: () => Promise<Device[]>;
|
|
reverse: (
|
|
serial: string,
|
|
remote: string,
|
|
local: string,
|
|
) => Promise<boolean>;
|
|
shell: (
|
|
serial: string,
|
|
command: string | string[],
|
|
) => Promise<NodeJS.ReadStream>;
|
|
screencap: (serial: string) => Promise<NodeJS.WriteStream>;
|
|
pull: (serial: string, path: string) => Promise<PullTransfer>;
|
|
openLogcat: (
|
|
serial: string,
|
|
options?: {
|
|
clear?: boolean;
|
|
},
|
|
callback?: any,
|
|
) => Promise<import('adbkit-logcat').Reader>;
|
|
getProperties: (serial: string) => Promise<{[key: string]: string}>;
|
|
trackDevices: () => Promise<DeviceTracker>;
|
|
kill: () => Promise<boolean>;
|
|
forward: (
|
|
serial: string,
|
|
local: string,
|
|
remote: string,
|
|
) => Promise<boolean>; // TODO: verify correctness of signature
|
|
}
|
|
export function createClient(config: {port: number; host: string}): Client;
|
|
}
|