@@ -330,22 +330,39 @@ fn run_build(
330330 export_config = export_config. authentication_credentials ( credentials) ;
331331 }
332332
333- target . export ( config , env , noise_level , export_config ) ? ;
333+ let out_dir = config . export_dir ( ) . join ( target . arch ) ;
334334
335- if let Ok ( ipa_path) = config. ipa_path ( ) {
336- let out_dir = config. export_dir ( ) . join ( target. arch ) ;
335+ if target. sdk == "iphonesimulator" {
337336 fs:: create_dir_all ( & out_dir) ?;
338- let path = out_dir. join ( ipa_path. file_name ( ) . unwrap ( ) ) ;
339- fs:: rename ( & ipa_path, & path) ?;
337+
338+ let app_path = config
339+ . archive_dir ( )
340+ . join ( format ! ( "{}.xcarchive" , config. scheme( ) ) )
341+ . join ( "Products" )
342+ . join ( "Applications" )
343+ . join ( config. app ( ) . stylized_name ( ) )
344+ . with_extension ( "app" ) ;
345+
346+ let path = out_dir. join ( app_path. file_name ( ) . unwrap ( ) ) ;
347+ fs:: rename ( & app_path, & path) ?;
340348 out_files. push ( path) ;
349+ } else {
350+ target. export ( config, env, noise_level, export_config) ?;
351+
352+ if let Ok ( ipa_path) = config. ipa_path ( ) {
353+ fs:: create_dir_all ( & out_dir) ?;
354+ let path = out_dir. join ( ipa_path. file_name ( ) . unwrap ( ) ) ;
355+ fs:: rename ( & ipa_path, & path) ?;
356+ out_files. push ( path) ;
357+ }
341358 }
342359
343360 Ok ( ( ) )
344361 } ,
345362 )
346363 . map_err ( |e : TargetInvalid | anyhow:: anyhow!( e. to_string( ) ) ) ??;
347364
348- log_finished ( out_files, "IPA " ) ;
365+ log_finished ( out_files, "iOS Bundle " ) ;
349366
350367 Ok ( handle)
351368}
0 commit comments