forked from qt-creator/qt-creator
Android: Fix uploading file on Windows
Quoting of arguments on Windows behaves differently depending on the used start() overload of QProcess. Setting the program and arguments before calling start() with only the QIODevice::OpenMode parameter allows to preserve the wanted quoting. Task-number: QTCREATORBUG-21547 Done-with: Oliver Wolff <oliver.wolff@qt.io> Change-Id: I644ea0737d51d6114facb19a0ad70f10aeb79f2c Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -278,7 +278,7 @@ bool AndroidRunnerWorker::uploadFile(const QString &from, const QString &to, con
|
||||
if (!f.open(QIODevice::ReadOnly))
|
||||
return false;
|
||||
runAdb({"shell", "run-as", m_packageName, "rm", to});
|
||||
auto res = runAdb({"shell", "run-as", m_packageName, "sh", "-c", QString("'cat > %1'").arg(to)}, 60, f.readAll());
|
||||
auto res = runAdb({"shell", "run-as", m_packageName, QString("sh -c 'cat > %1'").arg(to)}, 60, f.readAll());
|
||||
if (!res)
|
||||
return false;
|
||||
return runAdb({"shell", "run-as", m_packageName, "chmod", flags, to});
|
||||
|
||||
Reference in New Issue
Block a user