aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/api/runenvironment.cpp
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-06-26 10:32:13 -0700
committerJake Petroules <jake.petroules@qt.io>2017-06-27 16:35:00 +0000
commit9edb9f9de409f488c920fb295a0674f2bad5ff17 (patch)
tree78b4e6b9acc9bc3ad24dbf9ae595f318b6c767aa /src/lib/corelib/api/runenvironment.cpp
parent7e0191856b3c76517a2654183b52192713ff5770 (diff)
Fix running bundled applications on Apple platforms
Previously, Qbs would attempt to run the temporary copy of the application executable in the .tmp/ subdirectory of the product build directory. This patch corrects it so that it is run via the copy in the install root, or the actual bundle executable in the build directory. Change-Id: I988081e3f70ec52965e798c8193b75c2dcc4fdf9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/api/runenvironment.cpp')
-rw-r--r--src/lib/corelib/api/runenvironment.cpp21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/lib/corelib/api/runenvironment.cpp b/src/lib/corelib/api/runenvironment.cpp
index 4c4b4e681..96484815b 100644
--- a/src/lib/corelib/api/runenvironment.cpp
+++ b/src/lib/corelib/api/runenvironment.cpp
@@ -219,23 +219,8 @@ int RunEnvironment::doRunTarget(const QString &targetBin, const QStringList &arg
QStringList targetArguments = arguments;
const QString completeSuffix = QFileInfo(targetBin).completeSuffix();
- if (targetOS.contains(QLatin1String("ios"))) {
- QString bundlePath = d->resolvedProduct->buildDirectory();
- const bool install = d->resolvedProduct->moduleProperties->qbsPropertyValue(
- QLatin1String("install")).toBool();
- if (install) {
- bundlePath = d->installOptions.installRoot();
- const QString installDir = d->resolvedProduct->moduleProperties->qbsPropertyValue(
- QLatin1String("installDir")).toString();
- bundlePath += QLatin1Char('/') + installDir;
- }
-
- const QString bundleName = d->resolvedProduct->moduleProperties->moduleProperty(
- QLatin1String("bundle"),
- QLatin1String("bundleName")).toString();
- bundlePath += QLatin1Char('/') + bundleName;
-
- QBS_CHECK(targetExecutable.startsWith(bundlePath));
+ if (targetOS.contains(QLatin1String("ios")) || targetOS.contains(QLatin1String("tvos"))) {
+ const QString bundlePath = targetBin + QLatin1String("/..");
if (QFileInfo(targetExecutable = findExecutable(QStringList()
<< QStringLiteral("iostool"))).isExecutable()) {
@@ -256,7 +241,7 @@ int RunEnvironment::doRunTarget(const QString &targetBin, const QStringList &arg
targetArguments << QStringLiteral("--args") << arguments;
} else {
d->logger.qbsLog(LoggerError)
- << Tr::tr("No suitable iOS deployment tools were found in the environment. "
+ << Tr::tr("No suitable deployment tools were found in the environment. "
"Consider installing ios-deploy.");
return EXIT_FAILURE;
}