Commit Graph

151 Commits

Author SHA1 Message Date
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +00:00
hjk
9ef0b97716 Avoid some visible uses of RunControl::runConfiguration()
For a long time, probably from the very beginning, a RunControl
was meant to hold (a copy of) data needed for its operation, that was
valid at the time of its construction, to be resilient in cases
where RunConfiguration setting were changed while the RunControl
was running, or to properly re-run with the original settings.

Unfortunately, the task was repetitive, as RunConfiguration
classes had no generic access to properties / "aspects"
and there was was the runConfiguration() accessor (probably
for mostly unrelated reasons in the output pane handling) which
made the idea of just casting that to the original runConfiguration
and access the data directly there appealing, with all the
expected consequences.

This patch here partially addresses the issue by copying some
more of the related data at RunControl construction time and
adjust the using code, avoiding most uses of the runConfiguration()
accessor in a mostly mechanical matter.

Complete removal appears possible, but will be less mechanical
in "difficult" plugins like ios, so this is left for later.

The new accessors in RunControl are very much ad-hoc, leaving
room for improvement, e.g. by consolidating the access to the
run config settings aspects with the other runconfig aspects
or similar. For now the goal is to remove the runConfiguration()
accessor, and to as much as possible fixed data after RunControl
setup is finished.

Next step would be to officially allow construction of RunControls
without a specific RunConfiguration by setting the necessary
data independently, removing the need for the various workarounds
that are currently used for the purpose of faking (parts of) the
effect of the non-existing RunConfiguration or refusing to operate
at all, even if it would be possible.

Change-Id: If8e5596da8422c70e90f97270389adbe6d0b46f2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-12 12:27:35 +00:00
Orgad Shaneh
bdc2b4b59f Remove hard-coded disabling of debug logs
Instead, set the default level of all logs to QtWarningMsg.

The call to setFilterRules overrides the user preferences in qtlogging.ini.

Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:36:58 +00:00
hjk
263cf4c608 ProjectExplorer: Remove RunWorker::setDisplayName
It has been an obsolete alias for setId for a while and downstream
uses have been adapted.

Change-Id: I467370aa67054599c7771e8275d28e62ddc461fa
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-21 08:02:22 +00:00
Vikas Pachdha
d55373cab2 Android: Enable setting environment variables for android apps
Change-Id: Id4625f081d6997dcabad9b01fb09d6c9c6ef7477
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-08-02 10:01:12 +00:00
Vikas Pachdha
1b12da2493 Android: Support commandline arguments for Android app
Change-Id: I3910b68ebbf00e1b62da663a3e58224413a1929e
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: hjk <hjk@qt.io>
2018-08-02 10:00:57 +00:00
Vikas Pachdha
b8da47af9c Android: Log Qt live apk path and few more code paths
Change-Id: Id743db4865b399c619c04fc393540758352c60e1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-07-19 14:47:58 +00:00
Eike Ziller
d09b71d260 Merge remote-tracking branch 'origin/4.7'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/android/androiddebugsupport.cpp

Change-Id: I01c4880850ad25432a65bb32849365d2aeb0756f
2018-07-10 07:44:53 +02:00
Vikas Pachdha
d9bcf78270 Android: Use ipv4 host to connect to app in android
IPv6 enabled systems can have IPv4 and an IPv6 entry for localhost
and macos seems to prefer IPv6 for localhost and IPv6 is not
supported by adbd

Task-number: QTCREATORBUG-20730
Change-Id: Ia0823fa04581afc6297e5e8d57a8034ba1b5749c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-06 06:07:22 +00:00
Vikas Pachdha
aa4407e332 Android: add logging for build and run
Change-Id: Idca5a45713762aa9e2861dcc58c3bbd96cbe687e
Reviewed-by: hjk <hjk@qt.io>
2018-07-04 07:04:03 +00:00
Ulf Hermann
dab2045099 Android: Make sure we can queue AndroidDeviceInfo in connections
Change-Id: I7f59cba50e180ea4584442f8c2a409abb9e49a33
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-22 07:33:15 +00:00
Ulf Hermann
0f7abe3737 Android: Don't start avd if AndroidDeviceInfo doesn't want it
If the avdname is empty, we have a physical device, rather than an
emulater, and no avd is necessary.

Change-Id: I5eeaa02ae505cce80da5f27ad9a5e1dddcabb4e2
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-22 07:32:58 +00:00
hjk
130b08925d Android: Use packageName directly in AndroidRunnerWorker
That was the only remaining field of the AndroidRunnable, passing
the packageName as single string is sufficient.

Change-Id: I73333e58a0719df09d6905eb212007ce421f600e
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-16 10:34:01 +00:00
hjk
099f8c7e80 Android: Remove AndroidRunnable::{beforeStart,afterFinish}AdbCommands
We have nowadays two ways to pass data from run configurations to
tool that do not require intimate knowledge of the sender:

1. Using RunConfigurationAspects, accessible for all workers in a
   RunControl
2. Using RunWorker::recordData for an individual worker.

This removes the need to use specific fields in a runnable and
means that a tool plugin can be better separated from target plugins.

The approaches are not mutually exclusive, both use an string-ish
id, I chose here to use the same string when using both.

This patch here uses approach 2. for the GammaRay/Android combo.
It also fixes a (harmless) typo (s/POSTSTART/POSTFINISH).

Change-Id: I4048693ca73b17253a39bfcacc9e1880ecf25736
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-05-16 10:18:27 +00:00
hjk
6585edf143 Android: Pass RunWorker to AndroidRunnerWorker
The RunWorker will carry the amPreStart/amPostFinish commands later,
and the run control is still accessible via worker->runControl().

Change-Id: Ieac1a1d2a5a8689025a7707b218df44ef2485b16
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-05-16 08:22:38 +00:00
hjk
cf01d20f95 Android: Remove AndroidRunnable::amStartExtraArgs
It was only set up in AndroidRunner from the run configuration
and passed to AndroidRunnerWorker, instead get in in the
AndroidRunnerWorker from the run configuration directly.

Change-Id: I52fc793f07ca766a80a1b06f216f850da0b563ed
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-05-16 08:22:06 +00:00
hjk
0031dbb667 Android: Remove AndroidRunnable::intentName
It was only uses to pass the intent from the Runner to the RunnerWorker,
use a normal stand-alone QString member and setter instead.

Change-Id: I0fde87b0177d4ed013f9599600929070362ea09c
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-15 10:36:48 +00:00
hjk
52e0b47c3f Android: Flatten then AndroidRunnerWorker hierarchy again
The difference was the selection of findProcessPID vs
findProcessPIDPreNougat functions, done by a flag now
passed to and used inside a combined findProcessPID function.

Change-Id: I738cdac1a81302c2207f9bc3c74c7cf916ca4089
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-11 08:44:38 +00:00
hjk
8e7c1bf1ab Android: Remove m_extraAppParams and m_extraEnvVars from Runnable
The idea was actually to make AndroidRunnable and "everything else",
i.e. StandardRunnable more similar over time to lessen the impact
of the "matrix" problem. The two removed items are avoidable.

Change-Id: I8ef011d76e2ad0154194ff5141ef8eb92cf235f3
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-05-09 09:27:37 +00:00
hjk
ba01d8729e Android: Remove m_deviceSerialNumber and m_apiLevel from Runnable
It's nothing that can be chosen freely, rather a feature of
the current setup/device.

Change-Id: I39460e22dab56adcce9da44f61a895923fb8c2a0
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-05-09 08:54:09 +00:00
hjk
2487768388 Android: Make runconfiguration use aspects
Change-Id: I6d89de901e64b2f29d62073e458eb6cd86c44acd
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-05-09 08:14:02 +00:00
hjk
c4e3cda26a Android: Remove traces of special debugger setup
Change-Id: Ibf85a6e6e7c025287dd388bc5908cefc30fbaa2f
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-08 09:56:09 +00:00
Eike Ziller
185fe0c705 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/android/androidrunnable.h
	src/plugins/android/androidrunner.cpp
	src/plugins/qmakeandroidsupport/qmakeandroidrunconfiguration.cpp
	src/plugins/qmakeprojectmanager/qmakeproject.cpp
	src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp

Change-Id: I68093d44cfd672347eab82459ff70c21a32297ce
2018-04-17 10:09:35 +02:00
BogDan Vatra
429c596395 Android: Fix debugging on Android 8+
The new way is much reliable and now we can debug all the libs from very
first start, including static constructors, JNI_OnLoad, etc.

The downside is that the startup is a little bit slower then before.
On a Ryzen 1700X is 2 to 5 seconds slower.

Task-number: QTCREATORBUG-19081
Change-Id: Iacedf7b8aa84de5026f9c81eeca35dd377cf4640
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-13 14:05:40 +00:00
Ulf Hermann
6a964d8d0b Android: Support the extraenvvars and extraappparams options
The Qt/Android runtime does support passing parameters to the
application. We have to pass '-e extraappparams <base64 string>' and
'-e extraenvvars <base64 strings, concatenated by ";">'. This is very
handy and should actually be exposed in the GUI.

Change-Id: I8c84a53ab8f6f07ea5b6e01c902f53385df8b35f
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-02-14 12:31:45 +00:00
Ulf Hermann
9771333f9f Android: Tolerate foreign run configurations
The only things specific to AndroidRunConfiguration are
amStartExtraArgs() and postFinishShellCommands(). Those are considered
to be empty on foreign configurations.

Change-Id: Ia0b8381c30225942e8704db04d17a8bdd3d2c806
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-02-14 12:31:15 +00:00
Eike Ziller
e2baa116ca Merge remote-tracking branch 'origin/4.5'
Change-Id: I86852d289c22210a0439e8e297819dc7276a96de
2017-11-29 09:56:22 +01:00
Nikolay Shalakin
54498da3b4 avoid crash during Android Virtual Device Manager launch
Change-Id: I9d496fd8e6b976f2cdfe891139475636ad3be018
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-11-28 09:53:06 +00:00
Ulf Hermann
9fef8ff319 Android: Add support for QML preview
Change-Id: Ib1dc4f21686c14abf15e8a8bda82bff34ec019b4
Reviewed-by: hjk <hjk@qt.io>
2017-11-08 09:11:45 +00:00
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