MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / plist_contents

Function plist_contents

packages/server/src/service.rs:601–690  ·  view source on GitHub ↗
(
    executable: &Path,
    client_root: &Path,
    stdout_log: &Path,
    stderr_log: &Path,
    options: &ServiceOptions,
)

Source from the content-addressed store, hash-verified

599}
600
601fn plist_contents(
602 executable: &Path,
603 client_root: &Path,
604 stdout_log: &Path,
605 stderr_log: &Path,
606 options: &ServiceOptions,
607) -> String {
608 let mut program_arguments = vec![
609 executable.to_string_lossy().into_owned(),
610 "service".to_string(),
611 "run".to_string(),
612 "--port".to_string(),
613 options.port.to_string(),
614 "--bind".to_string(),
615 options.bind.to_string(),
616 "--client-root".to_string(),
617 client_root.to_string_lossy().into_owned(),
618 "--video-codec".to_string(),
619 options.video_codec.as_env_value().to_string(),
620 "--android-gpu".to_string(),
621 options.android_gpu.as_emulator_value().to_string(),
622 "--server-kind".to_string(),
623 "launch-agent".to_string(),
624 ];
625 if options.low_latency {
626 program_arguments.push("--low-latency".to_string());
627 }
628 if let Some(stream_quality_profile) = options.stream_quality_profile.as_ref() {
629 program_arguments.push("--stream-quality".to_string());
630 program_arguments.push(stream_quality_profile.clone());
631 }
632 if let Some(local_stream_fps) = options.local_stream_fps {
633 program_arguments.push("--local-stream-fps".to_string());
634 program_arguments.push(local_stream_fps.to_string());
635 }
636
637 if let Some(advertise_host) = options.advertise_host.as_ref() {
638 program_arguments.push("--advertise-host".to_string());
639 program_arguments.push(advertise_host.clone());
640 }
641 if let Some(access_token) = options.access_token.as_ref() {
642 program_arguments.push("--access-token".to_string());
643 program_arguments.push(access_token.clone());
644 }
645 if let Some(pairing_code) = options.pairing_code.as_ref() {
646 program_arguments.push("--pairing-code".to_string());
647 program_arguments.push(pairing_code.clone());
648 }
649
650 let program_arguments_xml = program_arguments
651 .into_iter()
652 .map(|argument| format!(" <string>{}</string>", xml_escape(&argument)))
653 .collect::<Vec<_>>()
654 .join("\n");
655 let environment_xml = launch_agent_environment_xml();
656 let environment_section = if environment_xml.is_empty() {
657 String::new()
658 } else {

Callers 1

installFunction · 0.85

Calls 3

is_emptyMethod · 0.80
cloneMethod · 0.65

Tested by

no test coverage detected