How to Fix "frida-ps: command not found" Error on [macOS]
If you've recently installed Frida tools on your Mac and encountered the following error when running frida-ps -Ua:
-bash: frida-ps: command not found
Don't worry! This common issue occurs because the Frida tools are installed in a local Python directory that's not yet added to your system's PATH. Here's a quick step-by-step guide on how to fix it.
Step 1: Verify Frida Tools Installation
First, ensure that Frida tools are installed correctly. Run this command in your terminal:
pip3 install frida-tools
If you see output similar to this:
Requirement already satisfied: frida-tools in ./Library/Python/3.9/lib/python/site-packages (13.6.1)
This means Frida tools are already installed.
Step 2: Locate the Python User Scripts Directory
Next, find out where Python installed the scripts by running:
python3 -m site --user-base
You should see output like this:
/Users/your_username/Library/Python/3.9
The scripts (including frida-ps) are typically stored inside a bin folder under this directory:
/Users/your_username/Library/Python/3.9/bin
Step 3: Add the Directory to Your PATH
To make sure your system recognizes the frida-ps command, add this directory to your PATH environment variable.
Open your shell configuration file (~/.bash_profile, ~/.zshrc, or ~/.bashrc) and add this line at the end:
export PATH=$PATH:/Users/your_username/Library/Python/3.9/bin
Replace your_username with your actual Mac username.
Save and close the file.
Step 4: Reload Your Shell Configuration
To apply changes immediately, run:
source ~/.bash_profile # or ~/.zshrc depending on your shell
Step 5: Verify That It Worked!
Now run this command again:
frida-ps -Ua
If everything worked correctly, you should now see a list of processes or applications without any errors!
Screenshots of the Error and Fix
Error Screenshot (Before Fix):
Mac:~ user$ frida-ps -Ua
-bash: frida-ps: command not found
Correct Output (After Fix):
Mac:~ user$ frida-ps -Ua
PID Name
---- -------------------------
1234 Safari
5678 Mail
...
That's it! You've successfully resolved the "frida-ps command not found" error on macOS.
