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