@@ -21,19 +21,19 @@ use crate::config::Config;
2121use crate :: utils:: args:: ArgExt as _;
2222use crate :: utils:: chunks:: { upload_chunks, Chunk , ASSEMBLE_POLL_INTERVAL } ;
2323use crate :: utils:: fs:: get_sha1_checksums;
24- #[ cfg( target_os = "macos" ) ]
24+ #[ cfg( all ( target_os = "macos" , target_arch = "aarch64" ) ) ]
2525use crate :: utils:: fs:: TempDir ;
2626use crate :: utils:: fs:: TempFile ;
27- #[ cfg( target_os = "macos" ) ]
27+ #[ cfg( all ( target_os = "macos" , target_arch = "aarch64" ) ) ]
2828use crate :: utils:: mobile_app:: { handle_asset_catalogs, ipa_to_xcarchive, is_ipa_file} ;
2929use crate :: utils:: mobile_app:: { is_aab_file, is_apk_file, is_apple_app, is_zip_file} ;
3030use crate :: utils:: progress:: ProgressBar ;
3131use crate :: utils:: vcs;
3232
3333pub fn make_command ( command : Command ) -> Command {
34- #[ cfg( target_os = "macos" ) ]
34+ #[ cfg( all ( target_os = "macos" , target_arch = "aarch64" ) ) ]
3535 const HELP_TEXT : & str = "The path to the mobile app files to upload. Supported files include Apk, Aab, XCArchive, and IPA." ;
36- #[ cfg( not( target_os = "macos" ) ) ]
36+ #[ cfg( not( all ( target_os = "macos" , target_arch = "aarch64" ) ) ) ]
3737 const HELP_TEXT : & str = "The path to the mobile app files to upload. Supported files include Apk, Aab, and XCArchive." ;
3838 command
3939 . about ( "[EXPERIMENTAL] Upload mobile app files to a project." )
@@ -92,7 +92,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
9292 let byteview = ByteView :: open ( path) ?;
9393 debug ! ( "Loaded file with {} bytes" , byteview. len( ) ) ;
9494
95- #[ cfg( target_os = "macos" ) ]
95+ #[ cfg( all ( target_os = "macos" , target_arch = "aarch64" ) ) ]
9696 if is_apple_app ( path) {
9797 handle_asset_catalogs ( path) ;
9898 }
@@ -181,7 +181,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
181181
182182fn handle_file ( path : & Path , byteview : & ByteView ) -> Result < TempFile > {
183183 // Handle IPA files by converting them to XCArchive
184- #[ cfg( target_os = "macos" ) ]
184+ #[ cfg( all ( target_os = "macos" , target_arch = "aarch64" ) ) ]
185185 if is_zip_file ( byteview) && is_ipa_file ( byteview) ? {
186186 debug ! ( "Converting IPA file to XCArchive structure" ) ;
187187 let temp_dir = TempDir :: create ( ) ?;
@@ -208,9 +208,9 @@ fn validate_is_mobile_app(path: &Path, bytes: &[u8]) -> Result<()> {
208208
209209 // Check if the file is a zip file (then AAB, APK, or IPA)
210210 if is_zip_file ( bytes) {
211- #[ cfg( target_os = "macos" ) ]
211+ #[ cfg( all ( target_os = "macos" , target_arch = "aarch64" ) ) ]
212212 debug ! ( "File is a zip, checking for AAB/APK/IPA format" ) ;
213- #[ cfg( not( target_os = "macos" ) ) ]
213+ #[ cfg( not( all ( target_os = "macos" , target_arch = "aarch64" ) ) ) ]
214214 debug ! ( "File is a zip, checking for AAB/APK format" ) ;
215215
216216 if is_aab_file ( bytes) ? {
@@ -223,17 +223,17 @@ fn validate_is_mobile_app(path: &Path, bytes: &[u8]) -> Result<()> {
223223 return Ok ( ( ) ) ;
224224 }
225225
226- #[ cfg( target_os = "macos" ) ]
226+ #[ cfg( all ( target_os = "macos" , target_arch = "aarch64" ) ) ]
227227 if is_ipa_file ( bytes) ? {
228228 debug ! ( "Detected IPA file" ) ;
229229 return Ok ( ( ) ) ;
230230 }
231231 }
232232
233233 debug ! ( "File format validation failed" ) ;
234- #[ cfg( target_os = "macos" ) ]
234+ #[ cfg( all ( target_os = "macos" , target_arch = "aarch64" ) ) ]
235235 let format_list = "APK, AAB, XCArchive, or IPA" ;
236- #[ cfg( not( target_os = "macos" ) ) ]
236+ #[ cfg( not( all ( target_os = "macos" , target_arch = "aarch64" ) ) ) ]
237237 let format_list = "APK, AAB, or XCArchive" ;
238238
239239 Err ( anyhow ! (
0 commit comments