Use correct snapshots folder.

Fix bug in APK installer.
This commit is contained in:
NissimHadar 2019-03-11 17:11:09 -07:00
parent 7419f9899e
commit d4b77d15cc

View file

@ -43,7 +43,7 @@ TestRunnerMobile::TestRunnerMobile(
_installAPKPushbutton = installAPKPushbutton; _installAPKPushbutton = installAPKPushbutton;
_runInterfacePushbutton = runInterfacePushbutton; _runInterfacePushbutton = runInterfacePushbutton;
folderLineEdit->setText("/sdcard/DCIM/TEST"); folderLineEdit->setText("/sdcard/snapshots");
modelNames["SM_G955U1"] = "Samsung S8+ unlocked"; modelNames["SM_G955U1"] = "Samsung S8+ unlocked";
modelNames["SM_N960U1"] = "Samsung Note 9 unlocked"; modelNames["SM_N960U1"] = "Samsung Note 9 unlocked";
@ -163,7 +163,6 @@ void TestRunnerMobile::installAPK() {
_adbInterface = new AdbInterface(); _adbInterface = new AdbInterface();
} }
if (_installerFilename.isNull()) {
QString installerPathname = QFileDialog::getOpenFileName(nullptr, "Please select the APK", _workingFolder, QString installerPathname = QFileDialog::getOpenFileName(nullptr, "Please select the APK", _workingFolder,
"Available APKs (*.apk)" "Available APKs (*.apk)"
); );
@ -172,13 +171,8 @@ void TestRunnerMobile::installAPK() {
return; return;
} }
// Remove the path
QStringList parts = installerPathname.split('/');
_installerFilename = parts[parts.length() - 1];
}
_statusLabel->setText("Installing"); _statusLabel->setText("Installing");
QString command = _adbInterface->getAdbCommand() + " install -r -d " + _workingFolder + "/" + _installerFilename + " >" + _workingFolder + "/installOutput.txt"; QString command = _adbInterface->getAdbCommand() + " install -r -d " + installerPathname + " >" + _workingFolder + "/installOutput.txt";
appendLog(command); appendLog(command);
system(command.toStdString().c_str()); system(command.toStdString().c_str());
_statusLabel->setText("Installation complete"); _statusLabel->setText("Installation complete");