def proclist(lockdown, nocolor): """ show process list """ with DvtSecureSocketProxyService(lockdown=lockdown) as dvt: processes = DeviceInfo(dvt).proclist() for process in processes: if 'startDate' in process: process['startDate'] = str(process['startDate']) print_object(processes, colored=not nocolor)
def stackshot(lockdown, out, nocolor): """ Dump stackshot information. """ with DvtSecureSocketProxyService(lockdown=lockdown) as dvt: with CoreProfileSessionTap(dvt) as tap: data = tap.get_stackshot() if out is not None: json.dump(data, out, indent=4) else: print_object(data, colored=not nocolor)
def device_information(lockdown, nocolor): """ Print system information. """ with DvtSecureSocketProxyService(lockdown=lockdown) as dvt: device_info = DeviceInfo(dvt) print_object({ 'system': device_info.system_information(), 'hardware': device_info.hardware_information(), 'network': device_info.network_information(), }, colored=not nocolor)
def list_devices(nocolor): """ list connected devices """ mux = usbmux.USBMux() mux.process() connected_devices = [] for device in mux.devices: udid = device.serial lockdown = LockdownClient(udid) connected_devices.append(lockdown.all_values) print_object(connected_devices, colored=not nocolor, default=lambda x: '<non-serializable>')
def applist(lockdown, nocolor): """ show application list """ with DvtSecureSocketProxyService(lockdown=lockdown) as dvt: apps = ApplicationListing(dvt).applist() print_object(apps, colored=not nocolor)
def trace_codes(lockdown, nocolor): """ Print system information. """ with DvtSecureSocketProxyService(lockdown=lockdown) as dvt: device_info = DeviceInfo(dvt) print_object({hex(k): v for k, v in device_info.trace_codes().items()}, colored=not nocolor)