(&mut self)
| 462 | } |
| 463 | |
| 464 | fn start_android_emulator(&mut self) -> Result<(), Box<dyn std::error::Error>> { |
| 465 | self.update_progress(0, 5, "Building for Android..."); |
| 466 | |
| 467 | // Run Android build script |
| 468 | let status = Command::new("sh") |
| 469 | .args(["scripts/build-android.sh", "todo_app"]) |
| 470 | .status()?; |
| 471 | |
| 472 | if !status.success() { |
| 473 | return Err("Android build failed".into()); |
| 474 | } |
| 475 | |
| 476 | self.update_progress(2, 5, "Starting Android emulator..."); |
| 477 | |
| 478 | let config = self.load_project_config()?; |
| 479 | let avd_name = config.android_config.avd_name |
| 480 | .unwrap_or_else(|| "Pixel_4".to_string()); |
| 481 | |
| 482 | // Start emulator |
| 483 | let emulator = Command::new("emulator") |
| 484 | .args(["-avd", &avd_name]) |
| 485 | .spawn()?; |
| 486 | |
| 487 | let mut window = SimulatorWindow::new(Platform::Android); |
| 488 | window.set_process(emulator); |
| 489 | self.simulator_windows.push(window); |
| 490 | |
| 491 | self.update_progress(5, 5, "Android emulator ready!"); |
| 492 | Ok(()) |
| 493 | } |
| 494 | |
| 495 | fn start_web_server(&mut self) -> Result<(), Box<dyn std::error::Error>> { |
| 496 | self.update_progress(0, 5, "Building for web..."); |
no test coverage detected