From 6f662ae450ed85784643ac1f1d31e114cde949ef Mon Sep 17 00:00:00 2001 From: Shazron Abdullah Date: Thu, 13 Nov 2014 17:33:44 -0800 Subject: [PATCH] Fixes phonegap/ios-deploy#37 - AMDeviceValidatePairing fails when uninstalling --- ios-deploy.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ios-deploy.c b/ios-deploy.c index 4540c03..e78d674 100644 --- a/ios-deploy.c +++ b/ios-deploy.c @@ -1490,13 +1490,15 @@ void handle_device(AMDeviceRef device) { assert(AMDeviceIsPaired(device)); assert(AMDeviceValidatePairing(device) == 0); assert(AMDeviceStartSession(device) == 0); - - assert(AMDeviceSecureUninstallApplication(0, device, bundle_id, 0, NULL, 0) == 0); - + + int code = AMDeviceSecureUninstallApplication(0, device, bundle_id, 0, NULL, 0); + if (code == 0) { + printf("[ OK ] Uninstalled package with bundle id %s\n", CFStringGetCStringPtr(bundle_id, CFStringGetSystemEncoding())); + } else { + printf("[ ERROR ] Could not uninstall package with bundle id %s\n", CFStringGetCStringPtr(bundle_id, CFStringGetSystemEncoding())); + } assert(AMDeviceStopSession(device) == 0); assert(AMDeviceDisconnect(device) == 0); - - printf("[ OK ] Uninstalled package with bundle id %s\n", CFStringGetCStringPtr(bundle_id, CFStringGetSystemEncoding())); } }