summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Robert Gadbois2018-03-21 15:06:22 +0100
committerGravatar Nikias Bassen2018-03-21 15:06:22 +0100
commitf37b592788bffcb9a70d211aef8b1f84751114ca (patch)
tree70e615aa7b6722d4f73e9fc370eacde0106bd842 /tools
parent739a34ce8c711f975151d2ae6ef1e575d0aed764 (diff)
downloadlibimobiledevice-f37b592788bffcb9a70d211aef8b1f84751114ca.tar.gz
libimobiledevice-f37b592788bffcb9a70d211aef8b1f84751114ca.tar.bz2
idevicediagnostics: Add ioregentry command to query device IORegistry by entry
Starting with iOS 9.1, querying IORegistry by plane stopped working. This commit will add a new command that allows querying by entry that will allow gathering data for devices with newer iOS versions again (including iOS 11).
Diffstat (limited to 'tools')
-rw-r--r--tools/idevicediagnostics.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/tools/idevicediagnostics.c b/tools/idevicediagnostics.c
index 2ea986f..66e192f 100644
--- a/tools/idevicediagnostics.c
+++ b/tools/idevicediagnostics.c
@@ -40,7 +40,8 @@ enum cmd_mode {
40 CMD_SHUTDOWN, 40 CMD_SHUTDOWN,
41 CMD_DIAGNOSTICS, 41 CMD_DIAGNOSTICS,
42 CMD_MOBILEGESTALT, 42 CMD_MOBILEGESTALT,
43 CMD_IOREGISTRY 43 CMD_IOREGISTRY,
44 CMD_IOREGISTRY_ENTRY
44}; 45};
45 46
46static void print_xml(plist_t node) 47static void print_xml(plist_t node)
@@ -156,6 +157,15 @@ int main(int argc, char **argv)
156 } 157 }
157 continue; 158 continue;
158 } 159 }
160 else if (!strcmp(argv[i], "ioregentry")) {
161 cmd = CMD_IOREGISTRY_ENTRY;
162 /* read key */
163 i++;
164 if (argv[i]) {
165 cmd_arg = strdup(argv[i]);
166 }
167 continue;
168 }
159 else { 169 else {
160 print_usage(argc, argv); 170 print_usage(argc, argv);
161 return 0; 171 return 0;
@@ -232,6 +242,16 @@ int main(int argc, char **argv)
232 printf("Unable to query mobilegestalt keys.\n"); 242 printf("Unable to query mobilegestalt keys.\n");
233 } 243 }
234 break; 244 break;
245 case CMD_IOREGISTRY_ENTRY:
246 if (diagnostics_relay_query_ioregistry_entry(diagnostics_client, cmd_arg == NULL ? "": cmd_arg, "", &node) == DIAGNOSTICS_RELAY_E_SUCCESS) {
247 if (node) {
248 print_xml(node);
249 result = EXIT_SUCCESS;
250 }
251 } else {
252 printf("Unable to retrieve IORegistry from device.\n");
253 }
254 break;
235 case CMD_IOREGISTRY: 255 case CMD_IOREGISTRY:
236 if (diagnostics_relay_query_ioregistry_plane(diagnostics_client, cmd_arg == NULL ? "": cmd_arg, &node) == DIAGNOSTICS_RELAY_E_SUCCESS) { 256 if (diagnostics_relay_query_ioregistry_plane(diagnostics_client, cmd_arg == NULL ? "": cmd_arg, &node) == DIAGNOSTICS_RELAY_E_SUCCESS) {
237 if (node) { 257 if (node) {
@@ -292,6 +312,7 @@ void print_usage(int argc, char **argv)
292 printf(" diagnostics [TYPE]\t\tprint diagnostics information from device by TYPE (All, WiFi, GasGauge, NAND)\n"); 312 printf(" diagnostics [TYPE]\t\tprint diagnostics information from device by TYPE (All, WiFi, GasGauge, NAND)\n");
293 printf(" mobilegestalt KEY [...]\tprint mobilegestalt keys passed as arguments seperated by a space.\n"); 313 printf(" mobilegestalt KEY [...]\tprint mobilegestalt keys passed as arguments seperated by a space.\n");
294 printf(" ioreg [PLANE]\t\t\tprint IORegistry of device, optionally by PLANE (IODeviceTree, IOPower, IOService) (iOS 5+ only)\n"); 314 printf(" ioreg [PLANE]\t\t\tprint IORegistry of device, optionally by PLANE (IODeviceTree, IOPower, IOService) (iOS 5+ only)\n");
315 printf(" ioregentry [KEY]\t\tprint IORegistry entry of device (AppleARMPMUCharger, ASPStorage, ...) (iOS 5+ only)\n");
295 printf(" shutdown\t\t\tshutdown device\n"); 316 printf(" shutdown\t\t\tshutdown device\n");
296 printf(" restart\t\t\trestart device\n"); 317 printf(" restart\t\t\trestart device\n");
297 printf(" sleep\t\t\t\tput device into sleep mode (disconnects from host)\n\n"); 318 printf(" sleep\t\t\t\tput device into sleep mode (disconnects from host)\n\n");