Skip to content
Snippets Groups Projects
Commit d6520122 authored by BogDan Vatra's avatar BogDan Vatra
Browse files

Android: Pull the right libc.so from device.


On an 64 bit Android, libc.so for 64 bit apps is located in /system/lib64/.

Change-Id: I93f0e4658e552c9a32822706bab3e503642a8c59
Reviewed-by: default avatarDaniel Teske <daniel.teske@theqtcompany.com>
parent 2a115487
No related branches found
No related tags found
No related merge requests found
...@@ -203,12 +203,16 @@ bool AndroidDeployQtStep::init() ...@@ -203,12 +203,16 @@ bool AndroidDeployQtStep::init()
m_avdName = info.avdname; m_avdName = info.avdname;
m_serialNumber = info.serialNumber; m_serialNumber = info.serialNumber;
m_appProcess = QLatin1String("readlink -f /system/bin/app_process"); m_appProcess = QLatin1String("readlink -f /system/bin/app_process");
if (info.cpuAbi.contains(QLatin1String("arm64-v8a"))) { m_libdir = QLatin1String("lib");
if (info.cpuAbi.contains(QLatin1String("arm64-v8a")) ||
info.cpuAbi.contains(QLatin1String("x86_64"))) {
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit()); ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
if (tc && tc->targetAbi().wordWidth() == 64) if (tc && tc->targetAbi().wordWidth() == 64) {
m_appProcess += QLatin1String("64"); m_appProcess += QLatin1String("64");
else m_libdir += QLatin1String("64");
} else {
m_appProcess += QLatin1String("32"); m_appProcess += QLatin1String("32");
}
} }
AndroidManager::setDeviceSerialNumber(target(), m_serialNumber); AndroidManager::setDeviceSerialNumber(target(), m_serialNumber);
...@@ -436,9 +440,10 @@ void AndroidDeployQtStep::run(QFutureInterface<bool> &fi) ...@@ -436,9 +440,10 @@ void AndroidDeployQtStep::run(QFutureInterface<bool> &fi)
emit addOutput(tr("Package deploy: Failed to pull \"%1\" to \"%2\".") emit addOutput(tr("Package deploy: Failed to pull \"%1\" to \"%2\".")
.arg(remoteAppProcessFile).arg(localAppProcessFile), ErrorMessageOutput); .arg(remoteAppProcessFile).arg(localAppProcessFile), ErrorMessageOutput);
} }
runCommand(m_adbPath, runCommand(m_adbPath,
AndroidDeviceInfo::adbSelector(m_serialNumber) << QLatin1String("pull") AndroidDeviceInfo::adbSelector(m_serialNumber) << QLatin1String("pull")
<< QLatin1String("/system/lib/libc.so") << QLatin1String("/system/") + m_libdir + QLatin1String("/libc.so")
<< QString::fromLatin1("%1/libc.so").arg(m_buildDirectory)); << QString::fromLatin1("%1/libc.so").arg(m_buildDirectory));
fi.reportResult(returnValue == Success ? true : false); fi.reportResult(returnValue == Success ? true : false);
......
...@@ -128,6 +128,7 @@ private: ...@@ -128,6 +128,7 @@ private:
QString m_avdName; QString m_avdName;
QString m_apkPath; QString m_apkPath;
QString m_appProcess; QString m_appProcess;
QString m_libdir;
QString m_targetArch; QString m_targetArch;
bool m_uninstallPreviousPackage; bool m_uninstallPreviousPackage;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment