Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

better error message on pymobiledevice3 failure #218

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions dinghy-lib/src/apple/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ impl IosDevice {
.args("apps list --no-color --udid".split_whitespace())
.arg(&self.id)
.output()?;
let app_list = json::parse(std::str::from_utf8(&app_list.stdout)?)?;
let app_list = json::parse(std::str::from_utf8(&app_list.stdout)?).with_context(|| {
format!(
"Ran `pymobiledevice3 app list --no-color --udid {}`, could not parse expected JSON output.", self.id,
)
})?;
let app = app_list
.entries()
.find(|e| e.0.ends_with("Dinghy"))
Expand Down Expand Up @@ -187,7 +191,10 @@ impl IosDevice {
debug!("iOS debugserver started: {connection_details}");

if self.is_locked()? {
eprint!("{}", format!("\n\n Please unlock {}! ", &self.name).bright_yellow());
eprint!(
"{}",
format!("\n\n Please unlock {}! ", &self.name).bright_yellow()
);
loop {
std::thread::sleep(Duration::from_millis(300));
if !self.is_locked()? {
Expand Down