diff --git a/src/api-server.ts b/src/api-server.ts index 4815d890..9c94df95 100644 --- a/src/api-server.ts +++ b/src/api-server.ts @@ -154,7 +154,7 @@ const buildResolvers = ( isActivable: (interceptor: Interceptor) => { return withFallback( interceptor.isActivable(), - INTERCEPTOR_TIMEOUT, + interceptor.activationTimeout || INTERCEPTOR_TIMEOUT, false ); }, diff --git a/src/interceptors/android/android-adb-interceptor.ts b/src/interceptors/android/android-adb-interceptor.ts index 89802b33..686a4842 100644 --- a/src/interceptors/android/android-adb-interceptor.ts +++ b/src/interceptors/android/android-adb-interceptor.ts @@ -54,6 +54,8 @@ export class AndroidAdbInterceptor implements Interceptor { }; } + activationTimeout = 10000; // Increase timeout for this interceptor to 10s, as initial setup takes a while + async activate(proxyPort: number, options: { deviceId: string }): Promise { diff --git a/src/interceptors/index.ts b/src/interceptors/index.ts index c0c18657..44f0d2c3 100644 --- a/src/interceptors/index.ts +++ b/src/interceptors/index.ts @@ -32,6 +32,8 @@ export interface Interceptor { isActive(proxyPort: number): boolean; activate(proxyPort: number, options?: any): Promise; + activationTimeout?: number; + deactivate(proxyPort: number, options?: any): Promise; deactivateAll(): Promise; }