Skip to content

Commit da3538d

Browse files
committed
Log idevice logs to minimuxer log
1 parent 38584fa commit da3538d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/mounter.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ pub fn start_auto_mounter(docs_path: String) {
306306
}
307307
}
308308

309+
info!("Files downloaded, getting device from muxer");
310+
309311
let mut uc = UsbmuxdConnection::new(
310312
Box::new(
311313
match tokio::net::TcpStream::connect("127.0.0.1:27015").await {
@@ -317,6 +319,7 @@ pub fn start_auto_mounter(docs_path: String) {
317319
),
318320
0,
319321
);
322+
320323
let dev = match uc
321324
.get_devices()
322325
.await
@@ -331,11 +334,14 @@ pub fn start_auto_mounter(docs_path: String) {
331334
}
332335
};
333336

337+
info!("Creating provider from usbmuxd device");
334338
let provider = TcpProvider {
335339
addr: std::net::IpAddr::V4(Ipv4Addr::from_str("10.7.0.1").unwrap()),
336340
pairing_file: dev.get_pairing_file().await.unwrap(),
337341
label: "minimuxer".to_string(),
338342
};
343+
344+
info!("Connecting to lockdown for UCID");
339345
let mut lockdown_client = match LockdownClient::connect(&provider)
340346
.await {
341347
Ok(l) => l,
@@ -344,6 +350,8 @@ pub fn start_auto_mounter(docs_path: String) {
344350
return Err(Errors::CreateLockdown);
345351
}
346352
};
353+
354+
info!("Fetching UCID");
347355
let unique_chip_id = match match lockdown_client.get_value("UniqueChipID").await {
348356
Ok(u) => u,
349357
Err(_) => {
@@ -372,11 +380,12 @@ pub fn start_auto_mounter(docs_path: String) {
372380
}
373381
};
374382

375-
383+
info!("Connecting to image mounter");
376384
let mut mounter_client = ImageMounter::connect(&provider)
377385
.await
378386
.expect("Unable to connect to image mounter");
379387

388+
info!("Copying devices from image mounter");
380389
let images = match mounter_client
381390
.copy_devices()
382391
.await {
@@ -388,10 +397,11 @@ pub fn start_auto_mounter(docs_path: String) {
388397
};
389398

390399
if !images.is_empty() {
391-
// done
400+
info!("Already mounted");
392401
return Ok(())
393402
}
394403

404+
info!("Reading DDI files to memory");
395405
let image_dmg = match tokio::fs::read(dir.join("Image.dmg")).await {
396406
Ok(i) => i,
397407
Err(e) => {
@@ -414,6 +424,7 @@ pub fn start_auto_mounter(docs_path: String) {
414424
}
415425
};
416426

427+
info!("Mounting DDI...");
417428
if let Err(e) = mounter_client
418429
.mount_personalized_with_callback(
419430
&provider,

src/muxer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ pub fn startWithLogger(
318318
.level(LevelFilter::Off)
319319
.level_for("minimuxer", LevelFilter::Info)
320320
.level_for("rusty_libimobiledevice", LevelFilter::Error)
321+
.level_for("idevice", LevelFilter::Debug)
321322
.chain(File::create(&log_path).unwrap()),
322323
);
323324

0 commit comments

Comments
 (0)