Skip to content

Commit b426835

Browse files
authored
fix(cli): iOS build targetting the simulator (#10847)
1 parent 79de433 commit b426835

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-cli": patch:bug
3+
"@tauri-apps/cli": patch:bug
4+
---
5+
6+
Fixes `ios build --target [aarch64-sim | x86_64]` failing to generate the app bundle for the iOS simulator.

crates/tauri-cli/src/mobile/ios/build.rs

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)