File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { CustomError } from '@httptoolkit/util';
2
2
import { Client as AdbClient , DeviceClient } from '@devicefarmer/adbkit' ;
3
3
import * as FridaJs from 'frida-js' ;
4
4
5
- import { waitUntil } from '../../util/promise' ;
5
+ import { waitUntil , withTimeout } from '../../util/promise' ;
6
6
import { HtkConfig } from '../../config' ;
7
7
import {
8
8
EMULATOR_HOST_IPS ,
@@ -38,7 +38,8 @@ const isFridaInstalled = (deviceClient: DeviceClient) =>
38
38
. catch ( ( ) => false ) ;
39
39
40
40
const isDevicePortOpen = ( deviceClient : DeviceClient , port : number ) =>
41
- deviceClient . openTcp ( port ) . then ( ( conn ) => {
41
+ withTimeout ( 1000 , deviceClient . openTcp ( port ) )
42
+ . then ( ( conn ) => {
42
43
// If the connection opened at all, then something is listening...
43
44
conn . on ( 'error' , ( ) => { } ) ;
44
45
conn . end ( ) ;
You can’t perform that action at this time.
0 commit comments