summaryrefslogtreecommitdiffstats
path: root/tools/idevicescreenshot.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2022-02-04 02:15:56 +0100
committerGravatar Nikias Bassen2022-02-04 02:15:56 +0100
commita64fcc3988f75cb4fc2388013c245e5e884bb96f (patch)
tree1b122ace4e0c658fbb80a2980a86eabc1114e0d2 /tools/idevicescreenshot.c
parentac89a1fed5ad916c81bca1515b10934e3e01b057 (diff)
downloadlibimobiledevice-a64fcc3988f75cb4fc2388013c245e5e884bb96f.tar.gz
libimobiledevice-a64fcc3988f75cb4fc2388013c245e5e884bb96f.tar.bz2
tools: Print meaningful error messages when service startup fails
Diffstat (limited to 'tools/idevicescreenshot.c')
-rw-r--r--tools/idevicescreenshot.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/idevicescreenshot.c b/tools/idevicescreenshot.c
index 62bb4a3..9b1ffa3 100644
--- a/tools/idevicescreenshot.c
+++ b/tools/idevicescreenshot.c
@@ -110,9 +110,9 @@ int main(int argc, char **argv)
return -1;
}
- lockdownd_start_service(lckd, "com.apple.mobile.screenshotr", &service);
+ lockdownd_error_t lerr = lockdownd_start_service(lckd, SCREENSHOTR_SERVICE_NAME, &service);
lockdownd_client_free(lckd);
- if (service && service->port > 0) {
+ if (lerr == LOCKDOWN_E_SUCCESS) {
if (screenshotr_client_new(device, service, &shotr) != SCREENSHOTR_E_SUCCESS) {
printf("Could not connect to screenshotr!\n");
} else {
@@ -142,7 +142,7 @@ int main(int argc, char **argv)
screenshotr_client_free(shotr);
}
} else {
- printf("Could not start screenshotr service! Remember that you have to mount the Developer disk image on your device if you want to use the screenshotr service.\n");
+ printf("Could not start screenshotr service: %s\nRemember that you have to mount the Developer disk image on your device if you want to use the screenshotr service.\n", lockdownd_strerror(lerr));
}
if (service)