@@ -4,6 +4,8 @@ import { LiveSyncPaths } from "../common/constants";
4
4
5
5
export class AndroidDebugService extends DebugServiceBase implements IPlatformDebugService {
6
6
private _packageName : string ;
7
+ private deviceIdentifier : string ;
8
+
7
9
public get platform ( ) {
8
10
return "android" ;
9
11
}
@@ -17,7 +19,9 @@ export class AndroidDebugService extends DebugServiceBase implements IPlatformDe
17
19
private $net : INet ,
18
20
private $projectDataService : IProjectDataService ,
19
21
private $deviceLogProvider : Mobile . IDeviceLogProvider ) {
22
+
20
23
super ( device , $devicesService ) ;
24
+ this . deviceIdentifier = device . deviceInfo . identifier ;
21
25
}
22
26
23
27
public async debug ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
@@ -27,10 +31,10 @@ export class AndroidDebugService extends DebugServiceBase implements IPlatformDe
27
31
: await this . debugOnDevice ( debugData , debugOptions ) ;
28
32
29
33
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 ) ;
31
35
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 ) ;
34
38
await device . openDeviceLogStream ( ) ;
35
39
}
36
40
}
@@ -39,7 +43,7 @@ export class AndroidDebugService extends DebugServiceBase implements IPlatformDe
39
43
}
40
44
41
45
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 } ) ;
43
47
const projectData = this . $projectDataService . getProjectData ( debugData . projectDir ) ;
44
48
const appData : Mobile . IApplicationData = {
45
49
appId : debugData . applicationIdentifier ,
@@ -48,7 +52,7 @@ export class AndroidDebugService extends DebugServiceBase implements IPlatformDe
48
52
49
53
const action = ( device : Mobile . IAndroidDevice ) : Promise < void > => this . debugStartCore ( appData , debugOptions ) ;
50
54
51
- await this . $devicesService . execute ( action , this . getCanExecuteAction ( debugData . deviceIdentifier ) ) ;
55
+ await this . $devicesService . execute ( action , this . getCanExecuteAction ( this . deviceIdentifier ) ) ;
52
56
}
53
57
54
58
public debugStop ( ) : Promise < void > {
@@ -109,7 +113,7 @@ export class AndroidDebugService extends DebugServiceBase implements IPlatformDe
109
113
this . $logger . out ( "Using " , packageFile ) ;
110
114
}
111
115
112
- await this . $devicesService . initialize ( { platform : this . platform , deviceId : debugData . deviceIdentifier } ) ;
116
+ await this . $devicesService . initialize ( { platform : this . platform , deviceId : this . deviceIdentifier } ) ;
113
117
114
118
const projectName = this . $projectDataService . getProjectData ( debugData . projectDir ) . projectName ;
115
119
const appData : Mobile . IApplicationData = {
@@ -119,7 +123,7 @@ export class AndroidDebugService extends DebugServiceBase implements IPlatformDe
119
123
120
124
const action = ( device : Mobile . IAndroidDevice ) : Promise < string > => this . debugCore ( device , packageFile , appData , debugOptions ) ;
121
125
122
- const deviceActionResult = await this . $devicesService . execute ( action , this . getCanExecuteAction ( debugData . deviceIdentifier ) ) ;
126
+ const deviceActionResult = await this . $devicesService . execute ( action , this . getCanExecuteAction ( this . deviceIdentifier ) ) ;
123
127
return deviceActionResult [ 0 ] . result ;
124
128
}
125
129
0 commit comments