diff options
author | BogDan Vatra <bogdan@kdab.com> | 2017-02-28 14:03:20 +0200 |
---|---|---|
committer | BogDan Vatra <bogdan@kdab.com> | 2017-04-12 06:33:55 +0000 |
commit | 750f25d9e69068b3ca67a5ba8df180d84ce679da (patch) | |
tree | 2ae14f1246eacab7aa1b9c74e9f2a12fd6dbaaaa /src/plugins/android | |
parent | 598100c765d243fb5093e2d554dd7648e9bd282a (diff) | |
download | qt-creator-750f25d9e69068b3ca67a5ba8df180d84ce679da.tar.gz |
Fix release builds debugging
Add gdbserver all the time, except when the user signs the package.
Even then the user can "Force debugging" by checking the checkbox.
Change-Id: I274243786f3d6d6b88f41e532bebc24213f5e9db
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/android')
-rw-r--r-- | src/plugins/android/androidbuildapkstep.cpp | 10 | ||||
-rw-r--r-- | src/plugins/android/androidbuildapkstep.h | 4 | ||||
-rw-r--r-- | src/plugins/android/androidbuildapkwidget.cpp | 4 | ||||
-rw-r--r-- | src/plugins/android/androidbuildapkwidget.ui | 34 |
4 files changed, 50 insertions, 2 deletions
diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 0ff998809f..4064839288 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -342,6 +342,16 @@ void AndroidBuildApkStep::setUseGradle(bool b) } } +bool AndroidBuildApkStep::addDebugger() const +{ + return m_addDebugger; +} + +void AndroidBuildApkStep::setAddDebugger(bool debug) +{ + m_addDebugger = debug; +} + bool AndroidBuildApkStep::verboseOutput() const { return m_verbose; diff --git a/src/plugins/android/androidbuildapkstep.h b/src/plugins/android/androidbuildapkstep.h index 0d044c0ccc..c6cfb96909 100644 --- a/src/plugins/android/androidbuildapkstep.h +++ b/src/plugins/android/androidbuildapkstep.h @@ -73,6 +73,9 @@ public: bool useGradle() const; void setUseGradle(bool b); + bool addDebugger() const; + void setAddDebugger(bool debug); + QString buildTargetSdk() const; void setBuildTargetSdk(const QString &sdk); @@ -102,6 +105,7 @@ protected: bool m_useGradle = false; bool m_openPackageLocation = false; bool m_openPackageLocationForRun = false; + bool m_addDebugger = true; QString m_buildTargetSdk; Utils::FileName m_keystorePath; diff --git a/src/plugins/android/androidbuildapkwidget.cpp b/src/plugins/android/androidbuildapkwidget.cpp index 2e85c243fc..bce4508e05 100644 --- a/src/plugins/android/androidbuildapkwidget.cpp +++ b/src/plugins/android/androidbuildapkwidget.cpp @@ -94,6 +94,7 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step) m_ui->useGradleCheckBox->setChecked(m_step->useGradle()); m_ui->verboseOutputCheckBox->setChecked(m_step->verboseOutput()); m_ui->openPackageLocationCheckBox->setChecked(m_step->openPackageLocation()); + m_ui->addDebuggerCheckBox->setChecked(m_step->addDebugger()); // target sdk connect(m_ui->targetSDKComboBox, @@ -120,6 +121,8 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step) this, &AndroidBuildApkWidget::openPackageLocationCheckBoxToggled); connect(m_ui->verboseOutputCheckBox, &QAbstractButton::toggled, this, &AndroidBuildApkWidget::verboseOutputCheckBoxToggled); + connect(m_ui->addDebuggerCheckBox, &QAbstractButton::toggled, + m_step, &AndroidBuildApkStep::setAddDebugger); //signing connect(m_ui->signPackageCheckBox, &QAbstractButton::toggled, @@ -185,6 +188,7 @@ void AndroidBuildApkWidget::signPackageCheckBoxToggled(bool checked) { m_ui->certificatesAliasComboBox->setEnabled(checked); m_step->setSignPackage(checked); + m_ui->addDebuggerCheckBox->setChecked(!checked); updateSigningWarning(); if (!checked) return; diff --git a/src/plugins/android/androidbuildapkwidget.ui b/src/plugins/android/androidbuildapkwidget.ui index e5565873af..d74066ce64 100644 --- a/src/plugins/android/androidbuildapkwidget.ui +++ b/src/plugins/android/androidbuildapkwidget.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>819</width> - <height>390</height> + <height>478</height> </rect> </property> <property name="windowTitle"> @@ -197,6 +197,19 @@ Deploying local Qt libraries is incompatible with Android 5.</string> </property> </widget> </item> + <item row="3" column="0"> + <widget class="QCheckBox" name="addDebuggerCheckBox"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="toolTip"> + <string>Packages debug server with the APK to enable debugging. For the signed APK this option is unchecked by default.</string> + </property> + <property name="text"> + <string>Add debug server</string> + </property> + </widget> + </item> </layout> </widget> </item> @@ -254,5 +267,22 @@ The APK will not be usable on any other device.</string> </customwidget> </customwidgets> <resources/> - <connections/> + <connections> + <connection> + <sender>signPackageCheckBox</sender> + <signal>clicked(bool)</signal> + <receiver>addDebuggerCheckBox</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>113</x> + <y>178</y> + </hint> + <hint type="destinationlabel"> + <x>510</x> + <y>452</y> + </hint> + </hints> + </connection> + </connections> </ui> |