File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import * as stream from 'stream';
22import * as path from 'path' ;
33import * as adb from 'adbkit' ;
44
5+ import { reportError } from '../../error-tracking' ;
6+
57export const ANDROID_TEMP = '/data/local/tmp' ;
68export const SYSTEM_CA_PATH = '/system/etc/security/cacerts' ;
79
@@ -15,10 +17,18 @@ export function createAdbClient() {
1517}
1618
1719export async function getConnectedDevices ( adbClient : adb . AdbClient ) {
18- const devices = await adbClient . listDevices ( ) ;
19- return devices
20- . filter ( d => d . type !== 'offline' )
21- . map ( d => d . id ) ;
20+ try {
21+ const devices = await adbClient . listDevices ( ) ;
22+ return devices
23+ . filter ( d => d . type !== 'offline' )
24+ . map ( d => d . id ) ;
25+ } catch ( e ) {
26+ if ( e . code === 'ENOENT' ) return [ ] ;
27+ else {
28+ reportError ( e ) ;
29+ throw e ;
30+ }
31+ }
2232}
2333
2434export function stringAsStream ( input : string ) {
You can’t perform that action at this time.
0 commit comments