@@ -21,19 +21,19 @@ use crate::config::Config;
21
21
use crate :: utils:: args:: ArgExt as _;
22
22
use crate :: utils:: chunks:: { upload_chunks, Chunk , ASSEMBLE_POLL_INTERVAL } ;
23
23
use crate :: utils:: fs:: get_sha1_checksums;
24
- #[ cfg( target_os = "macos" ) ]
24
+ #[ cfg( all ( target_os = "macos" , target_arch = "aarch64" ) ) ]
25
25
use crate :: utils:: fs:: TempDir ;
26
26
use crate :: utils:: fs:: TempFile ;
27
- #[ cfg( target_os = "macos" ) ]
27
+ #[ cfg( all ( target_os = "macos" , target_arch = "aarch64" ) ) ]
28
28
use crate :: utils:: mobile_app:: { handle_asset_catalogs, ipa_to_xcarchive, is_ipa_file} ;
29
29
use crate :: utils:: mobile_app:: { is_aab_file, is_apk_file, is_apple_app, is_zip_file} ;
30
30
use crate :: utils:: progress:: ProgressBar ;
31
31
use crate :: utils:: vcs;
32
32
33
33
pub fn make_command ( command : Command ) -> Command {
34
- #[ cfg( target_os = "macos" ) ]
34
+ #[ cfg( all ( target_os = "macos" , target_arch = "aarch64" ) ) ]
35
35
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" ) ) ) ]
37
37
const HELP_TEXT : & str = "The path to the mobile app files to upload. Supported files include Apk, Aab, and XCArchive." ;
38
38
command
39
39
. about ( "[EXPERIMENTAL] Upload mobile app files to a project." )
@@ -92,7 +92,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
92
92
let byteview = ByteView :: open ( path) ?;
93
93
debug ! ( "Loaded file with {} bytes" , byteview. len( ) ) ;
94
94
95
- #[ cfg( target_os = "macos" ) ]
95
+ #[ cfg( all ( target_os = "macos" , target_arch = "aarch64" ) ) ]
96
96
if is_apple_app ( path) {
97
97
handle_asset_catalogs ( path) ;
98
98
}
@@ -181,7 +181,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
181
181
182
182
fn handle_file ( path : & Path , byteview : & ByteView ) -> Result < TempFile > {
183
183
// Handle IPA files by converting them to XCArchive
184
- #[ cfg( target_os = "macos" ) ]
184
+ #[ cfg( all ( target_os = "macos" , target_arch = "aarch64" ) ) ]
185
185
if is_zip_file ( byteview) && is_ipa_file ( byteview) ? {
186
186
debug ! ( "Converting IPA file to XCArchive structure" ) ;
187
187
let temp_dir = TempDir :: create ( ) ?;
@@ -208,9 +208,9 @@ fn validate_is_mobile_app(path: &Path, bytes: &[u8]) -> Result<()> {
208
208
209
209
// Check if the file is a zip file (then AAB, APK, or IPA)
210
210
if is_zip_file ( bytes) {
211
- #[ cfg( target_os = "macos" ) ]
211
+ #[ cfg( all ( target_os = "macos" , target_arch = "aarch64" ) ) ]
212
212
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" ) ) ) ]
214
214
debug ! ( "File is a zip, checking for AAB/APK format" ) ;
215
215
216
216
if is_aab_file ( bytes) ? {
@@ -223,17 +223,17 @@ fn validate_is_mobile_app(path: &Path, bytes: &[u8]) -> Result<()> {
223
223
return Ok ( ( ) ) ;
224
224
}
225
225
226
- #[ cfg( target_os = "macos" ) ]
226
+ #[ cfg( all ( target_os = "macos" , target_arch = "aarch64" ) ) ]
227
227
if is_ipa_file ( bytes) ? {
228
228
debug ! ( "Detected IPA file" ) ;
229
229
return Ok ( ( ) ) ;
230
230
}
231
231
}
232
232
233
233
debug ! ( "File format validation failed" ) ;
234
- #[ cfg( target_os = "macos" ) ]
234
+ #[ cfg( all ( target_os = "macos" , target_arch = "aarch64" ) ) ]
235
235
let format_list = "APK, AAB, XCArchive, or IPA" ;
236
- #[ cfg( not( target_os = "macos" ) ) ]
236
+ #[ cfg( not( all ( target_os = "macos" , target_arch = "aarch64" ) ) ) ]
237
237
let format_list = "APK, AAB, or XCArchive" ;
238
238
239
239
Err ( anyhow ! (
0 commit comments