(udid: &str, bundle_id: &str)
| 435 | } |
| 436 | |
| 437 | fn record_injected_bundle(udid: &str, bundle_id: &str) -> Result<(), AppError> { |
| 438 | let mut bundle_ids = read_injected_bundles(udid); |
| 439 | if !bundle_ids.iter().any(|current| current == bundle_id) { |
| 440 | bundle_ids.push(bundle_id.to_owned()); |
| 441 | } |
| 442 | let payload = json!({ |
| 443 | "daemonPid": std::process::id(), |
| 444 | "bundleIds": bundle_ids, |
| 445 | }); |
| 446 | fs::write( |
| 447 | injected_bundles_file(udid), |
| 448 | serde_json::to_vec(&payload).map_err(app_internal)?, |
| 449 | ) |
| 450 | .map_err(app_internal) |
| 451 | } |
| 452 | |
| 453 | fn read_injected_bundles(udid: &str) -> Vec<String> { |
| 454 | let path = injected_bundles_file(udid); |
no test coverage detected