def cmd_crashget(args, dev): # move the crashes cm = CrashMover(dev) cm.move_crashlogs() cm.disconnect() # retrieve the crashes afc = afccrashlogdirectory.AFCCrashLogDirectory(dev) get_logs(afc, u'/', args.dest.decode(u'utf-8')) # optionally, delete the crashes if args.delete_logs: del_logs(afc, u'/') afc.disconnect()
def get_afc(args, dev): retval = None if args.path.startswith(u'/var/mobile/Media'): retval = afcmediadirectory.AFCMediaDirectory(dev) args.path = args.path[len(u'/var/mobile/Media'):] elif args.m: retval = afcmediadirectory.AFCMediaDirectory(dev) elif args.c: retval = afccrashlogdirectory.AFCCrashLogDirectory(dev) elif args.app is not None: retval = afcapplicationdirectory.AFCApplicationDirectory( dev, args.app.decode(u'utf-8')) else: retval = afcroot.AFCRoot(dev) return retval