diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index a764167f365..335103f3ba7 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -288,6 +288,12 @@ bool AndroidRunnerWorker::packageFileExists(const QString &filePath) return success && !output.trimmed().isEmpty(); } +void AndroidRunnerWorker::compileAppProfiles() +{ + runAdb({"shell", "pm", "art", "clear-app-profiles", m_packageName}); + runAdb({"shell", "pm", "compile", "-m", "verify", "-f", m_packageName}); +} + QStringList AndroidRunnerWorker::selector() const { return AndroidDeviceInfo::adbSelector(m_deviceSerialNumber); @@ -808,6 +814,7 @@ void AndroidRunnerWorker::onProcessIdChanged(const PidUserPair &pidUser) for (const QString &entry: std::as_const(m_afterFinishAdbCommands)) runAdb(entry.split(' ', Qt::SkipEmptyParts)); } else { + compileAppProfiles(); if (m_useCppDebugger) startNativeDebugging(); // In debugging cases this will be funneled to the engine to actually start diff --git a/src/plugins/android/androidrunnerworker.h b/src/plugins/android/androidrunnerworker.h index bba8d351041..6b9ae2dae6a 100644 --- a/src/plugins/android/androidrunnerworker.h +++ b/src/plugins/android/androidrunnerworker.h @@ -66,6 +66,7 @@ private: bool startDebuggerServer(const QString &packageDir, const QString &debugServerFile, QString *errorStr = nullptr); bool deviceFileExists(const QString &filePath); bool packageFileExists(const QString& filePath); + void compileAppProfiles(); bool uploadDebugServer(const QString &debugServerFileName); void asyncStartLogcat();