53

Following the Sign Your App Manually guide,

You can sign your app from the command line using standard tools from the Android SDK and the JDK

I should have apksigner somewhere to run

$ apksigner sign --ks my-release-key.jks my-app.apk

Where is this executable supposed to be? The documentation never specifies where I'm supposed to get the tool on the Signing guide or the apksigner doc.

I don't recall having this problem last time I manually signed an app. I've searched all the directories I can think of with no luck (including subdirectories):

  • AppData\Local\Android\sdk
  • Program Files\Android\Android Studio
  • Program Files\Java\jdk1.8.0_91

Googling for 'apksigner' just seems to turn up a number of unofficial apk signing tools but no official download. What am I missing?

Running Android Studio 2.2, Build Tools 24.0.2, JDK 1.8

Thanks

ANSWERED: Updating to to 24.0.3 solves it. Thanks to Alex Klyubin, please upvote his answer. For some reason Build Tools 24.0.2 simply does not have apksigner.

Build Tools, Revision 24.0.3 (September 2016)

  • Added apksigner, an APK signing tool to replace jarsigner ...
2
  • 2
    Re: apksigner not there in 24.0.2. apksigner is a new tool. It didn't yet exist when Android SDK Build Tools 24.0.2 were released. Oct 13, 2016 at 22:21
  • Did you run that command inside Android Studio? When I run the command it says apksigner command not found. Do I need to set enviornment variable ? @ScottyC Aug 27, 2022 at 17:26

8 Answers 8

71

apksigner shipped with Android SDK Build Tools 24.0.3 (see https://developer.android.com/studio/releases/build-tools.html). The tool can be found in the Android SDK's build-tools/<tools version> directory. For example, build-tools/24.0.3/apksigner on Linux/OSX and build-tools/24.0.3/apksigner.bat on Windows.

4
  • 11
    Note that apksigner is missing in version 26.0.0 of build-tools. It is tracked in issuetracker.google.com/issues/62696222 and supposed to be fixed in the next version. The workaround until then is to use apksigner from 25.0.3. Jun 29, 2017 at 2:48
  • 3
    I just found out this as well, very annoying. I wonder how 26.0.0 passed the tests for release
    – Sipka
    Jul 2, 2017 at 7:39
  • downloading 26.0.1 via the android studio sdk manager fixes this. my Ubuntu path: /home/__user__/Android/Sdk/build-tools/26.0.1/apksigner
    – ryanrain
    Aug 17, 2017 at 17:58
  • ugh, I thought I was losing my mind; thanks for pointing out the missing tool in 26.0.0. How is that google keeps having these problems with missing <whatever> from sdk versions? If I had a nickel for every time this has happened...
    – wkhatch
    Feb 15, 2018 at 18:51
20

On mac
The Apksigner is inside build tools all you need is this line

/Users/adewale***/Library/Android/sdk/build-tools/28.0.3/apksigner verify MyApp.apk

just change /Users/adewale***/Library/Android/sdk/build-tools to your build tools path. Done

8

On Windows 10 it should be under directory

 C:\Users\{user}\AppData\Local\Android\Sdk\build-tools\

Note the AppData directory is by default hidden. First make sure you installed Android SDK 24.0.3 or later. enter image description here

8

I was facing the same problem on windows 10, I found apksigner.jar jar file in the following path:

C:\Users\miaou\AppData\Local\Android\Sdk\build-tools\29.0.2\lib

I did copy the .jar file and paste it inside platform-tools folder inside Android sdk directory

3
  • thanks man, this saved me. there always should be someone who works with workarounds 😁 Jul 8, 2022 at 13:58
  • Thank you man after 22 hours finally found the solution. Jul 31, 2022 at 11:09
  • This is the ANSWER because, the apksigner.bat is not required but apksigner.jar is. This file is a bit of an oddball because it has this ghostly bat file in the expected bin folder but the real jar file resides in the lib folder!
    – user30478
    Aug 27, 2022 at 13:08
4

Use this command will work for sure (For Windows)

--Go to this directory

C:/Users/{UserName}/AppData/Local/Android/Sdk/build-tools/29.0.0/

--Type this command :

apksigner.bat verify {PathToApp/AppName}.apk

Full Example :

C:/Users/Surya/AppData/Local/Android/Sdk/build-tools/29.0.0/apksigner.bat verify C:/AndroidApp/test.apk
0

On windows I couldn't use apksigner even with build tools version 31.0.0.

finally used apksigner command with .bat postfix and it worked fine.

for example

 apksigner.bat verify AppName.apk
0

If you have downloaded command-line tools and haven't extracted "build-tools" folder yet then open cmd and go to folder's location where your SDKManager is present and then run the following command:

//sdkmanager build-tools verison number like following command

sdkmanager build-tools;31.0.0 

"apksigner.jar" comes inside the build-tools\version number\lib folder.

After running the above command, set the path (where your apksigner.jar is present) in environemnt variable.

You can check list of build tools versions from following link: https://developer.android.com/studio/releases/build-tools

Or simply you can run following command in the cmd:

sdkmanager --list
0

just store this in path environment values: %LOCALAPPDATA%\Android\Sdk\build-tools\32.0.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.