forked from qt-creator/qt-creator
CommandLine: Reuse new c'tor
Change-Id: Id154881b4f5d8c488e5c1f5e0f843d36bf838759 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -237,17 +237,17 @@ GroupItem DeviceCtlRunner::launchTask(const QString &bundleIdentifier)
|
||||
return SetupResult::StopWithError;
|
||||
}
|
||||
process.setCommand({FilePath::fromString("/usr/bin/xcrun"),
|
||||
QStringList{"devicectl",
|
||||
"device",
|
||||
"process",
|
||||
"launch",
|
||||
"--device",
|
||||
m_device->uniqueInternalDeviceId(),
|
||||
"--quiet",
|
||||
"--json-output",
|
||||
"-",
|
||||
bundleIdentifier}
|
||||
+ m_arguments});
|
||||
{"devicectl",
|
||||
"device",
|
||||
"process",
|
||||
"launch",
|
||||
"--device",
|
||||
m_device->uniqueInternalDeviceId(),
|
||||
"--quiet",
|
||||
"--json-output",
|
||||
"-",
|
||||
bundleIdentifier,
|
||||
m_arguments}});
|
||||
return SetupResult::Continue;
|
||||
};
|
||||
const auto onDone = [this](const Process &process, DoneWith result) {
|
||||
|
||||
@@ -86,20 +86,18 @@ static expected_str<void> runCommand(
|
||||
}
|
||||
|
||||
static expected_str<void> runSimCtlCommand(
|
||||
QStringList args,
|
||||
const QStringList &args,
|
||||
QString *output,
|
||||
QString *allOutput = nullptr,
|
||||
std::function<bool()> shouldStop = [] { return false; })
|
||||
{
|
||||
args.prepend("simctl");
|
||||
|
||||
// Cache xcrun's path, as this function will be called often.
|
||||
static FilePath xcrun = FilePath::fromString("xcrun").searchInPath();
|
||||
if (xcrun.isEmpty())
|
||||
return make_unexpected(Tr::tr("Cannot find xcrun."));
|
||||
else if (!xcrun.isExecutableFile())
|
||||
return make_unexpected(Tr::tr("xcrun is not executable."));
|
||||
return runCommand({xcrun, args}, output, allOutput, shouldStop);
|
||||
return runCommand({xcrun, {"simctl", args}}, output, allOutput, shouldStop);
|
||||
}
|
||||
|
||||
static expected_str<void> launchSimulator(const QString &simUdid, std::function<bool()> shouldStop)
|
||||
|
||||
Reference in New Issue
Block a user