Restore adb executeShell [5/n]
Summary: Expose executeShell explicitly through the device interface Reviewed By: jameslawson Differential Revision: D31055959 fbshipit-source-id: b14395d0783ede265c6ae39c397ea93a85a78336
This commit is contained in:
committed by
Facebook GitHub Bot
parent
4463e7ede2
commit
8cf182cc26
@@ -74,18 +74,7 @@ function formatFrequency(freq: number) {
|
||||
export function devicePlugin(client: PluginClient<{}, {}>) {
|
||||
const device = client.device;
|
||||
|
||||
const executeShell = async (command: string) => {
|
||||
// TODO: fix
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
(device.realDevice as any).adb
|
||||
.shell(device.serial, command)
|
||||
.then(adb.util.readAll)
|
||||
.then(function (output: {toString: () => {trim: () => string}}) {
|
||||
resolve(output.toString().trim());
|
||||
})
|
||||
.catch((e: unknown) => reject(e));
|
||||
});
|
||||
};
|
||||
const executeShell = async (command: string) => device.executeShell(command);
|
||||
|
||||
let intervalID: NodeJS.Timer | null = null;
|
||||
const cpuState = createState<CPUState>({
|
||||
|
||||
Reference in New Issue
Block a user