@@ -19,6 +19,13 @@ export class ITMSTransporterService implements IITMSTransporterService {
1919 return this . $injector . resolve ( "projectData" ) ;
2020 }
2121
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+
2229 public async upload ( data : IITMSData ) : Promise < void > {
2330 temp . track ( ) ;
2431 const itmsTransporterPath = await this . getITMSTransporterPath ( ) ;
@@ -96,11 +103,12 @@ export class ITMSTransporterService implements IITMSTransporterService {
96103 @cache ( )
97104 private async getITMSTransporterPath ( ) : Promise < string > {
98105 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 ) ;
101107
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 ) ;
104112 }
105113
106114 return itmsTransporterPath ;
0 commit comments