36
36
#include < sys/wait.h>
37
37
38
38
#define PID_FILE " /data/user/.appcontroller"
39
- #define FEATURES " restart perf eglresize"
39
+ #define FEATURES " restart perf eglresize qmldebugservices "
40
40
41
41
#ifdef Q_OS_ANDROID
42
42
#define B2QT_PREFIX " /data/user/b2qt"
@@ -50,22 +50,28 @@ static const char socketPath[] = "#Boot2Qt_appcontroller";
50
50
51
51
static void usage ()
52
52
{
53
- printf (" appcontroller [--debug-gdb] [--debug-qml] [--port-range <range>] [--stop] [--launch] [--show-platfrom] [--make-default] [--remove-default] [--print-debug] [--version] [--detach] [executable] [arguments]\n "
53
+ printf (" appcontroller [--debug-gdb] [--debug-qml] [--qml-debug-services <services>]"
54
+ " [--port-range <range>] [--stop] [--launch] [--show-platfrom] [--make-default]"
55
+ " [--remove-default] [--print-debug] [--version] [--detach] [executable] [arguments]\n "
54
56
" \n "
55
- " --port-range <range> Port range to use for debugging connections\n "
56
- " --debug-gdb Start GDB debugging\n "
57
- " --debug-qml Start QML debugging\n "
58
- " --stop Stop already running application\n "
59
- " --stop-for-restart Stop already running application and prepare to restart it\n "
60
- " --launch Start application without stopping already running application\n "
61
- " --show-platform Show platform information\n "
62
- " --make-default Make this application the default on boot\n "
63
- " --remove-default Restore the default application\n "
64
- " --print-debug Print debug messages to stdout on Android\n "
65
- " --version Print version information\n "
66
- " --detach Start application as usual, then go into background\n "
67
- " --restart Restart the current running application or an application stopped with --stop-for-restart\n "
68
- " --help, -h, -help Show this help\n "
57
+ " --port-range <range> Port range to use for debugging connections\n "
58
+ " --debug-gdb Start GDB debugging\n "
59
+ " --debug-qml Start QML debugging or profiling\n "
60
+ " --qml-debug-services <services> Specify services to use for QML debugging/profiling\n "
61
+ " --stop Stop already running application\n "
62
+ " --stop-for-restart Stop already running application and prepare to\n "
63
+ " restart it\n "
64
+ " --launch Start application without stopping already running\n "
65
+ " application\n "
66
+ " --show-platform Show platform information\n "
67
+ " --make-default Make this application the default on boot\n "
68
+ " --remove-default Restore the default application\n "
69
+ " --print-debug Print debug messages to stdout on Android\n "
70
+ " --version Print version information\n "
71
+ " --detach Start application as usual, then go into background\n "
72
+ " --restart Restart the current running application or an\n "
73
+ " application stopped with --stop-for-restart\n "
74
+ " --help, -h, -help Show this help\n "
69
75
);
70
76
}
71
77
@@ -307,6 +313,7 @@ int main(int argc, char **argv)
307
313
quint16 gdbDebugPort = 0 ;
308
314
bool useGDB = false ;
309
315
bool useQML = false ;
316
+ QString qmlDebugServices;
310
317
QStringList perfParams;
311
318
bool fireAndForget = false ;
312
319
bool detach = false ;
@@ -340,6 +347,13 @@ int main(int argc, char **argv)
340
347
setsid ();
341
348
} else if (arg == " --debug-qml" ) {
342
349
useQML = true ;
350
+ } else if (arg == " --qml-debug-services" ) {
351
+ if (args.isEmpty ()) {
352
+ fprintf (stderr, " --qml-debug-services requires a list of comma-separated service "
353
+ " names.\n " );
354
+ return 1 ;
355
+ }
356
+ qmlDebugServices = args.takeFirst ();
343
357
} else if (arg == " --profile-perf" ) {
344
358
if (args.isEmpty ()) {
345
359
fprintf (stderr, " --profile-perf requires comma-separated list of parameters that "
@@ -423,7 +437,9 @@ int main(int argc, char **argv)
423
437
fprintf (stderr, " Could not find an unused port in range\n " );
424
438
return 1 ;
425
439
}
426
- defaultArgs.push_front (" -qmljsdebugger=port:" + QString::number (port) + " ,block" );
440
+ defaultArgs.push_front (" -qmljsdebugger=port:" + QString::number (port) + " ,block" +
441
+ (qmlDebugServices.isEmpty () ?
442
+ " " : (" ,services:" + qmlDebugServices)));
427
443
printf (" QML Debugger: Going to wait for connection on port %d...\n " , port);
428
444
}
429
445
0 commit comments