Fixes phonegap/ios-deploy#37 - AMDeviceValidatePairing fails when uninstalling

This commit is contained in:
Shazron Abdullah 2014-11-13 17:33:44 -08:00
parent 4617a7df59
commit 6f662ae450

View File

@ -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()));
}
}