tech_human
tech_human

Reputation: 7102

"apktool: command not found" error

I followed the instructions mentioned here - http://ibotpeaches.github.io/Apktool/install/ for Mac OS to install Apktool 2.X version. I moved the downloaded and renamed files apktool.jar and apktool to /usr/local/bin.

Now when I run apktool from terminal from the same path i.e. "usr/local/bin", I get "apktool: command not found" error.

Referring to one of the posts here on SO about the same issue (Terminal can't run apktool), the suggestion was to run ./apktool instead of apktool and that gives me "-bash: ./apktool: No such file or directory"

Am I doing something wrong here?

Upvotes: 4

Views: 24073

Answers (3)

crashHunter
crashHunter

Reputation: 11

check if there is a hidden file extension, like '.txt' behind the script file.

Upvotes: 1

Connor Tumbleson
Connor Tumbleson

Reputation: 3330

The process here is the same as any binary application, with the exception that we additionally have a jar file. The apktool file is simply a helper script to prevent you having to type java -jar apktool.jar every time. With this in mind, you must have the following.

  1. Both files in /usr/local/bin or a directory that is in $PATH so you can execute it anywhere regardless of path.

  2. The helper script (apktool) must be executable. chmod a+x apktool

If you meet these conditions than running apktool anywhere will run the helper script, which runs apktool.jar. You can test this by cd /usr/local/bin, java -jar apktool.jar. Does that work? If so, apktool.jar is in the right place.

Upvotes: 15

Muhammad Numan
Muhammad Numan

Reputation: 25343

installation of apktool

For Macbook

brew install apktool

For Linux

apt-get install -y apktool

For Window

you can read installion step for window DOCS

Upvotes: 5

Related Questions