()
| 3590 | } |
| 3591 | |
| 3592 | fn main() -> anyhow::Result<()> { |
| 3593 | logging::init(); |
| 3594 | if let Some(action) = no_command_action_from_args() { |
| 3595 | return run_no_command_action(action); |
| 3596 | } |
| 3597 | |
| 3598 | let cli = Cli::parse(); |
| 3599 | let _default_service_flags = (cli.port, cli.autostart, cli.open); |
| 3600 | let explicit_server_url = cli.server_url.clone(); |
| 3601 | let device_selector = cli.device.clone(); |
| 3602 | let service_url = explicit_server_url |
| 3603 | .clone() |
| 3604 | .or_else(|| env::var("SIMDECK_SERVER_URL").ok()) |
| 3605 | .filter(|value| !value.trim().is_empty()); |
| 3606 | let bridge = NativeBridge; |
| 3607 | let resolve_device_udid = |udid: Option<&str>| -> anyhow::Result<String> { |
| 3608 | resolve_cli_device_udid( |
| 3609 | udid, |
| 3610 | device_selector.as_deref(), |
| 3611 | explicit_server_url.as_deref(), |
| 3612 | ) |
| 3613 | }; |
| 3614 | |
| 3615 | match cli.command { |
| 3616 | Command::Kill | Command::Killall => kill_all_services(), |
| 3617 | Command::Pair { |
| 3618 | port, |
| 3619 | bind, |
| 3620 | advertise_host, |
| 3621 | client_root, |
| 3622 | video_codec, |
| 3623 | android_gpu, |
| 3624 | low_latency, |
| 3625 | stream_quality, |
| 3626 | local_stream_fps, |
| 3627 | json, |
| 3628 | } => pair_global_service(PairGlobalServiceOptions { |
| 3629 | port, |
| 3630 | bind, |
| 3631 | advertise_host, |
| 3632 | client_root, |
| 3633 | video_codec, |
| 3634 | android_gpu, |
| 3635 | low_latency, |
| 3636 | stream_quality, |
| 3637 | local_stream_fps, |
| 3638 | json, |
| 3639 | }), |
| 3640 | Command::Studio { command } => match command { |
| 3641 | StudioCommand::Expose { |
| 3642 | simulator, |
| 3643 | studio_url, |
| 3644 | port, |
| 3645 | bind, |
| 3646 | low_latency, |
| 3647 | video_codec, |
| 3648 | stream_quality, |
| 3649 | } => expose_to_studio(StudioExposeOptions { |
nothing calls this directly
no test coverage detected