165The \l{Qt Qml} module provides services for debugging, inspecting, and
166profiling applications via a TCP port or a local socket.
167
168\note The \c qmltooling plugins that are required for debugging and profiling
169QML applications on devices are automatically installed during Qt installation.
170They must be deployed to the devices for debugging and profiling to work.
171
172\section2 Enabling the infrastructure
173
174When you compile your application, you must explicitly enable the debugging
175infrastructure. If you use qmake, you can add the \c {CONFIG+=qml_debug}
176configuration parameters to the project \c{.pro} file.
177
178If you use another build system, you can pass the \c {QT_QML_DEBUG} define
179to the compiler:
180
181\note Enabling the debugging infrastructure may compromise the integrity of
182your application and system, and therefore, you should only enable it in a
183controlled environment. When the infrastructure is enabled, the application
184displays the following warning: \br \c {QML debugging is enabled. Only use this in a safe environment.}
185
186\section2 Starting applications
187
188To enable debugging -- from the start or to attach a debugger later on -- start
189the application with the following arguments:
190
191\c {-qmljsdebugger=port:<port_from>[,port_to][,host:<ip address>][,block][,file:<local socket>][,services:<comma-separated list of services to enable>]}
192
193Where:
194\list
195 \li the mandatory \c {port_from} specifies either the debugging port or the
196 start port of a range of ports when \c {port_to} is specified
197 \li the optional \c {ip address} specifies the IP address of the host where
198 the application is running
199 \li the optional \c block prevents the application from running until the
200 debug client connects to the server
201 \li the optional \c {file} specifies the local socket.
202 \li the optional \c {services} specifies the services to enable; the default
203 is all that are found. Note that the \c{v4 debug} service disables the
204 JIT.
205\endlist
206
207After the application has successfully started, it displays the following
208message:
209
210\c {QML Debugger: Waiting for connection on port <port_number>}
211
212or
213
214\c {QML Debugger: Connecting to socket at <file>}
215
216\section2 Connecting to applications
217
218When the application is running, an IDE or a tool that implements the binary
219protocol can connect to the open port.
220\section1 Debugging with \QC
221
222\QC uses the debugging infrastructure to debug, inspect, and profile QML
223applications on the desktop as well as on remote devices. \QC provides
224integrated clients for debugging JavaScript, inspecting the object tree, and
225profiling the activities of a QML engine. For more information, see