| 554 | } |
| 555 | |
| 556 | fn open_default_browser(&self, port: u16) -> Result<(), Box<dyn std::error::Error>> { |
| 557 | let url = format!("http://localhost:{}", port); |
| 558 | |
| 559 | #[cfg(target_os = "macos")] |
| 560 | Command::new("open").arg(&url).spawn()?; |
| 561 | #[cfg(target_os = "linux")] |
| 562 | Command::new("xdg-open").arg(&url).spawn()?; |
| 563 | #[cfg(target_os = "windows")] |
| 564 | Command::new("cmd").args(["/C", "start", &url]).spawn()?; |
| 565 | |
| 566 | Ok(()) |
| 567 | } |
| 568 | |
| 569 | fn cleanup_platform(&mut self, platform: Platform) { |
| 570 | self.simulator_windows.retain_mut(|window| { |