@@ -1994,12 +1994,11 @@ void handle_device(AMDeviceRef device) {
1994
1994
NSLogOut (@" ------ Install phase ------" );
1995
1995
NSLogOut (@" [ 0%% ] Found %@ connected through %@ , beginning install" , device_full_name, device_interface_name);
1996
1996
1997
- connect_and_start_session (device);
1998
-
1999
1997
CFDictionaryRef options;
2000
1998
if (app_deltas == NULL ) { // standard install
2001
1999
// NOTE: the secure version doesn't seem to require us to start the AFC service
2002
2000
ServiceConnRef afcFd;
2001
+ connect_and_start_session (device);
2003
2002
check_error (AMDeviceSecureStartService (device, CFSTR (" com.apple.afc" ), NULL , &afcFd));
2004
2003
check_error (AMDeviceStopSession (device));
2005
2004
check_error (AMDeviceDisconnect (device));
@@ -2012,10 +2011,9 @@ void handle_device(AMDeviceRef device) {
2012
2011
2013
2012
connect_and_start_session (device);
2014
2013
check_error (AMDeviceSecureInstallApplication (0 , device, url, options, install_callback, 0 ));
2015
- } else { // incremental install
2016
2014
check_error (AMDeviceStopSession (device));
2017
2015
check_error (AMDeviceDisconnect (device));
2018
-
2016
+ } else { // incremental install
2019
2017
CFStringRef extracted_bundle_id = NULL ;
2020
2018
CFStringRef extracted_bundle_id_ref = copy_bundle_id (url);
2021
2019
if (bundle_id != NULL ) {
@@ -2058,7 +2056,7 @@ void handle_device(AMDeviceRef device) {
2058
2056
CFIndex size = sizeof (keys)/sizeof (CFStringRef);
2059
2057
options = CFDictionaryCreate (NULL , (const void **)&keys, (const void **)&values, size, &kCFTypeDictionaryKeyCallBacks , &kCFTypeDictionaryValueCallBacks );
2060
2058
2061
- connect_and_start_session (device);
2059
+ // Incremental installs should be done without a session started because of timeouts.
2062
2060
check_error (AMDeviceSecureInstallApplicationBundle (device, url, options, incremental_install_callback, 0 ));
2063
2061
CFRelease (extracted_bundle_id);
2064
2062
CFRelease (deltas_path);
@@ -2068,9 +2066,6 @@ void handle_device(AMDeviceRef device) {
2068
2066
app_deltas = NULL ;
2069
2067
}
2070
2068
2071
- check_error (AMDeviceStopSession (device));
2072
- check_error (AMDeviceDisconnect (device));
2073
-
2074
2069
CFRelease (options);
2075
2070
2076
2071
NSLogOut (@" [100%% ] Installed package %@ " , [NSString stringWithUTF8String: app_path]);
0 commit comments