{"id":7313,"library":"ipsw-parser","title":"IPSW Parser","description":"ipsw-parser is a Python 3 utility for parsing and extracting data from Apple IPSW (iPhone Software) firmware files. It provides programmatic access to various components within an IPSW, such as kernelcaches, build manifests, and device class hashes (DSC). The library is actively maintained with frequent minor updates, currently at version 1.6.0.","status":"active","version":"1.6.0","language":"en","source_language":"en","source_url":"https://github.com/doronz88/ipsw_parser","tags":["apple","ios","firmware","ipsw","parser","security"],"install":[{"cmd":"pip install ipsw-parser","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Required for parsing IMG4 formatted files, which are integral to modern iOS firmware components.","package":"pyimg4","optional":false},{"reason":"Used for efficient remote access to IPSW files without downloading the entire archive.","package":"remotezip","optional":true},{"reason":"Used for building the command-line interface. Not required for library-only usage.","package":"typer","optional":true}],"imports":[{"symbol":"IPSW","correct":"from ipsw_parser.ipsw import IPSW"},{"symbol":"IPSWError","correct":"from ipsw_parser.exceptions import IPSWError"}],"quickstart":{"code":"from ipsw_parser.ipsw import IPSW\nfrom ipsw_parser.exceptions import IPSWError\nimport os\n\n# For demonstration, assume an IPSW file exists or is specified via environment variable.\n# Replace 'path/to/your/firmware.ipsw' with an actual path to an IPSW file.\n# You can often find these files on websites like ipsw.me\nipsw_file_path = os.environ.get('IPSW_FILE_PATH', 'path/to/your/firmware.ipsw')\n\nif not os.path.exists(ipsw_file_path):\n    print(f\"Warning: IPSW file not found at '{ipsw_file_path}'. Please provide a valid path.\")\n    print(\"Skipping quickstart example as no IPSW file is available.\")\nelse:\n    try:\n        # Initialize the IPSW parser with the file path\n        ipsw = IPSW(ipsw_file_path)\n        print(f\"Successfully loaded IPSW from: {ipsw.path}\")\n\n        # Access basic information\n        print(f\"Device Class: {ipsw.build_identity.device_class}\")\n        print(f\"Build ID: {ipsw.build_identity.build_id}\")\n\n        # Example: Extract the kernelcache\n        # This will extract to a default temporary location or specified directory\n        kernel_path = ipsw.extract_kernelcache()\n        print(f\"Kernelcache extracted to: {kernel_path}\")\n\n        # Example: Extract the device class hashes (DSC) if available\n        # Note: In v1.5.0+, dsc extraction logic was moved to a separate module.\n        # This example uses the primary IPSW object method which wraps the new logic.\n        dsc_path = ipsw.extract_dsc()\n        if dsc_path:\n            print(f\"Device Class Hashes (DSC) extracted to: {dsc_path}\")\n        else:\n            print(\"No DSC found or extracted.\")\n\n    except IPSWError as e:\n        print(f\"Error parsing IPSW file: {e}\")\n    except FileNotFoundError:\n        print(f\"Error: The specified IPSW file '{ipsw_file_path}' was not found.\")\n    except Exception as e:\n        print(f\"An unexpected error occurred: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to initialize the `IPSW` parser with a firmware file, retrieve basic information like the device class and build ID, and extract common components such as the kernelcache and device class hashes (DSC)."},"warnings":[{"fix":"Review the `pymobiledevice3` library documentation and integrate it into your project if you require the moved functionality. Check the changelog for specific removals.","message":"Starting with version 1.4.0, functionality previously included in `ipsw-parser` was moved into the `pymobiledevice3` library. If your code relied on specific functions or classes that are no longer present, you will encounter `AttributeError` or `ModuleNotFoundError`.","severity":"breaking","affected_versions":">=1.4.0"},{"fix":"Upgrade your Python environment to Python 3.9 or newer. The library's `requires_python` metadata explicitly states `>=3.9`.","message":"Support for Python 3.8 was officially removed in version 1.3.8. Attempting to use `ipsw-parser` on Python 3.8 or older will result in installation issues or runtime errors.","severity":"breaking","affected_versions":">=1.3.8"},{"fix":"Prefer using the `IPSW` object's methods (e.g., `ipsw.extract_dsc()`) rather than directly importing internal DSC modules. If you must use internal modules, consult the source code for the correct new paths.","message":"In version 1.5.0, the internal logic for DSC (Device Class Hash) extraction was refactored and split into its own module. While the top-level `ipsw.extract_dsc()` method should remain stable, direct imports to internal DSC-related functions might require updates.","severity":"gotcha","affected_versions":">=1.5.0"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure the package is installed using `pip install ipsw-parser`. Verify your import statements, typically `from ipsw_parser.ipsw import IPSW`.","cause":"The `ipsw-parser` package is not installed in your current Python environment, or there is a typo in the import statement.","error":"ModuleNotFoundError: No module named 'ipsw_parser'"},{"fix":"Double-check the file path. Ensure the IPSW file exists at the given location and that the path is absolute or correct relative to your script's working directory.","cause":"The specified path to the IPSW file does not exist or is incorrect. This often happens when the file is moved, deleted, or the path contains typos.","error":"FileNotFoundError: [Errno 2] No such file or directory: 'path/to/your/firmware.ipsw'"},{"fix":"Verify that the file you are trying to parse is a legitimate IPSW file. You might need to download a fresh copy or check its integrity. The file extension should typically be `.ipsw`.","cause":"The file provided to the `IPSW` constructor is either corrupted, incomplete, or not a valid Apple IPSW firmware archive.","error":"ipsw_parser.exceptions.IPSWError: This is not an IPSW file."},{"fix":"Ensure you are instantiating the `IPSW` class correctly, e.g., `from ipsw_parser.ipsw import IPSW; ipsw = IPSW('file.ipsw')`.","cause":"You might be trying to call a module directly instead of a class or function within it, for example, `ipsw_parser.ipsw()` instead of `ipsw_parser.ipsw.IPSW()`.","error":"TypeError: 'module' object is not callable"}]}