Allow to connect to the dev server from a physical Android device (#3634)
* fix(android): now dev server just works on devices * fix: allow custom port for Android app development * refactor: simplified URL creation in LaunchBuilder
This commit is contained in:
1 parent
d7e64d5d24
commit
67515ce812
4 files changed
+55
-14
No files matched your search
@@ -162,14 +162,8 @@ impl LaunchBuilder {
|
||||
{
|
||||
use dioxus_fullstack::prelude::server_fn::client::{get_server_url, set_server_url};
|
||||
if get_server_url().is_empty() {
|
||||
let ip = if cfg!(target_os = "android") {
|
||||
"10.0.2.2"
|
||||
} else {
|
||||
"127.0.0.1"
|
||||
};
|
||||
|
||||
let serverurl = format!(
|
||||
"http://{ip}:{}",
|
||||
"http://127.0.0.1:{}",
|
||||
std::env::var("PORT").unwrap_or_else(|_| "8080".to_string())
|
||||
)
|
||||
.leak();
|
||||
|
||||
Reference in new issue
Block a user