Commit 350db248 authored by Vikas Pachdha's avatar Vikas Pachdha

iOS: Fix developer disk mount fail error

Task-number: QTCREATORBUG-17818
Change-Id: I172a3bc326ea777bed38e467c8a725acc68d13cd
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent e575a605
...@@ -151,6 +151,8 @@ typedef int (MDEV_API *AMDeviceSecureInstallApplicationPtr)(int, AMDeviceRef, CF ...@@ -151,6 +151,8 @@ typedef int (MDEV_API *AMDeviceSecureInstallApplicationPtr)(int, AMDeviceRef, CF
namespace Ios { namespace Ios {
namespace Internal { namespace Internal {
static const am_res_t DeveloperImageAlreadyInstalled = 0xe8000076; /*Already installed*/
class MobileDeviceLib { class MobileDeviceLib {
public : public :
MobileDeviceLib(); MobileDeviceLib();
...@@ -1033,12 +1035,13 @@ bool CommandSession::mountDeveloperDiskImage() { ...@@ -1033,12 +1035,13 @@ bool CommandSession::mountDeveloperDiskImage() {
if (connectDevice()) { if (connectDevice()) {
CFStringRef cfImgPath = imagePath.toCFString(); CFStringRef cfImgPath = imagePath.toCFString();
if (am_res_t result = lib()->deviceMountImage(device, cfImgPath, options, &mountCallback, 0)) { am_res_t result = lib()->deviceMountImage(device, cfImgPath, options, &mountCallback, 0);
addError(QString::fromLatin1("Mount Developer Disk Image \"%1\" failed, AMDeviceMountImage returned %2 (0x%3)") if (result == 0 || result == DeveloperImageAlreadyInstalled) {
.arg(imagePath).arg(mobileDeviceErrorString(lib(), result)).arg(QString::number(result, 16)));
} else {
// Mounting succeeded. // Mounting succeeded.
success = true; success = true;
} else {
addError(QString::fromLatin1("Mount Developer Disk Image \"%1\" failed, AMDeviceMountImage returned %2 (0x%3)")
.arg(imagePath).arg(mobileDeviceErrorString(lib(), result)).arg(QString::number(result, 16)));
} }
CFRelease(cfImgPath); CFRelease(cfImgPath);
disconnectDevice(); disconnectDevice();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment