Skip to main content

compose_child_env

Function compose_child_env 

Source
pub fn compose_child_env(pairs: &[(&str, &str)]) -> Vec<(String, String)>
Expand description

v6.8 c2 — compose user-provided (key, value) pairs into the SIMCTL_CHILD_* envp that xcrun simctl launch strips and delivers to the launched app. Idempotent: a key that already starts with SIMCTL_CHILD_ is passed through unchanged. Insight gol-611 §4 reference: their prelaunch-sim-app.ts does the same composition.

§Example

use smix_simctl::compose_child_env;
let composed = compose_child_env(&[("INSIGHT_PERF_RECEIVER_URL", "http://h:9999")]);
assert_eq!(
    composed,
    vec![(
        "SIMCTL_CHILD_INSIGHT_PERF_RECEIVER_URL".to_string(),
        "http://h:9999".to_string(),
    )]
);