简体   繁体   English

“apktool:找不到命令”错误

[英]"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.我按照这里提到的说明 - http://ibotpeaches.github.io/Apktool/install/ for Mac OS 安装 Apktool 2.X 版本。 I moved the downloaded and renamed files apktool.jar and apktool to /usr/local/bin.我将下载并重命名的文件 apktool.jar 和 apktool 移动到 /usr/local/bin。

Now when I run apktool from terminal from the same path ie "usr/local/bin", I get "apktool: command not found" error.现在,当我从同一路径(即“usr/local/bin”)从终端运行 apktool 时,出现“apktool: command not found”错误。

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"参考 SO 上关于同一问题的一篇帖子( 终端无法运行 apktool ),建议是运行 ./apktool 而不是 apktool ,这给了我“-bash:./apktool:没有这样的文件或目录”

Am I doing something wrong here?我在这里做错了吗?

The process here is the same as any binary application, with the exception that we have additionally have a jar file.这里的过程与任何二进制应用程序相同,除了我们还有一个 jar 文件。 The apktool file is simply a helper script to prevent you having to type java -jar apktool.jar every time. apktool文件只是一个帮助脚本,可以防止您每次都键入java -jar apktool.jar 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. /usr/local/bin两个文件或$PATH的目录,因此无论路径如何,您都可以在任何地方执行它。

  2. The helper script ( apktool ) must be executable.辅助脚本 ( apktool ) 必须是可执行的。 chmod a+x apktool

If you meet these conditions than running apktool anywhere will run the helper script, which runs apktool.jar .如果您满足这些条件,那么在任何地方运行apktool都会运行帮助程序脚本,该脚本运行apktool.jar You can test this by cd /usr/local/bin , java -jar apktool.jar .您可以通过cd /usr/local/binjava -jar apktool.jar Does that work?那样有用吗? If so, apktool.jar is in the right place.如果是这样, apktool.jar就在正确的位置。

installation of apktool安装apktool

For Macbook适用于 Macbook

brew install apktool

For Linux对于 Linux

apt-get install -y apktool

For Window窗用

you can read installion step for window DOCS你可以阅读window DOCS的安装步骤

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 bash:apktool:找不到命令 - bash: apktool: command not found apktool编译错误未找到与给定名称匹配的资源(在'pointDrawable'处,值为'@ android:drawable / APKTOOL_DUMMY_0302' - apktool compile error No resource found that matches the given name (at 'pointDrawable' with value '@ android:drawable/APKTOOL_DUMMY_0302' APKTool错误重新编译apk - APKTool error ricompiling apk Android apktool错误 - Android apktool error Mac上的Apktool错误 - Apktool error on mac apktool 未被识别为外部或内部命令 - apktool not recognized as external or internal command apktool 未被识别为内部或外部命令 - apktool is not recognised as an internal or external command Apktool-检索项目的父项时出错:找不到与给定名称匹配的资源 - Apktool- Error retrieving parent for item: No resource found that matches the given name 错误:找不到资产包包括“ C:\\ Users \\ jody \\ apktool \\ framework \\ 1.apk” - ERROR: Asset package include 'C:\Users\jody\apktool\framework\1.apk' not found Apktool 检索项目的父项时出错:找不到与给定名称“@android:style/Animation.OptionsPanel”匹配的资源 - Apktool Error retrieving parent for item: No resource found that matches the given name '@android:style/Animation.OptionsPanel'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM