@@ -19,6 +19,13 @@ export class ITMSTransporterService implements IITMSTransporterService {
19
19
return this . $injector . resolve ( "projectData" ) ;
20
20
}
21
21
22
+ public async validate ( ) : Promise < void > {
23
+ const itmsTransporterPath = await this . getITMSTransporterPath ( ) ;
24
+ if ( ! this . $fs . exists ( itmsTransporterPath ) ) {
25
+ this . $errors . fail ( 'iTMS Transporter not found on this machine - make sure your Xcode installation is not damaged.' ) ;
26
+ }
27
+ }
28
+
22
29
public async upload ( data : IITMSData ) : Promise < void > {
23
30
temp . track ( ) ;
24
31
const itmsTransporterPath = await this . getITMSTransporterPath ( ) ;
@@ -96,11 +103,12 @@ export class ITMSTransporterService implements IITMSTransporterService {
96
103
@cache ( )
97
104
private async getITMSTransporterPath ( ) : Promise < string > {
98
105
const xcodePath = await this . $xcodeSelectService . getContentsDirectoryPath ( ) ;
99
- const loaderAppContentsPath = path . join ( xcodePath , "Applications" , "Application Loader.app" , "Contents" ) ;
100
- const itmsTransporterPath = path . join ( loaderAppContentsPath , ITMSConstants . iTMSDirectoryName , "bin" , ITMSConstants . iTMSExecutableName ) ;
106
+ let itmsTransporterPath = path . join ( xcodePath , ".." , "Contents" , "SharedFrameworks" , "ContentDeliveryServices.framework" , "Versions" , "A" , "itms" , "bin" , ITMSConstants . iTMSExecutableName ) ;
101
107
102
- if ( ! this . $fs . exists ( itmsTransporterPath ) ) {
103
- this . $errors . fail ( 'iTMS Transporter not found on this machine - make sure your Xcode installation is not damaged.' ) ;
108
+ const xcodeVersionData = await this . $xcodeSelectService . getXcodeVersion ( ) ;
109
+ if ( + xcodeVersionData . major < 11 ) {
110
+ const loaderAppContentsPath = path . join ( xcodePath , "Applications" , "Application Loader.app" , "Contents" ) ;
111
+ itmsTransporterPath = path . join ( loaderAppContentsPath , ITMSConstants . iTMSDirectoryName , "bin" , ITMSConstants . iTMSExecutableName ) ;
104
112
}
105
113
106
114
return itmsTransporterPath ;
0 commit comments