298 \li The plugin determines who can connect and whether any authentication
299 takes place. This is the extension mechanism.
300\endtable
301
302Use QQmlDebuggingEnabler::setServices() or the \c services: argument to enable
303only the services you need. For example, profiling does not need the debugger and
304inspector services. By default, all services found in the \c qmltooling plugins
305are loaded. Restricting the services reduces what a client can do, but it does
306not protect against untrusted clients: all enabled services are available to
307every client that connects.
308
309\section2 Disabling QML debugging for release builds
310
311Several independent layers control whether an application can be debugged.
312Only the first two remove the capability:
313
314\list 1
315 \li The \c qml-debug Qt feature, which is on by default. Configure Qt with
316 \c{-no-qml-debug} to build without the debugging infrastructure.
317 \li The \c qmltooling plugins, which are installed with Qt. Deployment tools may
318 deploy them with your application. Do not ship them in release builds. Without
319 them, no connector or service can be loaded.
320 \li Enabling the infrastructure. \c QT_QML_DEBUG, \c QT_QML_DEBUG_NO_WARNING,
321 \c{CONFIG+=qml_debug} and \c QT_ENABLE_QML_DEBUG merely call
322 \l{QQmlDebuggingEnabler::enableDebugging()} from a static initializer. Any code
323 in the application, including third-party libraries, can call it as well. An
324 application built without the define accepts \c -qmljsdebugger exactly like
325 a debug build if this happens.
326 \li Starting a connector, via \c -qmljsdebugger, or
327 QQmlDebuggingEnabler::startTcpDebugServer(),
328 QQmlDebuggingEnabler::connectToLocalDebugger() or
329 QQmlDebuggingEnabler::startDebugConnector().
330\endlist
331
332Enabling debugging prints a warning, unless this is suppressed by passing
333\c false to QQmlDebuggingEnabler::enableDebugging() or by defining
334\c QT_QML_DEBUG_NO_WARNING. This warning is the only notice given that debugging is
335enabled.
336
337\section2 Starting applications
338
339To enable debugging -- from the start or to attach a debugger later on -- start
340the application with the following arguments:
341
342\c {-qmljsdebugger=port:<port_from>[,port_to][,host:<ip address>][,block][,file:<local socket>][,services:<comma-separated list of services to enable>]}
343
344Where:
345\list
346 \li the mandatory \c {port_from} specifies either the debugging port or the
347 start port of a range of ports when \c {port_to} is specified
348 \li the optional \c {ip address} specifies the IP address of the host where
349 the application is running
350 \li the optional \c block prevents the application from running until the
351 debug client connects to the server
352 \li the optional \c {file} specifies the local socket.
353 \li the optional \c {services} specifies the services to enable; the default
354 is all that are found. Note that the \c{v4 debug} service disables the
355 JIT.
356\endlist
357
358After the application has successfully started, it displays the following
359message:
360
361\c {QML Debugger: Waiting for connection on port <port_number>}
362
363or
364
365\c {QML Debugger: Connecting to socket at <file>}
366
367\section2 Connecting to applications
368
369When the application is running, an IDE or a tool that implements the binary
370protocol can connect to the open port.
371
372\section1 Debugging with \QC
373
374\QC uses the debugging infrastructure to debug, inspect, and profile QML
375applications on the desktop as well as on remote devices. \QC provides
376integrated clients for debugging JavaScript, inspecting the object tree, and
377profiling the activities of a QML engine. For more information, see
378\l{\QC: Debugging Qt Quick Projects}.
379
380\section1 Debugging with \QVSC
381
382\QVSC provides integrated clients for debugging JavaScript and
383profiling QML engine activity. For more information, see