Commit Graph

122 Commits

Author SHA1 Message Date
Orgad Shaneh
7a04014f9f Merge remote-tracking branch 'origin/4.5'
Change-Id: I2d78020f10aa66fdded63883030313e0c411ce02
2017-10-15 00:23:08 +03:00
Ulf Hermann
b1a8743f6c Android: Set scheme on QML server URL
The QML connection manager won't accept URLs without scheme anymore.

Task-number: QTCREATORBUG-19046
Change-Id: Ic31787b806ab965f57a4585ee55681a488a88c56
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-10-13 10:15:52 +00:00
Ulf Hermann
fb370f460d Move URL utilities from ProjectExplorer to Utils
This way we can access them from the qmldebug library.

Change-Id: I90ba80228f44a9d5ea825ad59f4bd1572969980e
Reviewed-by: hjk <hjk@qt.io>
2017-10-05 08:54:39 +00:00
Ulf Hermann
63a99936ab QmlProfiler: Unify local and tcp connection mechanism
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>
2017-09-21 14:54:57 +00:00
Jake Petroules
6458473414 Android: remove support for local/debug deployment option
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>
2017-09-06 18:21:26 +00:00
hjk
44d3a286e3 Android: Remove unused AndroidRunner::localGdbServerPort method
Change-Id: Ia941b7437c8bc7424b3b9176312256c8f15c0a24
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-08-24 09:18:22 +00:00
hjk
c128731ff2 Debugger: Use a QUrl for Qml server port and host
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>
2017-08-23 09:13:40 +00:00
Vikas Pachdha
cdffb378fd Android: Fix QML debugging
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>
2017-08-15 14:40:25 +00:00
hjk
9e67a9453a Debugger: Use a somewhat less intrusive hack for 'start at main'
Change-Id: Ie649a4a11c88f3686cd6ed1e73f34c7c78fd0e13
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-07-12 09:45:28 +00:00
Vikas Pachdha
a6a13bfb76 Android: Let user specify shell commands
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>
2017-06-30 11:56:50 +00:00
hjk
ef7c633de2 Android: Re-enable QmlProfiler
Change-Id: Icd73475be421e6813b0d496020461e7020b547dd
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-29 14:00:22 +00:00
Vikas Pachdha
a30a18177b Android: Make Android manager activity start arguments configurable
Change-Id: I2e09029e4eb0b8a57fda53efff3d42f109bfe905
Reviewed-by: hjk <hjk@qt.io>
2017-06-28 09:09:32 +00:00
hjk
bfb0e025d9 Android: Make selector() arguments to runAdb implicit
Less code on the user side.

Change-Id: Ibf19ca725557c2de67743bd3b4b621f04bb896c7
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-06-19 07:52:37 +00:00
hjk
1d921ae044 Android: Convert into a RunWorker based setup
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>
2017-06-12 06:38:40 +00:00
Robert Loehning
1b2dc1511f Android: Remove useless test
Task-number: QTCREATORBUG-18331
Change-Id: I8c93d0b92c61c6cf58351d74871abb4267badd82
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-06-06 13:44:04 +00:00
Eike Ziller
105b69836c Merge remote-tracking branch 'origin/4.3'
Conflicts:
	tests/auto/debugger/tst_dumpers.cpp

Change-Id: Id8b53b000f94a1b5ab923db79f67bad3276d09dc
2017-05-04 10:03:50 +02:00
Ulf Hermann
47b4a0811f Revert "Android: Improve application output window by adding filters"
This reverts commit d4ca232d54 and fixes
QML profiling on android.

Task-number: QTCREATORBUG-18120
Change-Id: I09b9062da197a4c6c0a7034f98a2bb0b41f1d559
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-04-28 14:43:47 +00:00
Eike Ziller
88897f3a87 Merge remote-tracking branch 'origin/4.3'
Conflicts:
	src/plugins/genericprojectmanager/genericproject.cpp
	src/plugins/genericprojectmanager/genericproject.h
	src/plugins/genericprojectmanager/genericprojectnodes.cpp
	src/plugins/genericprojectmanager/genericprojectnodes.h

Change-Id: Ie0c870f68c8d200a75489b75860987655b2f6175
2017-04-19 09:56:14 +02:00
BogDan Vatra
d4ca232d54 Android: Improve application output window by adding filters
- 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>
2017-04-12 13:57:34 +00:00
Vikas Pachdha
70be880bcb Android: Use avdmanager tool
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>
2017-04-12 13:42:10 +00:00
hjk
eee51e8c1d Android: Adapt to ProjectExplorer::ToolRunner introduction
Change-Id: I71cc25ef3daa0eee51a4c94285174e0f3b45d41f
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-03-30 10:11:02 +00:00
Orgad Shaneh
da7cb91446 Merge remote-tracking branch 'origin/4.2' into 4.3
Change-Id: I4931dcc81be872d7712e67123e94d15ee696459f
2017-03-14 16:20:14 +02:00
Samuel Gaist
4033471aa9 QRegExp include cleanup
This patch adds the missing include statements for QRegExp.

Change-Id: Ibb03b929940adb84ae190b5090cb6b88653cc14c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-13 22:05:30 +00:00
Eike Ziller
e724934393 Merge remote-tracking branch 'origin/4.2'
Conflicts:
	doc/src/qtquick/creator-tutorial-create-qq-project.qdocinc
	doc/src/qtquick/qtquick-creating.qdoc
	doc/src/qtquick/qtquick-uiforms-tutorial.qdoc
	share/qtcreator/welcomescreen/qtcreator_tutorials.xml
	src/plugins/git/gitgrep.cpp
	src/shared/qbs

Change-Id: I6f4d168d888d9547c3af0819f79cc9ebb4186ca0
2017-02-14 15:32:04 +01:00
Vikas Pachdha
c97a54cebf Android: Fix crash on using Re-run app
Collaterally busybox detection(dead code) is removed

Task-number: QTCREATORBUG-17691
Change-Id: I50de3e4ad299c741c9b1afaddb22209b409acccf
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-02-09 11:22:48 +00:00
Tobias Hunger
c6f90e575e Utils: Introduce a TemporaryDirectory and TemporaryFile class
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>
2017-01-20 12:17:10 +00:00
BogDan Vatra
87b39ddd5a Android: Merge stdout & stderr channles
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>
2016-12-07 15:37:03 +00:00
Vikas Pachdha
24ae8e0491 Android: Change polling pid script to fix permission denied issues
Task-number: QTCREATORBUG-17272
Change-Id: Ia45ad8b2bd9e1d1c984c600d320241b81580d85f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-11-29 17:00:58 +00:00
Vikas Pachdha
bf8f998b5e Android: Fix android app startup
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>
2016-11-28 11:19:23 +00:00
BogDan Vatra
de687f5f9e Fix AndroidRunner
"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>
2016-11-08 10:03:00 +00:00
Ulf Hermann
e0d7089f94 AndroidRunner: Process "ps" output on the device, not in Qt Creator
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>
2016-08-18 09:40:46 +00:00
Ulf Hermann
2044a33f88 AndroidRunner: Remove _(...)
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>
2016-08-18 09:32:43 +00:00
Ulf Hermann
5f950a80cc Android: Run all of AndroidRunner in a separate thread
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>
2016-08-18 09:32:34 +00:00
Ulf Hermann
100b3da662 Android: Make AndroidRunner a plain QObject
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>
2016-08-08 08:06:55 +00:00
Orgad Shaneh
1853f01a5b Merge remote-tracking branch 'origin/4.1'
Change-Id: Ia442f30f387fe9292217582260bbe79e54608810
2016-08-05 11:40:07 +02:00
Ulf Hermann
6c2036d900 Android: Run stop() asynchronously
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>
2016-08-01 08:09:26 +00:00
Ulf Hermann
cbd738ab90 Android: Don't use blocking queued connections for running ps
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>
2016-08-01 08:09:21 +00:00
Vikas Pachdha
148d7636f1 Starting AVD in run step. Before this change AVD was started only in deploy step.
Task-number: QTCREATORBUG-10237
Change-Id: Ic99cc84013e53ddc60ed05c7983e141ecfc75169
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-07-13 09:50:45 +00:00
Orgad Shaneh
88dfa84fc6 Android: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: Id09b62b7b9812d9c0981202c257d18387a8b09d9
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-07-04 09:35:58 +00:00
BogDan Vatra
4ce0494284 Android: Fix adbShellAmNeedsQuotes
Regressions was introduced by ddefe062c7

Change-Id: I0bc3f75b788472db78998c32d0007d4250a62f5a
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-06-10 10:19:49 +00:00
Tobias Hunger
5d3823ac47 Use SynchronousProcess::runBlocking
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>
2016-05-26 11:50:03 +00:00
Tobias Hunger
ddefe062c7 Fix up QProcess::waitForFinished()
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>
2016-05-11 10:04:38 +00:00
Eike Ziller
0f94aa3f4d Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/projectexplorer/projectwizardpage.cpp
	src/plugins/projectexplorer/xcodebuildparser.h
	src/plugins/qmldesigner/qmldesignerplugin.cpp
	src/tools/clangbackend/ipcsource/translationunits.cpp

Change-Id: Ibf0857cf8dbf95fc9ac13d5c2112b3f4a2ca7de6
2016-05-03 11:49:01 +02:00
BogDan Vatra
e26bbc8459 Fix warnings
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>
2016-04-29 13:35:40 +00:00
Ulf Hermann
385237dbbd Use Utils::Port where possible
This solves the ambiguity between 0 and -1 being the "invalid" port.

Change-Id: I3bac11dd4117bb1820fbd58186699925b73df1c5
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-20 11:06:34 +00:00
BogDan Vatra
bf3ba0f577 Don't create a QProcess object every second.
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>
2016-03-10 11:22:14 +00:00
Eike Ziller
8b4f14a8ad Android: Use Utils::runAsync
Change-Id: I632d165be4a7e1f35e6e3d7bf401d40817b17223
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-12 12:38:35 +00:00
BogDan Vatra
221b03a162 Add AndroidRunnable
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>
2016-01-29 12:29:07 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Martin Kampas
b10b39a6dc Android: Remove dead code related to local libs
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>
2015-12-03 18:35:47 +00:00