Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Large Incremental Installs #470

Merged
merged 2 commits into from
Aug 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/ios-deploy/ios-deploy.m
Original file line number Diff line number Diff line change
Expand Up @@ -1994,12 +1994,11 @@ void handle_device(AMDeviceRef device) {
NSLogOut(@"------ Install phase ------");
NSLogOut(@"[ 0%%] Found %@ connected through %@, beginning install", device_full_name, device_interface_name);

connect_and_start_session(device);

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

connect_and_start_session(device);
check_error(AMDeviceSecureInstallApplication(0, device, url, options, install_callback, 0));
} else { // incremental install
check_error(AMDeviceStopSession(device));
check_error(AMDeviceDisconnect(device));

} else { // incremental install
CFStringRef extracted_bundle_id = NULL;
CFStringRef extracted_bundle_id_ref = copy_bundle_id(url);
if (bundle_id != NULL) {
Expand Down Expand Up @@ -2058,7 +2056,8 @@ void handle_device(AMDeviceRef device) {
CFIndex size = sizeof(keys)/sizeof(CFStringRef);
options = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, size, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);

connect_and_start_session(device);
// Incremental installs do not seem to need a session to be started with AMDeviceStartSession() and can instead
ivanhernandez13 marked this conversation as resolved.
Show resolved Hide resolved
// cause kAMDSendMessageError when the install takes too long and the session times out.
check_error(AMDeviceSecureInstallApplicationBundle(device, url, options, incremental_install_callback, 0));
CFRelease(extracted_bundle_id);
CFRelease(deltas_path);
Expand All @@ -2068,9 +2067,6 @@ void handle_device(AMDeviceRef device) {
app_deltas = NULL;
}

check_error(AMDeviceStopSession(device));
check_error(AMDeviceDisconnect(device));

CFRelease(options);

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