Search code examples
androidbatch-filecmdapktool

Convert APK to manifest in a loop


I have many APK (Android package) files in a folder and I want to extract the manifest files from each of them. I am using Android apktool to convert them and since there are many APK files I want to convert them in a loop, not one by one.

apktool d hello.apk ./hello is the command for extracting manifest files from hello.apk and produces the output folder named hello.

I tried the command in the command prompt using for loop in the current directory in which all APK files are stored:

for \r %v in (*.apk) do apktool d "%v" "./%v".

I want the output folder of same name for each APK file, i.e. if APK is hello.apk the output folder should be hello. The above command is producing an error: cannot generate the output folder. How can I extract manifest files from all such APK files at once from a loop?


Solution

  • Maybe you forgot -o parameter?

    That command works fine for me:

    for /r %v in (*.apk) do apktool.jar d "%v" -o "./%~Nv"