Can't find 'apksigner' executable to manually sign APK
Asked Answered
L

8

54

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 ...
Lanner answered 12/10, 2016 at 17:33 Comment(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.Trichinosis
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 ? @LannerPassepartout
T
73

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.

Trichinosis answered 13/10, 2016 at 1:12 Comment(4)
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.Strangury
I just found out this as well, very annoying. I wonder how 26.0.0 passed the tests for releaseDubiety
downloading 26.0.1 via the android studio sdk manager fixes this. my Ubuntu path: /home/__user__/Android/Sdk/build-tools/26.0.1/apksignerBeast
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...Muckworm
C
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

Corporator answered 9/4, 2019 at 8:53 Comment(0)
S
9

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

%localappdata%\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

Stripling answered 28/12, 2020 at 20:26 Comment(3)
thanks man, this saved me. there always should be someone who works with workarounds 😁Baier
Thank you man after 22 hours finally found the solution.Negrillo
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!Trifolium
B
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

Brune answered 7/11, 2018 at 19:5 Comment(0)
C
5

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
Crabwise answered 29/7, 2019 at 12:18 Comment(0)
H
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
Hickory answered 3/6, 2021 at 10:55 Comment(0)
I
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
Impure answered 1/3, 2022 at 9:8 Comment(0)
C
0

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

Contrasty answered 10/6, 2022 at 10:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.