52

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 ...
Rohit Singh
  • 16,950
  • 7
  • 90
  • 88
ScottyC
  • 1,467
  • 1
  • 15
  • 22
  • 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. – Alex Klyubin Oct 13 '16 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 – Rohit Singh Aug 27 '22 at 17:26

8 Answers8

69

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.

Alex Klyubin
  • 5,554
  • 2
  • 29
  • 24
  • 11
    Note that `apksigner` is missing in version `26.0.0` of build-tools. It is tracked in https://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`. – friederbluemle Jun 29 '17 at 02:48
  • 3
    I just found out this as well, very annoying. I wonder how `26.0.0` passed the tests for release – Sipka Jul 02 '17 at 07: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 '17 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 from sdk versions? If I had a nickel for every time this has happened... – wkhatch Feb 15 '18 at 18:51
19

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

Ahmed Adewale
  • 2,943
  • 23
  • 19
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

myeongkil kim
  • 2,465
  • 4
  • 16
  • 22
BOUZAR
  • 101
  • 1
  • 3
  • thanks man, this saved me. there always should be someone who works with workarounds – Fuad Teymurov Jul 08 '22 at 13:58
  • Thank you man after 22 hours finally found the solution. – Shahid Khan Jul 31 '22 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 '22 at 13:08
7

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

prosti
  • 42,291
  • 14
  • 186
  • 151
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
Franz Andel
  • 1,326
  • 12
  • 20
Suryakant kumar
  • 100
  • 1
  • 6
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
top.eng
  • 1,828
  • 2
  • 13
  • 21
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
ouflak
  • 2,458
  • 10
  • 44
  • 49
0

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

ofir_aghai
  • 3,017
  • 1
  • 37
  • 43