Use the URL scheme to distinguish between them, check that in
QmlProfilerClientManager and test all possible combinations of URL
parts.
Change-Id: I6583e5bf18eda0344a299a279c12578c4ebc7ffe
Reviewed-by: hjk <hjk@qt.io>
This is only usable with versions of Android older than 5. Now that
Android 8 is the current version, we say goodbye to this feature as it
is almost certainly no longer of use to anyone.
Task-number: QTBUG-62995
Change-Id: I19795eb385b18f4dd87a1bb8df57d36c3fa28dc5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Host and port reasonably belong together, using a QUrl makes that more
explicit and follows the lead of the Qml profiler in that area.
Change-Id: I754cb17d165ce6b2f25c655eeebfd8ac8f5a93c7
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Specify the qml server address and use correct default loop back
address in qmlengine
Change-Id: I9b77cb3385041bbe79900e7f7a188ca26124bacc
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Let user specify list of shell commands to run before app starts
and after app quits.
Change-Id: I9794fb96180530ca6c28ce6581fda51a25be28d4
Reviewed-by: hjk <hjk@qt.io>
This moves all of the RunControl implementation into a single
RunWorker, not yet splitting it up into separate RunWorkers
which is the final goal of this series.
Change-Id: I7373105603505aa4fffd7fe5ff0145f0128b34bc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
- allow the user to choose the visible log levels
- allow the user to choose which activities/service(s) logs are visible
- wakeup the device (API 20+)
- use only the most recent logs (API 21+ add "-T 0" to logcat params)
- use logcat -v time format, which is the same on all Android versions
In the future we can even allow the user to choose which parts of the
log line are visible, e.g. time, log level, TAG, PID, Message
Task-number: QTCREATORBUG-16887
Change-Id: I07ce00aff59a479660f5ac6da75eef973ba3f627
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
android tool is deprecated since sdk tools version 25.3.0.
Use the new avdmanager tool
Task-number: QTCREATORBUG-17814
Change-Id: Id6f495f14e12d0069df08164cac1929b76d9e932
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This patch adds the missing include statements for QRegExp.
Change-Id: Ibb03b929940adb84ae190b5090cb6b88653cc14c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Both wrap the corresponding Qt class, but make sure all temporary files
or directories are created inside a "master temporary directory".
Change-Id: I55461be507c828c965224c02863ea5ed9bbf9498
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
On Android 7.1.1 the error is fired on "stderr" on previous versions on
"stdout"
Change-Id: I72c06694a22084d455e26eea95ddfdb8a93a39b2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Method to find the pid is changed. Not all android versions support grep
and test commands
Task-number: QTCREATORBUG-17272
Change-Id: Ifa67444af55eaf06fb2d6f6bb0439cfaf3bf305e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
"m_tries" and "m_wasStarted" must be initialized before "m_psProc-
>start" call, because m_psProc will emit "QIODevice::readyRead" signal
before the function ends.
Change-Id: I10c63ca2d15c362d6df04018757b1916b9989893
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Previously, the code depended on the device to send the whole "ps"
output back quickly after "ps" was written to the shell. If the output
was not there by the time the input was considered written by Qt
Creator, we would mis-parse the port and generate wrong conclusions on
if the process was actually running or not.
By filtering the correct line from the ps output on the device and
outputting a clear negative result when none is found we can determine
the "running" status of the process more easily. Each output line
directly corresponds to the state of the process at the time when ps
ran. We buffer the output in order to guard against lines being broken
up during transmission.
Change-Id: I0e1726b7f0d725d982a0f2d60d0c8ab7d59fc371
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
We don't need to do this for plain character literals as we allow
casting those to QString now.
Change-Id: I25569cfb8a2ff618176b7d5ab048f03ecaaee460
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This removes the need for blocking queued connections and runAsync(),
reducing the risk of deadlocks and eliminating unguarded concurrent
access to various members of AndroidRunner. No mutex locking is
necessary anymore as all communication between the two threads is
either done on initialization, before the worker thread starts, or
via queued signals.
Change-Id: Icc2fcc2c0ce73d1c226bc4740413e57490d1cbc6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
We're not using it as QThread.
Change-Id: Ib277325179a46fe7d153ff9d37043f54d0d41037
Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Running SynchronousProcess (for adb) on the GUI thread is dangerous as
it might process unrelated events without returning, breaking
assumptions in other parts of Qt Creator. Rather run those things on a
worker thread, with a separate event loop, like we already do it when
starting processes.
Furthermore, returning, from start() or stop() while a thread is
running that accesses internals of AndroidRunner is also dangerous,
because most methods of AndroidRunner are not protected by relevant
mutexes and especially the destructor might get invoked while the
worker thread is still runnig. Thus, wait for the worker threads to
finish, in start() and stop().
This is a crutch, of course, as with proper locking we could keep the
GUI thread responsive while the adb commands are running, but just
serializing the execution reduces the risk of further breakage for now.
Change-Id: Ife92dc19aa8111374413590c3156027ba759746f
Task-number: QTCREATORBUG-16667
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
If ps is run from a different thread than the GUI thread, then we are
obviously not dealing with the "checkPID" function that's running every
second. We don't need to be overly prudent about starting another
process then. On the other hand, the blocking queued connection relies
on the ps shell not getting closed from a different thread in between
and it is generally a risk for creating dead locks.
Change-Id: Ief49fb18cc3199dc345c4d9ca0ee24b66d33343c
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Use SynchronousProcess::runBlocking in favor of SychronousProcess::run.
This avoid nested event loops which can produce really strange crashes
if not use carefully.
This patch only converts those processes that have a timeout of less
than 5 seconds or use the default timeout.
Change-Id: I9de8899dcc946af7049ea357a91972996c0256a1
Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
waitForFinish returns false if the process is no longer running at
the time of the call. Handle that throughout the codebase.
Change-Id: Ia7194095454e82efbd4eb88f2d55926bdd09e094
Reviewed-by: hjk <hjk@theqtcompany.com>
Don't try to write from another thread into a process stdin. Fixes
"QSocketNotifier: Socket notifiers cannot be enabled or disabled from
another thread" warnings.
Change-Id: Id93a40a6bee6d4042cf600c8fabb06bf965d8ccc
Reviewed-by: hjk <hjk@theqtcompany.com>
This solves the ambiguity between 0 and -1 being the "invalid" port.
Change-Id: I3bac11dd4117bb1820fbd58186699925b73df1c5
Reviewed-by: hjk <hjk@theqtcompany.com>
Creating a QProcess every second is very VERY expensive, making the QtCreator UI
experience pretty bad, the UI was not responsive when debugging or even when
running an Android application from QtCreator.
Thanks to Intel's VTUNE I could spot and fix the problem in minutes.
Change-Id: I6d3dc71db93e91d9846101a1877bab017df41aba
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Using the AndroidRunnable is easy for other plugins to run custom adb
commands before intent is started and after it's stopped.
Change-Id: I012ae87c92cea16aa8074dce2dc6f2b0c4ebeb30
Reviewed-by: hjk <hjk@theqtcompany.com>
The start point is the if (m_useLocalQtLibs) block in AndroidRunner
constructor which seems to be effectless since 8d27ec6 (Android: Fix
debugging applications that link many modules)
Change-Id: I7850c1f53a003553ae1b3fdf0881f4c9fedf7b15
Reviewed-by: BogDan Vatra <bogdan@kdab.com>