← 返回命令列表

Linux command

apksigner 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Sign

apksigner sign --ks [keystore.jks] [app.apk]

Example

apksigner sign --ks [keystore.jks] --ks-key-alias [alias] [app.apk]

Verify

apksigner verify [app.apk]

Example

apksigner verify --verbose --print-certs [app.apk]

Example

apksigner sign --v1-signing-enabled --v2-signing-enabled --v3-signing-enabled --ks [keystore.jks] [app.apk]

说明

apksigner is the official Android SDK tool for signing APK files. It supports multiple signature schemes (v1/JAR, v2, v3, v4) and can sign aligned APKs produced by zipalign. The tool ensures APKs meet Android's signing requirements for installation and updates, with newer schemes providing better security and verification speed.

参数

sign
Sign an APK
verify
Verify APK signatures
--ks _file_
Keystore file
--ks-key-alias _alias_
Key alias in keystore
--ks-pass _pass_
Keystore password (pass: or file:)
--key-pass _pass_
Key password
--out _file_
Signed APK output path
--v1-signing-enabled _bool_
Enable JAR signing (v1)
--v2-signing-enabled _bool_
Enable APK Signature Scheme v2
--v3-signing-enabled _bool_
Enable APK Signature Scheme v3
--verbose
Verbose output
--print-certs
Print certificate details

FAQ

What is the apksigner command used for?

apksigner is the official Android SDK tool for signing APK files. It supports multiple signature schemes (v1/JAR, v2, v3, v4) and can sign aligned APKs produced by zipalign. The tool ensures APKs meet Android's signing requirements for installation and updates, with newer schemes providing better security and verification speed.

How do I run a basic apksigner example?

Run `apksigner sign --ks [keystore.jks] [app.apk]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does sign do in apksigner?

Sign an APK