I installed fish shell on my macbook. when I try to run the command adb - get error fish: Unknown command 'adb', though adb is added to .bash_profile. How to fix it?

~/.bash_profile

export ADB=:/Users/mancj/Library/Android/sdk/platform-tools/
export PATH=$ADB:$PATH

EDIT: I tried a cd in the adb folder and run the adb command , also get error fish: Unknown command 'adb'


Solution 1:

fish doesn't care about bash's startup files, see https://fishshell.com/docs/current/tutorial.html#tut_startup

You need to change your PATH in ~/.config/fish/config.fish instead and restart the shell.

Solution 2:

Within Android Studio's Terminal, run the following command:

set PATH ~/Library/Android/sdk/platform-tools $PATH

This means any executable within the given path (adb in our case) can be run by its name rather than path directory.

If you're not using FISH, you can achieve the same using this command:

export PATH="~/Library/Android/sdk/platform-tools":$PATH

Solution 3:

Use fish_add_path /Users/mancj/Library/Android/sdk/platform-tools/ or you can add the same to ~/.config/fish/config.fish
Might need to re start the shell