Fix the error when try to access some apps' sandbox by using a different command to start house arrest service (#446)
diff --git a/src/ios-deploy/ios-deploy.m b/src/ios-deploy/ios-deploy.m
index 592df4a..1d3734c 100644
--- a/src/ios-deploy/ios-deploy.m
+++ b/src/ios-deploy/ios-deploy.m
@@ -1359,8 +1359,18 @@
}
CFStringRef cf_bundle_id = CFStringCreateWithCString(NULL, bundle_id, kCFStringEncodingUTF8);
- if (AMDeviceCreateHouseArrestService(device, cf_bundle_id, 0, &conn) != 0)
- {
+ CFStringRef keys[1];
+ keys[0] = CFSTR("Command");
+ CFStringRef values[1];
+ values[0] = CFSTR("VendDocuments");
+ CFDictionaryRef command = CFDictionaryCreate(kCFAllocatorDefault,
+ (void*)keys,
+ (void*)values,
+ 1,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ if (AMDeviceCreateHouseArrestService(device, cf_bundle_id, 0, &conn) != 0 &&
+ AMDeviceCreateHouseArrestService(device, cf_bundle_id, command, &conn) != 0) {
on_error(@"Unable to find bundle with id: %@", [NSString stringWithUTF8String:bundle_id]);
}