Skip to content

Commit 89c509b

Browse files
Fix Large Incremental Installs (#470)
Fix timeouts that happen with large Incremental installs
1 parent 3b4f011 commit 89c509b

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/ios-deploy/ios-deploy.m

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,12 +1994,11 @@ void handle_device(AMDeviceRef device) {
19941994
NSLogOut(@"------ Install phase ------");
19951995
NSLogOut(@"[ 0%%] Found %@ connected through %@, beginning install", device_full_name, device_interface_name);
19961996

1997-
connect_and_start_session(device);
1998-
19991997
CFDictionaryRef options;
20001998
if (app_deltas == NULL) { // standard install
20011999
// NOTE: the secure version doesn't seem to require us to start the AFC service
20022000
ServiceConnRef afcFd;
2001+
connect_and_start_session(device);
20032002
check_error(AMDeviceSecureStartService(device, CFSTR("com.apple.afc"), NULL, &afcFd));
20042003
check_error(AMDeviceStopSession(device));
20052004
check_error(AMDeviceDisconnect(device));
@@ -2012,10 +2011,9 @@ void handle_device(AMDeviceRef device) {
20122011

20132012
connect_and_start_session(device);
20142013
check_error(AMDeviceSecureInstallApplication(0, device, url, options, install_callback, 0));
2015-
} else { // incremental install
20162014
check_error(AMDeviceStopSession(device));
20172015
check_error(AMDeviceDisconnect(device));
2018-
2016+
} else { // incremental install
20192017
CFStringRef extracted_bundle_id = NULL;
20202018
CFStringRef extracted_bundle_id_ref = copy_bundle_id(url);
20212019
if (bundle_id != NULL) {
@@ -2058,7 +2056,7 @@ void handle_device(AMDeviceRef device) {
20582056
CFIndex size = sizeof(keys)/sizeof(CFStringRef);
20592057
options = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, size, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
20602058

2061-
connect_and_start_session(device);
2059+
// Incremental installs should be done without a session started because of timeouts.
20622060
check_error(AMDeviceSecureInstallApplicationBundle(device, url, options, incremental_install_callback, 0));
20632061
CFRelease(extracted_bundle_id);
20642062
CFRelease(deltas_path);
@@ -2068,9 +2066,6 @@ void handle_device(AMDeviceRef device) {
20682066
app_deltas = NULL;
20692067
}
20702068

2071-
check_error(AMDeviceStopSession(device));
2072-
check_error(AMDeviceDisconnect(device));
2073-
20742069
CFRelease(options);
20752070

20762071
NSLogOut(@"[100%%] Installed package %@", [NSString stringWithUTF8String:app_path]);

0 commit comments

Comments
 (0)