You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cli): resolve IP when dev URL host is unspecified, closes#13356 (#14115)
currently the `use_network_address_for_dev_url` function already detects Ipv4Addr::UNSPECIFIED to resolve the local IP address for mobile development when the dev URL host is 0.0.0.0, but we only call it when `--host` is provided or running on a physical device. This change detects the unspecified host early and force the resolution to run even for simulator builds
Copy file name to clipboardExpand all lines: crates/tauri-cli/src/mobile/ios/dev.rs
+17-2Lines changed: 17 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -32,8 +32,9 @@ use cargo_mobile2::{
32
32
env::Env,
33
33
opts::{NoiseLevel,Profile},
34
34
};
35
+
use url::Host;
35
36
36
-
use std::{env::set_current_dir, path::PathBuf};
37
+
use std::{env::set_current_dir,net::Ipv4Addr,path::PathBuf};
37
38
38
39
constPHYSICAL_IPHONE_DEV_WARNING:&str = "To develop on physical phones you need the `--host` option (not required for Simulators). See the documentation for more information: https://v2.tauri.app/develop/#development-server";
39
40
@@ -271,12 +272,26 @@ fn run_dev(
271
272
config:&AppleConfig,
272
273
noise_level:NoiseLevel,
273
274
) -> Result<()>{
274
-
// when running on an actual device we must use the network IP
275
+
// when --host is provided or running on a physical device or resolving 0.0.0.0 we must use the network IP
0 commit comments