@@ -29,7 +29,8 @@ export class IOSDebugService extends DebugServiceBase implements IPlatformDebugS
29
29
private $iOSSocketRequestExecutor : IiOSSocketRequestExecutor ,
30
30
private $processService : IProcessService ,
31
31
private $socketProxyFactory : ISocketProxyFactory ,
32
- private $projectDataService : IProjectDataService ) {
32
+ private $projectDataService : IProjectDataService ,
33
+ private $deviceLogProvider : Mobile . IDeviceLogProvider ) {
33
34
super ( device , $devicesService ) ;
34
35
this . $processService . attachToProcessExitSignals ( this , this . debugStop ) ;
35
36
this . $socketProxyFactory . on ( CONNECTION_ERROR_EVENT_NAME , ( e : Error ) => this . emit ( CONNECTION_ERROR_EVENT_NAME , e ) ) ;
@@ -40,8 +41,6 @@ export class IOSDebugService extends DebugServiceBase implements IPlatformDebugS
40
41
}
41
42
42
43
public async debug ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
43
- await this . device . openDeviceLogStream ( ) ;
44
-
45
44
if ( debugOptions . debugBrk && debugOptions . start ) {
46
45
this . $errors . failWithoutHelp ( "Expected exactly one of the --debug-brk or --start options." ) ;
47
46
}
@@ -50,6 +49,20 @@ export class IOSDebugService extends DebugServiceBase implements IPlatformDebugS
50
49
debugOptions . emulator = true ;
51
50
}
52
51
52
+ if ( ! debugOptions . justlaunch ) {
53
+ let projectName = debugData . projectName ;
54
+ if ( ! projectName && debugData . projectDir ) {
55
+ const projectData = this . $projectDataService . getProjectData ( debugData . projectDir ) ;
56
+ projectName = projectData . projectName ;
57
+ }
58
+
59
+ if ( projectName ) {
60
+ this . $deviceLogProvider . setProjectNameForDevice ( debugData . deviceIdentifier , projectName ) ;
61
+ }
62
+
63
+ await this . device . openDeviceLogStream ( ) ;
64
+ }
65
+
53
66
if ( debugOptions . emulator ) {
54
67
if ( debugOptions . start ) {
55
68
return this . emulatorStart ( debugData , debugOptions ) ;
@@ -108,7 +121,7 @@ export class IOSDebugService extends DebugServiceBase implements IPlatformDebugS
108
121
109
122
private async emulatorDebugBrk ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
110
123
const args = debugOptions . debugBrk ? "--nativescript-debug-brk" : "--nativescript-debug-start" ;
111
- const launchResult = await this . $iOSEmulatorServices . runApplicationOnEmulator ( debugData . pathToAppPackage , {
124
+ const launchResult = await this . $iOSEmulatorServices . runApplicationOnEmulator ( debugData . pathToAppPackage , {
112
125
waitForDebugger : true ,
113
126
captureStdin : true ,
114
127
args : args ,
0 commit comments