Commit 64584734 authored by Jake Petroules's avatar Jake Petroules

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's avatarEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Riitta-Leena Miettinen's avatarLeena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Vikas Pachdha's avatarVikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: default avatarBogDan Vatra <bogdan@kdab.com>
parent f98731b8
......@@ -82,22 +82,6 @@
To use Ministro to install the Qt libraries, select the
\uicontrol {Use Ministro service to install Qt} option.
\section1 Deploying Qt Libraries for Debugging
To test your application on a device that is physically connected to the
development host (or on an emulator), you can copy the Qt libraries into a
temporary directory on your device and run the application against them.
An APK built in this way is not distributable, since it relies on the device
containing the Qt libraries in the correct location. However, as the Qt
libraries are only copied into the device once, this method provides a fast
turn-around time, and is therefore convenient for testing the application
during development.
Select the \uicontrol {Deploy local Qt libraries to temporary directory} option to
deploy Qt libraries to the \c{/data/local/tmp/qt} folder on the device and
to run the application against them.
\section1 Packaging Applications
Because bundling applications as APK packages is not
......
......@@ -115,12 +115,8 @@ AndroidBuildApkStep::AndroidBuildApkStep(ProjectExplorer::BuildStepList *parent,
m_buildTargetSdk(other->m_buildTargetSdk)
{
const QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
if (version->qtVersion() < QtSupport::QtVersionNumber(5, 4, 0)) {
if (m_deployAction == DebugDeployment)
m_deployAction = BundleLibrariesDeployment;
if (m_useGradle)
m_useGradle = false;
}
if (m_useGradle && version->qtVersion() < QtSupport::QtVersionNumber(5, 4, 0))
m_useGradle = false;
}
bool AndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps)
......@@ -237,11 +233,8 @@ bool AndroidBuildApkStep::verifyCertificatePassword()
bool AndroidBuildApkStep::fromMap(const QVariantMap &map)
{
m_deployAction = AndroidDeployAction(map.value(DeployActionKey, BundleLibrariesDeployment).toInt());
if ( m_deployAction == DebugDeployment
&& QtSupport::QtKitInformation::qtVersion(target()->kit())->qtVersion() < QtSupport::QtVersionNumber(5, 4, 0)) {
m_deployAction = BundleLibrariesDeployment;
}
if (m_deployAction > BundleLibrariesDeployment)
m_deployAction = BundleLibrariesDeployment; // BundleLibrariesDeployment used to be 2
m_keystorePath = Utils::FileName::fromString(map.value(KeystoreLocationKey).toString());
m_signPackage = false; // don't restore this
m_buildTargetSdk = map.value(BuildTargetSdkKey).toString();
......
......@@ -44,7 +44,6 @@ public:
enum AndroidDeployAction
{
MinistroDeployment, // use ministro
DebugDeployment,
BundleLibrariesDeployment
};
......
......@@ -69,9 +69,6 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step)
case AndroidBuildApkStep::MinistroDeployment:
m_ui->ministroOption->setChecked(true);
break;
case AndroidBuildApkStep::DebugDeployment:
m_ui->temporaryQtOption->setChecked(true);
break;
case AndroidBuildApkStep::BundleLibrariesDeployment:
m_ui->bundleQtOption->setChecked(true);
break;
......@@ -91,7 +88,6 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step)
m_ui->signingDebugWarningIcon->setPixmap(Utils::Icons::WARNING.pixmap());
m_ui->signingDebugWarningIcon->hide();
m_ui->signingDebugWarningLabel->hide();
m_ui->signingDebugDeployErrorIcon->setPixmap(Utils::Icons::CRITICAL.pixmap());
signPackageCheckBoxToggled(m_step->signPackage());
m_ui->useGradleCheckBox->setEnabled(config.antScriptsAvailable());
......@@ -109,16 +105,8 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step)
// deployment options
connect(m_ui->ministroOption, &QAbstractButton::clicked,
this, &AndroidBuildApkWidget::setMinistro);
connect(m_ui->temporaryQtOption, &QAbstractButton::clicked,
this, &AndroidBuildApkWidget::setDeployLocalQtLibs);
connect(m_ui->bundleQtOption, &QAbstractButton::clicked,
this, &AndroidBuildApkWidget::setBundleQtLibs);
connect(m_ui->ministroOption, &QAbstractButton::clicked,
this, &AndroidBuildApkWidget::updateDebugDeploySigningWarning);
connect(m_ui->temporaryQtOption, &QAbstractButton::clicked,
this, &AndroidBuildApkWidget::updateDebugDeploySigningWarning);
connect(m_ui->bundleQtOption, &QAbstractButton::clicked,
this, &AndroidBuildApkWidget::updateDebugDeploySigningWarning);
connect(m_ui->useGradleCheckBox, &QAbstractButton::toggled,
this, &AndroidBuildApkWidget::useGradleCheckBoxToggled);
......@@ -147,10 +135,8 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step)
this, &AndroidBuildApkWidget::updateSigningWarning);
updateSigningWarning();
updateDebugDeploySigningWarning();
QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(step->target()->kit());
bool qt54 = qt->qtVersion() >= QtSupport::QtVersionNumber(5, 4, 0);
m_ui->temporaryQtOption->setVisible(qt54);
m_ui->useGradleCheckBox->setVisible(qt54);
}
......@@ -179,11 +165,6 @@ void AndroidBuildApkWidget::setMinistro()
m_step->setDeployAction(AndroidBuildApkStep::MinistroDeployment);
}
void AndroidBuildApkWidget::setDeployLocalQtLibs()
{
m_step->setDeployAction(AndroidBuildApkStep::DebugDeployment);
}
void AndroidBuildApkWidget::setBundleQtLibs()
{
m_step->setDeployAction(AndroidBuildApkStep::BundleLibrariesDeployment);
......@@ -267,20 +248,6 @@ void AndroidBuildApkWidget::updateSigningWarning()
}
}
void AndroidBuildApkWidget::updateDebugDeploySigningWarning()
{
if (m_step->deployAction() == AndroidBuildApkStep::DebugDeployment) {
m_ui->signingDebugDeployError->setVisible(true);
m_ui->signingDebugDeployErrorIcon->setVisible(true);
m_ui->signPackageCheckBox->setChecked(false);
m_ui->signPackageCheckBox->setEnabled(false);
} else {
m_ui->signingDebugDeployError->setVisible(false);
m_ui->signingDebugDeployErrorIcon->setVisible(false);
m_ui->signPackageCheckBox->setEnabled(true);
}
}
void AndroidBuildApkWidget::useGradleCheckBoxToggled(bool checked)
{
m_step->setUseGradle(checked);
......
......@@ -52,13 +52,11 @@ public:
private:
void setTargetSdk(const QString &sdk);
void setMinistro();
void setDeployLocalQtLibs();
void setBundleQtLibs();
void createKeyStore();
void certificatesAliasComboBoxCurrentIndexChanged(const QString &alias);
void certificatesAliasComboBoxActivated(const QString &alias);
void updateSigningWarning();
void updateDebugDeploySigningWarning();
void useGradleCheckBoxToggled(bool checked);
void openPackageLocationCheckBoxToggled(bool checked);
void verboseOutputCheckBoxToggled(bool checked);
......
......@@ -117,37 +117,6 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="signingDebugDeployErrorIcon">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="signingDebugDeployError">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Signing an APK that uses &quot;Deploy local Qt libraries&quot; is not allowed.
Deploying local Qt libraries is incompatible with Android 5.</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
......@@ -280,17 +249,6 @@ Deploying local Qt libraries is incompatible with Android 5.</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="temporaryQtOption">
<property name="toolTip">
<string>Pushes local Qt libraries to device. You must have Qt libraries compiled for that platform.
The APK will not be usable on any other device.</string>
</property>
<property name="text">
<string>Deploy local Qt libraries to temporary directory</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......
......@@ -941,11 +941,10 @@ void AndroidConfigurations::setConfig(const AndroidConfig &devConfigs)
}
AndroidDeviceInfo AndroidConfigurations::showDeviceDialog(Project *project,
int apiLevel, const QString &abi,
Options options)
int apiLevel, const QString &abi)
{
QString serialNumber = defaultDevice(project, abi);
AndroidDeviceDialog dialog(apiLevel, abi, options, serialNumber, Core::ICore::mainWindow());
AndroidDeviceDialog dialog(apiLevel, abi, serialNumber, Core::ICore::mainWindow());
AndroidDeviceInfo info = dialog.device();
if (dialog.saveDeviceSelection() && info.isValid()) {
const QString serialNumber = info.type == AndroidDeviceInfo::Hardware ?
......
......@@ -233,8 +233,7 @@ public:
static AndroidConfigurations *instance();
static void updateAndroidDevice();
enum Options { None, FilterAndroid5 };
static AndroidDeviceInfo showDeviceDialog(ProjectExplorer::Project *project, int apiLevel, const QString &abi, Options options);
static AndroidDeviceInfo showDeviceDialog(ProjectExplorer::Project *project, int apiLevel, const QString &abi);
static void setDefaultDevice(ProjectExplorer::Project *project, const QString &abi, const QString &serialNumber); // serial number or avd name
static QString defaultDevice(ProjectExplorer::Project *project, const QString &abi); // serial number or avd name
static void clearDefaultDevices(ProjectExplorer::Project *project);
......
......@@ -161,12 +161,9 @@ bool AndroidDeployQtStep::init(QList<const BuildStep *> &earlierSteps)
}
int deviceAPILevel = AndroidManager::minimumSDK(target());
AndroidConfigurations::Options options = AndroidConfigurations::None;
if (androidBuildApkStep->deployAction() == AndroidBuildApkStep::DebugDeployment)
options = AndroidConfigurations::FilterAndroid5;
AndroidDeviceInfo info = earlierDeviceInfo(earlierSteps, Id);
if (!info.isValid()) {
info = AndroidConfigurations::showDeviceDialog(project(), deviceAPILevel, m_targetArch, options);
info = AndroidConfigurations::showDeviceDialog(project(), deviceAPILevel, m_targetArch);
m_deviceInfo = info; // Keep around for later steps
}
......@@ -232,9 +229,6 @@ bool AndroidDeployQtStep::init(QList<const BuildStep *> &earlierSteps)
case AndroidBuildApkStep::MinistroDeployment:
Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("ministro"));
break;
case AndroidBuildApkStep::DebugDeployment:
Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("debug"));
break;
case AndroidBuildApkStep::BundleLibrariesDeployment:
Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("bundled"));
break;
......
......@@ -237,7 +237,7 @@ class AndroidDeviceModel : public QAbstractItemModel
{
Q_OBJECT
public:
AndroidDeviceModel(int apiLevel, const QString &abi, AndroidConfigurations::Options options);
AndroidDeviceModel(int apiLevel, const QString &abi);
QModelIndex index(int row, int column,
const QModelIndex &parent = QModelIndex()) const;
QModelIndex parent(const QModelIndex &child) const;
......@@ -253,7 +253,6 @@ public:
private:
int m_apiLevel;
QString m_abi;
AndroidConfigurations::Options m_options;
AndroidDeviceModelNode *m_root;
};
......@@ -262,8 +261,8 @@ private:
/////////////////
// AndroidDeviceModel
/////////////////
AndroidDeviceModel::AndroidDeviceModel(int apiLevel, const QString &abi, AndroidConfigurations::Options options)
: m_apiLevel(apiLevel), m_abi(abi), m_options(options), m_root(0)
AndroidDeviceModel::AndroidDeviceModel(int apiLevel, const QString &abi)
: m_apiLevel(apiLevel), m_abi(abi), m_root(0)
{
}
......@@ -372,8 +371,6 @@ void AndroidDeviceModel::setDevices(const QVector<AndroidDeviceInfo> &devices)
} else if (device.sdk < m_apiLevel) {
error = AndroidDeviceDialog::tr("API Level of device is: %1.")
.arg(device.sdk);
} else if (device.sdk > 20 && (m_options & AndroidConfigurations::FilterAndroid5)) {
error = AndroidDeviceDialog::tr("Android 5 devices are incompatible with deploying Qt to a temporary directory.");
} else {
new AndroidDeviceModelNode(compatibleDevices, device);
continue;
......@@ -417,10 +414,10 @@ static inline QString msgAdbListDevices()
return AndroidDeviceDialog::tr("<p>The adb tool in the Android SDK lists all connected devices if run via &quot;adb devices&quot;.</p>");
}
AndroidDeviceDialog::AndroidDeviceDialog(int apiLevel, const QString &abi, AndroidConfigurations::Options options,
AndroidDeviceDialog::AndroidDeviceDialog(int apiLevel, const QString &abi,
const QString &serialNumber, QWidget *parent) :
QDialog(parent),
m_model(new AndroidDeviceModel(apiLevel, abi, options)),
m_model(new AndroidDeviceModel(apiLevel, abi)),
m_ui(new Ui::AndroidDeviceDialog),
m_apiLevel(apiLevel),
m_abi(abi),
......
......@@ -52,7 +52,7 @@ class AndroidDeviceDialog : public QDialog
Q_OBJECT
public:
explicit AndroidDeviceDialog(int apiLevel, const QString &abi, AndroidConfigurations::Options opts,
explicit AndroidDeviceDialog(int apiLevel, const QString &abi,
const QString &serialNumber, QWidget *parent = 0);
~AndroidDeviceDialog();
......
......@@ -341,7 +341,7 @@ void AndroidManager::cleanLibsOnDevice(ProjectExplorer::Target *target)
if (targetArch.isEmpty())
return;
const int deviceAPILevel = AndroidManager::minimumSDK(target);
AndroidDeviceInfo info = AndroidConfigurations::showDeviceDialog(target->project(), deviceAPILevel, targetArch, AndroidConfigurations::None);
AndroidDeviceInfo info = AndroidConfigurations::showDeviceDialog(target->project(), deviceAPILevel, targetArch);
if (!info.isValid()) // aborted
return;
......@@ -371,7 +371,7 @@ void AndroidManager::installQASIPackage(ProjectExplorer::Target *target, const Q
if (targetArch.isEmpty())
return;
const int deviceAPILevel = AndroidManager::minimumSDK(target);
AndroidDeviceInfo info = AndroidConfigurations::showDeviceDialog(target->project(), deviceAPILevel, targetArch, AndroidConfigurations::None);
AndroidDeviceInfo info = AndroidConfigurations::showDeviceDialog(target->project(), deviceAPILevel, targetArch);
if (!info.isValid()) // aborted
return;
......
......@@ -814,8 +814,7 @@ void AndroidRunner::launchAVD()
// Get AVD info.
AndroidDeviceInfo info = AndroidConfigurations::showDeviceDialog(
m_target->project(), deviceAPILevel, targetArch,
AndroidConfigurations::None);
m_target->project(), deviceAPILevel, targetArch);
AndroidManager::setDeviceSerialNumber(m_target, info.serialNumber);
m_androidRunnable.deviceSerialNumber = info.serialNumber;
emit androidRunnableChanged(m_androidRunnable);
......
......@@ -138,8 +138,6 @@ bool QmakeAndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps)
QString deploymentMethod;
if (m_deployAction == MinistroDeployment)
deploymentMethod = "ministro";
else if (m_deployAction == DebugDeployment)
deploymentMethod = "debug";
else if (m_deployAction == BundleLibrariesDeployment)
deploymentMethod = "bundled";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment