Java apktool 未被识别为外部或内部命令

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22596115/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 16:44:12  来源:igfitidea点击:

apktool not recognized as external or internal command

javaandroidwindows

提问by user3453114

I am trying to run android apktool on my windows 7 machine, but getting the above error. I download apktool-install-windows-r05-ibot and apktool1.5.2 package and the apktool.jar files has been present inside the folder apktool.jar. Also I have checked both jdk and jre has been installed and Enviroment variables are also set for both of them. I also tried $ ./apktool.jar if framework-res.apk but still getting the same error. Just for info I have also added the below path to the env variables, C:\Program Files\Android\sdk\platform-tools Tools - C:\Program Files\Android\sdk\tools,C:\Program Files\Android\sdk\build-tools\18.1.0. Please let me know how to fixed this error or anthing which I am doing wrong.

我试图在我的 Windows 7 机器上运行 android apktool,但出现上述错误。我下载了 apktool-install-windows-r05-ibot 和 apktool1.5.2 包,apktool.jar 文件已经存在于文件夹 apktool.jar 中。我还检查了 jdk 和 jre 都已安装,并且还为它们设置了环境变量。我也试过 $ ./apktool.jar if framework-res.apk 但仍然得到同样的错误。仅供参考,我还将以下路径添加到 env 变量,C:\Program Files\Android\sdk\platform-tools Tools - C:\Program Files\Android\sdk\tools,C:\Program Files\Android\ sdk\build-tools\18.1.0. 请让我知道如何修复此错误或我做错的事情。

采纳答案by sheshadri

Folder name :ApkToolPath.

文件夹名称:ApkToolPath。

The ApkToolPath folder is located at C:/ and it contains aapt.exe,apktool.bat and apktool.jar

ApkToolPath 文件夹位于 C:/,它包含 aapt.exe、apktool.bat 和 apktool.jar

In cmd run this command c:>"C:\Program Files\Java\jre7\bin\java" -jar ApkToolPath\apktool.jar

在 cmd 中运行此命令 c:>"C:\Program Files\Java\jre7\bin\java" -jar ApkToolPath\apktool.jar

After that cd ApkToolPath

之后 cd ApkToolPath

cd:\ApkToolPath>apktool d name_of_apk.apk

cd:\ApkToolPath>apktool d name_of_apk.apk

回答by NightSilverWolf

C:\ cd < apktool.jar directory here > ENTER

C:\cd <apktool.jar 目录在这里>回车

C:\ java -jar apktool.jar

C:\ java -jar apktool.jar

If you don't have the Path of java set,

如果你没有设置java的路径,

C:\ "C:\Program Files\Java\jre7\bin\java" -jar < apktool.jar directory here>\apktool.jar

C:\"C:\Program Files\Java\jre7\bin\java" -jar <这里的apktool.jar目录>\apktool.jar

回答by user7886412

in start find Edit Environment Variables and click in variable user new 1 variable name -> PATH 2 variable user -> C:\Program Files\Java\jre7\bin

在开始找到 Edit Environment Variables 并单击 variable user new 1 variable name -> PATH 2 variable user -> C:\Program Files\Java\jre7\bin

回答by Mohammad Zuha Khalid

After extracting apktool-install-windows-r05-ibot and apktool1.5.2 package

解压后 apktool-install-windows-r05-ibot 和 apktool1.5.2 包

try to put the content which were inside both folders into same folder say xml. Then run the command

尝试将两个文件夹中的内容放入同一个文件夹中,比如 xml。然后运行命令

回答by Daniyal Akhlaq

The problem I have been facing was due to .JAR format was not included in the "PATHEXT" variable. In Advanced system settings, click on Environment Variables, in that window look for PATHEXT in system variables column and add .JAR in the end of that variable.

我一直面临的问题是由于 .JAR 格式未包含在“PATHEXT”变量中。在高级系统设置中,单击环境变量,在该窗口中查找系统变量列中的 PATHEXT 并在该变量的末尾添加 .JAR。