88
93
printf("Could not connect to screenshotr!\n");
90
95
char *imgdata = NULL;
92
96
uint64_t imgsize = 0;
93
time_t now = time(NULL);
94
strftime(filename, 36, "screenshot-%Y-%m-%d-%H-%M-%S.tiff", gmtime(&now));
98
time_t now = time(NULL);
99
filename = (char*)malloc(36);
100
strftime(filename, 36, "screenshot-%Y-%m-%d-%H-%M-%S.tiff", gmtime(&now));
95
102
if (screenshotr_take_screenshot(shotr, &imgdata, &imgsize) == SCREENSHOTR_E_SUCCESS) {
96
103
FILE *f = fopen(filename, "wb");
118
125
lockdownd_service_descriptor_free(service);
120
127
idevice_free(device);
125
133
void print_usage(int argc, char **argv)
129
name = strrchr(argv[0], '/');
130
printf("Usage: %s [OPTIONS]\n", (name ? name + 1: argv[0]));
131
printf("Gets a screenshot from a device.\n");
132
printf("The screenshot is saved as a TIFF image in the current directory.\n");
133
printf("NOTE: A mounted developer disk image is required on the device, otherwise\n");
134
printf("the screenshotr service is not available.\n\n");
135
printf(" -d, --debug\t\tenable communication debugging\n");
136
printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n");
137
printf(" -h, --help\t\tprints usage information\n");
137
name = strrchr(argv[0], '/');
138
printf("Usage: %s [OPTIONS] [FILE]\n", (name ? name + 1: argv[0]));
139
printf("Gets a screenshot from a device.\n");
140
printf("The screenshot is saved as a TIFF image with the given FILE name,\n");
141
printf("where the default name is \"screenshot-DATE.tiff\", e.g.:\n");
142
printf(" ./screenshot-2013-12-31-23-59-59.tiff\n\n");
143
printf("NOTE: A mounted developer disk image is required on the device, otherwise\n");
144
printf("the screenshotr service is not available.\n\n");
145
printf(" -d, --debug\t\tenable communication debugging\n");
146
printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n");
147
printf(" -h, --help\t\tprints usage information\n");