@@ -4,6 +4,8 @@ import { LiveSyncPaths } from "../common/constants";
44
55export class AndroidDebugService extends DebugServiceBase implements IPlatformDebugService {
66 private _packageName : string ;
7+ private deviceIdentifier : string ;
8+
79 public get platform ( ) {
810 return "android" ;
911 }
@@ -17,7 +19,9 @@ export class AndroidDebugService extends DebugServiceBase implements IPlatformDe
1719 private $net : INet ,
1820 private $projectDataService : IProjectDataService ,
1921 private $deviceLogProvider : Mobile . IDeviceLogProvider ) {
22+
2023 super ( device , $devicesService ) ;
24+ this . deviceIdentifier = device . deviceInfo . identifier ;
2125 }
2226
2327 public async debug ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
@@ -27,10 +31,10 @@ export class AndroidDebugService extends DebugServiceBase implements IPlatformDe
2731 : await this . debugOnDevice ( debugData , debugOptions ) ;
2832
2933 if ( ! debugOptions . justlaunch ) {
30- const pid = await this . $androidProcessService . getAppProcessId ( debugData . deviceIdentifier , debugData . applicationIdentifier ) ;
34+ const pid = await this . $androidProcessService . getAppProcessId ( this . deviceIdentifier , debugData . applicationIdentifier ) ;
3135 if ( pid ) {
32- this . $deviceLogProvider . setApplicationPidForDevice ( debugData . deviceIdentifier , pid ) ;
33- const device = await this . $devicesService . getDevice ( debugData . deviceIdentifier ) ;
36+ this . $deviceLogProvider . setApplicationPidForDevice ( this . deviceIdentifier , pid ) ;
37+ const device = await this . $devicesService . getDevice ( this . deviceIdentifier ) ;
3438 await device . openDeviceLogStream ( ) ;
3539 }
3640 }
@@ -39,7 +43,7 @@ export class AndroidDebugService extends DebugServiceBase implements IPlatformDe
3943 }
4044
4145 public async debugStart ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < void > {
42- await this . $devicesService . initialize ( { platform : this . platform , deviceId : debugData . deviceIdentifier } ) ;
46+ await this . $devicesService . initialize ( { platform : this . platform , deviceId : this . deviceIdentifier } ) ;
4347 const projectData = this . $projectDataService . getProjectData ( debugData . projectDir ) ;
4448 const appData : Mobile . IApplicationData = {
4549 appId : debugData . applicationIdentifier ,
@@ -48,7 +52,7 @@ export class AndroidDebugService extends DebugServiceBase implements IPlatformDe
4852
4953 const action = ( device : Mobile . IAndroidDevice ) : Promise < void > => this . debugStartCore ( appData , debugOptions ) ;
5054
51- await this . $devicesService . execute ( action , this . getCanExecuteAction ( debugData . deviceIdentifier ) ) ;
55+ await this . $devicesService . execute ( action , this . getCanExecuteAction ( this . deviceIdentifier ) ) ;
5256 }
5357
5458 public debugStop ( ) : Promise < void > {
@@ -109,7 +113,7 @@ export class AndroidDebugService extends DebugServiceBase implements IPlatformDe
109113 this . $logger . out ( "Using " , packageFile ) ;
110114 }
111115
112- await this . $devicesService . initialize ( { platform : this . platform , deviceId : debugData . deviceIdentifier } ) ;
116+ await this . $devicesService . initialize ( { platform : this . platform , deviceId : this . deviceIdentifier } ) ;
113117
114118 const projectName = this . $projectDataService . getProjectData ( debugData . projectDir ) . projectName ;
115119 const appData : Mobile . IApplicationData = {
@@ -119,7 +123,7 @@ export class AndroidDebugService extends DebugServiceBase implements IPlatformDe
119123
120124 const action = ( device : Mobile . IAndroidDevice ) : Promise < string > => this . debugCore ( device , packageFile , appData , debugOptions ) ;
121125
122- const deviceActionResult = await this . $devicesService . execute ( action , this . getCanExecuteAction ( debugData . deviceIdentifier ) ) ;
126+ const deviceActionResult = await this . $devicesService . execute ( action , this . getCanExecuteAction ( this . deviceIdentifier ) ) ;
123127 return deviceActionResult [ 0 ] . result ;
124128 }
125129
0 commit comments