Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/tauri-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ name = "cargo-tauri"
path = "src/main.rs"

[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\", target_os = \"windows\", target_os = \"macos\"))".dependencies]
cargo-mobile2 = { version = "0.22.3", default-features = false }
cargo-mobile2 = { version = "0.22.4", default-features = false }

[dependencies]
jsonrpsee = { version = "0.24", features = ["server"] }
Expand Down
7 changes: 7 additions & 0 deletions crates/tauri-cli/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3919,6 +3919,13 @@
"description": "Whether to automatically increment the `versionCode` on each build.\n\n - If `true`, the generator will try to read the last `versionCode` from\n `tauri.properties` and increment it by 1 for every build.\n - If `false` or not set, it falls back to `version_code` or semver-derived logic.\n\n Note that to use this feature, you should remove `/tauri.properties` from `src-tauri/gen/android/app/.gitignore` so the current versionCode is committed to the repository.",
"default": false,
"type": "boolean"
},
"debugApplicationIdSuffix": {
"description": "Application ID suffix to append for debug builds.\n This allows installing debug and release versions side-by-side on the same device.\n Example: \".debug\" will make debug builds use \"com.example.app.debug\" as the application ID.",
"type": [
"string",
"null"
]
}
},
"additionalProperties": false
Expand Down
7 changes: 7 additions & 0 deletions crates/tauri-cli/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3095,6 +3095,13 @@
"format": "uint32",
"maximum": 2100000000.0,
"minimum": 1.0
},
"debugApplicationIdSuffix": {
"description": "Application ID suffix to append for debug builds.\n This allows installing debug and release versions side-by-side on the same device.\n Example: \".debug\" will make debug builds use \"com.example.app.debug\" as the application ID.",
"type": [
"string",
"null"
]
}
},
"additionalProperties": false
Expand Down
3 changes: 2 additions & 1 deletion crates/tauri-cli/src/mobile/android/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use super::{
configure_cargo, delete_codegen_vars, ensure_init, env, get_app, get_config, inject_resources,
log_finished, open_and_wait, MobileTarget, OptionsHandle,
log_finished, open_and_wait, sync_debug_application_id_suffix, MobileTarget, OptionsHandle,
};
use crate::{
build::Options as BuildOptions,
Expand Down Expand Up @@ -192,6 +192,7 @@ pub fn run(
configure_cargo(&mut env, &config)?;

generate_tauri_properties(&config, tauri_config, false)?;
sync_debug_application_id_suffix(&config, tauri_config)?;

crate::build::setup(&interface, &mut build_options, tauri_config, dirs, true)?;

Expand Down
29 changes: 25 additions & 4 deletions crates/tauri-cli/src/mobile/android/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use super::{
configure_cargo, delete_codegen_vars, device_prompt, ensure_init, env, get_app, get_config,
inject_resources, open_and_wait, MobileTarget,
inject_resources, open_and_wait, sync_debug_application_id_suffix, MobileTarget,
};
use crate::{
dev::Options as DevOptions,
Expand Down Expand Up @@ -274,6 +274,7 @@ fn run_dev(
configure_cargo(&mut env, config)?;

generate_tauri_properties(config, &tauri_config, true)?;
sync_debug_application_id_suffix(config, &tauri_config)?;

let installed_targets =
crate::interface::rust::installation::installed_targets().unwrap_or_default();
Expand Down Expand Up @@ -339,7 +340,15 @@ fn run_dev(
if open {
open_and_wait(config, &env)
} else if let Some(device) = &device {
match run(device, options, config, &env, metadata, noise_level) {
match run(
device,
options,
config,
&env,
metadata,
noise_level,
tauri_config,
) {
Ok(c) => Ok(Box::new(c) as Box<dyn DevProcess + Send>),
Err(e) => {
crate::dev::kill_before_dev_process();
Expand All @@ -361,6 +370,7 @@ fn run(
env: &Env,
metadata: &AndroidMetadata,
noise_level: NoiseLevel,
tauri_config: &tauri_utils::config::Config,
) -> crate::Result<DevChild> {
let profile = if options.debug {
Profile::Debug
Expand All @@ -370,8 +380,18 @@ fn run(

let build_app_bundle = metadata.asset_packs().is_some();

let application_id_suffix = if profile == Profile::Debug {
tauri_config
.bundle
.android
.debug_application_id_suffix
.clone()
} else {
None
};

device
.run(
.run_with_application_id_suffix(
config,
env,
noise_level,
Expand All @@ -383,7 +403,8 @@ fn run(
}),
build_app_bundle,
false,
".MainActivity".into(),
format!("{}.MainActivity", config.app().identifier()),
application_id_suffix,
)
.map(DevChild::new)
.context("failed to run Android app")
Expand Down
Loading
Loading