@@ -93,17 +93,16 @@ export class LogcatHelper implements Mobile.ILogcatHelper {
93
93
return ;
94
94
const lines = ( lineBuffer . toString ( ) || "" ) . split ( "\n" ) ;
95
95
for ( let line of lines ) {
96
- // 09-11 17:50:26.311 598 1979 I ActivityTaskManager: START u0 {flg=0x10000000 cmp=org.nativescript.myApp/com.tns.NativeScriptActivity} from uid 2000
97
- // ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^
98
- // action appId pid
96
+ // 2024-06-26 16:43:22.286 630-659 ActivityManager system_server I Start proc 8854:org.nativescript.uitestsapp/u0a190 for next-top-activity {org.nativescript.uitestsapp/com.tns.NativeScriptActivity}
97
+
98
+ const startProc = / S t a r t p r o c (?< pid > [ 0 - 9 ] + ) : (?< appId > .+ ?) \/ / . exec (
99
+ line
100
+ ) ;
99
101
100
102
if (
101
- // action
102
- line . includes ( "START" ) &&
103
- // appId
104
- line . includes ( options . appId ) &&
105
- // pid - only if it's not the current pid...
106
- ! line . includes ( options . pid )
103
+ startProc &&
104
+ startProc . groups ?. appId === options . appId &&
105
+ startProc . groups ?. pid !== options . pid
107
106
) {
108
107
this . forceStop ( deviceIdentifier ) ;
109
108
options . onAppRestarted ?.( ) ;
@@ -195,14 +194,16 @@ export class LogcatHelper implements Mobile.ILogcatHelper {
195
194
] ;
196
195
197
196
if ( pid && isLogcatPidSupported ) {
198
- logcatCommand . push ( `--pid=${ pid } ` ) ;
197
+ // logcatCommand.push(`--pid=${pid}`);
199
198
200
199
acceptedTags . forEach ( ( tag ) => {
201
200
// -s <tag> - shows only logs with the specified tag
202
- logcatCommand . push ( "-s" , tag ) ;
201
+ // logcatCommand.push("-s", tag);
203
202
} ) ;
204
203
}
205
204
205
+ console . log ( "-------------LOGCAT COMMAND" , logcatCommand ) ;
206
+
206
207
const logcatStream = await adb . executeCommand ( logcatCommand , {
207
208
returnChildProcess : true ,
208
209
} ) ;
@@ -221,7 +222,15 @@ export class LogcatHelper implements Mobile.ILogcatHelper {
221
222
222
223
// -b system - shows the system buffer/logs only
223
224
// -T 1 - shows only new logs after starting adb logcat
224
- const logcatCommand = [ `logcat` , `-b` , `system` , `-T` , `1` ] ;
225
+ const logcatCommand = [
226
+ `logcat` ,
227
+ `-b` ,
228
+ `system` ,
229
+ `-T` ,
230
+ `1` ,
231
+ "-s" ,
232
+ "ActivityManager" ,
233
+ ] ;
225
234
226
235
if ( appId ) {
227
236
logcatCommand . push ( `--regex=START.*${ appId } ` ) ;
0 commit comments