@@ -35,7 +35,7 @@ class IOSDebugService implements IDebugService {
35
35
return "ios" ;
36
36
}
37
37
38
- public debug ( ) : IFuture < void > {
38
+ public debug ( shouldBuild : boolean ) : IFuture < void > {
39
39
if ( this . $options . debugBrk && this . $options . start ) {
40
40
this . $errors . failWithoutHelp ( "Expected exactly one of the --debug-brk or --start options." ) ;
41
41
}
@@ -46,37 +46,38 @@ class IOSDebugService implements IDebugService {
46
46
47
47
if ( this . $options . emulator ) {
48
48
if ( this . $options . debugBrk ) {
49
- return this . emulatorDebugBrk ( true ) ;
49
+ return this . emulatorDebugBrk ( shouldBuild , true ) ;
50
50
} else if ( this . $options . start ) {
51
51
return this . emulatorStart ( ) ;
52
52
} else {
53
- return this . emulatorDebugBrk ( ) ;
53
+ return this . emulatorDebugBrk ( shouldBuild , false ) ;
54
54
}
55
55
} else {
56
56
if ( this . $options . debugBrk ) {
57
- return this . deviceDebugBrk ( true ) ;
57
+ return this . deviceDebugBrk ( shouldBuild , true ) ;
58
58
} else if ( this . $options . start ) {
59
59
return this . deviceStart ( ) ;
60
60
} else {
61
61
let deploy = this . $platformService . deployOnDevice ( this . platform ) ;
62
62
deploy . wait ( ) ;
63
-
64
63
return this . deviceStart ( ) ;
65
64
}
66
65
}
67
66
}
68
67
69
- public debugStart ( ) : IFuture < void > {
68
+ public debugStart ( shouldBuild : boolean ) : IFuture < void > {
70
69
return ( ( ) => {
71
70
this . $devicesService . initialize ( { platform : this . platform , deviceId : this . $options . device } ) . wait ( ) ;
72
- this . $devicesService . execute ( ( device : Mobile . IiOSDevice ) => device . isEmulator ? this . emulatorDebugBrk ( ) : this . debugBrkCore ( device ) ) . wait ( ) ;
71
+ this . $devicesService . execute ( ( device : Mobile . IiOSDevice ) => device . isEmulator ? this . emulatorDebugBrk ( shouldBuild , false ) : this . debugBrkCore ( device ) ) . wait ( ) ;
73
72
} ) . future < void > ( ) ( ) ;
74
73
}
75
74
76
- private emulatorDebugBrk ( shouldBreak ? : boolean ) : IFuture < void > {
75
+ private emulatorDebugBrk ( shouldBuild : boolean , shouldBreak : boolean ) : IFuture < void > {
77
76
return ( ( ) => {
78
77
let platformData = this . $platformsData . getPlatformData ( this . platform ) ;
79
- this . $platformService . buildPlatform ( this . platform ) . wait ( ) ;
78
+ if ( shouldBuild ) {
79
+ this . $platformService . buildPlatform ( this . platform ) . wait ( ) ;
80
+ }
80
81
let emulatorPackage = this . $platformService . getLatestApplicationPackageForEmulator ( platformData ) . wait ( ) ;
81
82
82
83
let args = shouldBreak ? "--nativescript-debug-brk" : "--nativescript-debug-start" ;
@@ -112,12 +113,12 @@ class IOSDebugService implements IDebugService {
112
113
} ) . future < void > ( ) ( ) ;
113
114
}
114
115
115
- private deviceDebugBrk ( shouldBreak ? : boolean ) : IFuture < void > {
116
+ private deviceDebugBrk ( shouldBuild : boolean , shouldBreak : boolean ) : IFuture < void > {
116
117
return ( ( ) => {
117
118
this . $devicesService . initialize ( { platform : this . platform , deviceId : this . $options . device } ) . wait ( ) ;
118
119
this . $devicesService . execute ( ( device : iOSDevice . IOSDevice ) => ( ( ) => {
119
120
if ( device . isEmulator ) {
120
- return this . emulatorDebugBrk ( shouldBreak ) . wait ( ) ;
121
+ return this . emulatorDebugBrk ( shouldBuild , shouldBreak ) . wait ( ) ;
121
122
}
122
123
// we intentionally do not wait on this here, because if we did, we'd miss the AppLaunching notification
123
124
let deploy = this . $platformService . deployOnDevice ( this . platform ) ;
0 commit comments