@@ -24,7 +24,7 @@ export class AndroidDeviceDebugService extends DebugServiceBase implements IDevi
2424 this . deviceIdentifier = device . deviceInfo . identifier ;
2525 }
2626
27- public async debug ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
27+ public async debug ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < IDebugResultInfo > {
2828 this . _packageName = debugData . applicationIdentifier ;
2929 const result = this . device . isEmulator
3030 ? await this . debugOnEmulator ( debugData , debugOptions )
@@ -59,7 +59,7 @@ export class AndroidDeviceDebugService extends DebugServiceBase implements IDevi
5959 return this . removePortForwarding ( ) ;
6060 }
6161
62- private async debugOnEmulator ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
62+ private async debugOnEmulator ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < IDebugResultInfo > {
6363 // Assure we've detected the emulator as device
6464 // For example in case deployOnEmulator had stated new emulator instance
6565 // we need some time to detect it. Let's force detection.
@@ -97,7 +97,7 @@ export class AndroidDeviceDebugService extends DebugServiceBase implements IDevi
9797 return this . device . adb . executeCommand ( [ "forward" , `tcp:${ local } ` , `localabstract:${ remote } ` ] ) ;
9898 }
9999
100- private async debugOnDevice ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
100+ private async debugOnDevice ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < IDebugResultInfo > {
101101 let packageFile = "" ;
102102
103103 if ( ! debugOptions . start && ! this . device . isEmulator ) {
@@ -113,27 +113,32 @@ export class AndroidDeviceDebugService extends DebugServiceBase implements IDevi
113113 projectName
114114 } ;
115115
116- const action = ( device : Mobile . IAndroidDevice ) : Promise < string > => this . debugCore ( device , packageFile , appData , debugOptions ) ;
116+ const action = ( device : Mobile . IAndroidDevice ) : Promise < IDebugResultInfo > => this . debugCore ( device , packageFile , appData , debugOptions ) ;
117117
118118 const deviceActionResult = await this . $devicesService . execute ( action , this . getCanExecuteAction ( this . deviceIdentifier ) ) ;
119119 return deviceActionResult [ 0 ] . result ;
120120 }
121121
122- private async debugCore ( device : Mobile . IAndroidDevice , packageFile : string , appData : Mobile . IApplicationData , debugOptions : IDebugOptions ) : Promise < string > {
122+ private async debugCore ( device : Mobile . IAndroidDevice , packageFile : string , appData : Mobile . IApplicationData , debugOptions : IDebugOptions ) : Promise < IDebugResultInfo > {
123+ const result : IDebugResultInfo = { hasReconnected : false , debugUrl : null } ;
124+
123125 if ( debugOptions . stop ) {
124126 await this . removePortForwarding ( ) ;
125- return null ;
127+ return result ;
126128 }
127129
128130 if ( ! debugOptions . start ) {
129131 await this . debugStartCore ( appData , debugOptions ) ;
132+ result . hasReconnected = true ;
130133 }
131134
132135 await this . validateRunningApp ( device . deviceInfo . identifier , appData . appId ) ;
133136 const debugPort = await this . getForwardedDebugPort ( device . deviceInfo . identifier , appData . appId ) ;
134137 await this . printDebugPort ( device . deviceInfo . identifier , debugPort ) ;
135138
136- return this . getChromeDebugUrl ( debugOptions , debugPort ) ;
139+ result . debugUrl = this . getChromeDebugUrl ( debugOptions , debugPort ) ;
140+
141+ return result ;
137142 }
138143
139144 private async printDebugPort ( deviceId : string , port : number ) : Promise < void > {
0 commit comments