This repository contains the drivers, setup scripts, and implementation guides to enable 100% native Apple Silicon (ARM64) printing and scanning for the HP LaserJet Pro MFP M125a on macOS without Rosetta 2, security bypasses, or SIP modifications.
If you trust the pre-compiled binaries included in this repository, you can set up both printing and scanning in minutes:
Open a terminal inside the cloned repository directory and execute the installation scripts as a regular user (they will automatically prompt for your administrator password when writing to system folders):
For Native Printing Setup (CUPS Driver):
chmod +x install.sh uninstall.sh
./install.sh(To completely remove the native print driver at any point, simply run ./uninstall.sh as a regular user).
For Native Scanning Setup (Apple ICA Driver):
chmod +x install_scan.sh uninstall_scan.sh
./install_scan.sh(To completely remove the scanner driver, run ./uninstall_scan.sh as a regular user).
Connect the printer to your Mac via USB. macOS's hardware auto-discovery daemon will match the printer's hardware ID with the registered PPD, and automatically create the print queue under System Settings > Printers & Scanners!
(The printer will appear under the Model name HP LaserJet Pro MFP m125a, hpcups 3.26.4 (str4ngemd ARM64) and is ready to print natively!)
Important
Troubleshooting Auto-Registration Issues:
If the printer was connected before running ./install.sh, macOS may have registered it with an incorrect/broken driver. To fix this:
- Unplug the USB cable.
- Go to System Settings > Printers & Scanners, right-click on the printer, and click Remove Printer.
- Plug the printer back in. macOS will auto-discover it and build the queue using our native driver!
Note
The username str4ngemd is included in the model name so it won't be confused for an official PPD.
If you want to remove it, or write a custom name:
- Open
HP_LaserJet_Pro_MFP_M125a.ppd. - Replace lines 12-14 to your desire.
- Re-run
./install.sh.
- Connect the printer/scanner to your Mac using the USB cable.
- Open Image Capture.app (installed by default on macOS, find it in Spotlight).
- The device HP LaserJet Pro MFP M125a (str4ngemd) will appear under the Devices section in the sidebar.
- Select it, choose your resolution (75, 150, 300, 600, or 1200 DPI), select the output format (JPEG, PNG, PDF, TIFF), and click Scan!
- The scan will run, and the output file will be saved directly to your chosen directory.
Because the M125a uses hbpl1 (HP's flavor of PCLm raster printing), it requires HPLIP's open-source hpcups filter. We provide a pre-compiled self-contained ARM64 binary (hpcups-native) statically linked with libjpeg.a so it runs natively inside the macOS CUPS sandbox out-of-the-box.
We provide a fully integrated native macOS Image Capture (ICA) Driver for scanning. It consists of:
scan-goBackend: A compiled Go binary (/Library/Printers/hpcups-str4ngemd/bin/scan-go) that directly manages raw bulk USB transfers to send SOAP/XML commands, parse DIME data, and save JPEG scan outputs.M125aScanner.appDriver: An Apple Image Capture (ICA) driver bundle installed at/Library/Image Capture/Devices/M125aScanner.app. It matches the M125a USB vendor/product IDs (0x03F0/0x222A) to auto-launch. When you scan from any native macOS app, this driver callsscan-goin the background and converts the outputs seamlessly.
If you prefer to audit and compile the drivers yourself instead of using the pre-compiled binaries, follow the instructions below:
Follow these steps to compile hpcups-native directly from the open-source HPLIP repository:
Install Homebrew if not already installed, then fetch the compiler dependencies:
brew install jpeg cupsDownload version 3.26.4 from HPLIP SourceForge:
tar -xzf hplip-3.26.4.tar.gz
cd hplip-3.26.4Rename conflicting files in the HPLIP source codebase to prevent build failures on macOS's default case-insensitive filesystem:
mv prnt/hpcups/Utils.h prnt/hpcups/HPCupsUtils.h
mv prnt/hpcups/Utils.cpp prnt/hpcups/HPCupsUtils.cpp- Header Rename: Open
prnt/hpcups/HPCupsUtils.cppand update line 32 to include our renamed header:#include "HPCupsUtils.h" #include "utils.h"
- Non-Portable Headers: Open
prnt/hpcups/genJPEGStrips.cppand replace the Linux-specific headers (around line 31) with standard macOS headers:// Replace #include <malloc.h> and <memory.h> with: #include <stdlib.h> #include <string.h>
- Encap Technology Stub: Open
prnt/hpcups/EncapsulatorFactory.cppand replace its entire contents with the following minimal PCLm (hbpl1) selector to strip out unneeded targets:#include "CommonDefinitions.h" #include "EncapsulatorFactory.h" #include "Encapsulator.h" #include "Hbpl1.h" #include <string.h> Encapsulator *EncapsulatorFactory::GetEncapsulator (char *encap_tech) { if (encap_tech == NULL) { return NULL; } if (!strcmp (encap_tech, "hbpl1")) { return new Hbpl1(); } return NULL; }
Copy the build_native.sh script included in this repository to the root of the extracted HPLIP folder, make it executable, and run it:
cp ../build_native.sh ./
chmod +x build_native.sh
./build_native.shThis links against Homebrew's static archive /opt/homebrew/lib/libjpeg.a and compiles a self-contained hpcups-native binary. You can now proceed with the installation steps in the Quick Start to register the binary and PPD!
If you wish to modify the scanning code or compile the binaries yourself from source, run the installer with the build argument:
./install_scan.sh buildNote
Compiling from source requires Go (for compiling scan-go) and Xcode (for compiling the M125aScanner ICA app wrapper) to be installed.
During installation, the script copies/compiles the binaries, signs the components locally using macOS's built-in ad-hoc codesigning (codesign -s -), clears quarantine attributes, and registers them inside /Library. Since macOS performs signing locally, this does not require internet access or developer certificates.
If you wish to trigger a scan manually via the command line without the ICA GUI app:
/Library/Printers/hpcups-str4ngemd/bin/scan-go -r 300 -m Color -o output.jpgArguments:
-r: Resolution in DPI (75,150,300,600,1200).-m: Color Mode (Color,Gray,Mono).-o: Output file path.