APK

On this page 7

An APK, short for Android Package, is the file format that Android uses to install and distribute applications. It is a ZIP archive with a defined structure that contains the app’s compiled code, resources, native libraries and manifest, together with a cryptographic signature that identifies the developer and protects the contents from tampering.

In mobile distribution, the APK is the unit that actually lands on a device. Even when developers upload an Android App Bundle to Google Play, the store generates optimized APKs from it, and those are what the phone installs.

What an APK file contains

An APK follows a fixed internal layout that the Android package manager reads during installation. Each part serves a specific role in running the app.

EntryContentsPurpose
AndroidManifest.xmlPackage name, components, permissions, SDK levelsTells the system what the app is and needs
classes.dexCompiled Dalvik bytecode, possibly several filesApp code executed by the Android Runtime
resources.arscCompiled resource tableStrings, dimensions and resource lookups
res/Layouts, images, other resourcesInterface assets by density and language
lib/Native libraries per CPU architectureC and C++ code such as arm64-v8a builds
assets/Raw files read at runtimeData, fonts, models
META-INF/Legacy signature filesSignature verification for older devices
Main contents of an APK

The manifest is stored in a compiled binary XML format, not as plain text. Uncompressed native libraries and resources are aligned to 4-byte boundaries with the zipalign tool so the system can map them into memory directly, which saves RAM and speeds up loading.

During installation, the package manager verifies the signature, parses the manifest, checks that the device meets the declared minimum API level and CPU architecture, and copies the APK into a protected system directory. It then assigns the app a unique Linux user ID and may compile frequently used code ahead of time, so the first launch runs faster.

How APK signing works

Every APK must be signed with the developer’s private key before Android will install it. The signature proves that later updates come from the same developer: an update is accepted only if it is signed with the same key or an approved successor.

SchemeIntroduced inKey feature
v1 (JAR signing)Android 1.0Signs individual entries, slower and weaker
v2Android 7.0Signs the whole file, faster verification
v3Android 9Supports key rotation
v4Android 11Separate signature file for incremental installs
APK signature schemes

Losing the signing key used to mean that an app could never be updated again under the same package name. Play App Signing reduces this risk by letting Google hold the app signing key while the developer signs uploads with a separate upload key that can be reset.

APK compared with other mobile package formats

The APK is an installable artifact, while some neighboring formats are publishing artifacts that a store processes first. The comparison clarifies where each format fits.

FormatPlatformInstalled directly on devicesMain use
APKAndroidYesInstallation, sideloading, alternative stores
AAB (Android App Bundle)AndroidNoUpload format for Google Play
Split APKsAndroidYes, as a setDevice-specific delivery generated from an AAB
IPAiOS and iPadOSOnly through approved channelsApp Store, TestFlight, enterprise distribution
APK and related package formats

Google Play requires new apps to be published as AABs. From the bundle, Play generates a base APK and configuration splits for screen density, CPU architecture and language, so each device downloads only the parts it needs.

Installing and distributing APK files

APKs reach devices through app stores, enterprise management or sideloading. Each channel offers a different balance between reach, control and security review.

ChannelTypical useSecurity consideration
Google PlayPublic consumer appsStore review and Play Protect scanning
Alternative app storesRegional markets, devices without Google servicesReview quality varies
Managed Google Play or MDMInternal company appsDistribution limited to managed devices
SideloadingTesting, open-source appsUser must allow installs from that source
ADB installDevelopment and debuggingRequires developer options and USB access
APK distribution channels

Since Android 8.0, permission to install unknown apps is granted per source app, such as a specific browser or file manager, rather than globally. This limits the damage if a user is tricked into downloading a malicious APK.

Common mistakes with APK files

  • Shipping a debug-signed APK. Debug keys are not accepted for store releases and cannot be trusted for updates.
  • Forgetting to raise versionCode. An update with the same or a lower version code is rejected by the device.
  • Bundling every native architecture. A universal APK can be several times larger than necessary.
  • Installing APKs from unknown websites. Repackaged APKs are a common way to spread mobile malware.

Release teams also benefit from inspecting the final APK with tools such as the APK Analyzer, which shows which resources, libraries and code contribute most to download size.

The idea in brief

An APK is the file that holds an Android app, much like a setup file on a computer. It packs the app’s code, pictures and settings into one box. It also carries a seal that shows who made it.

When you install an app from a store, an APK is delivered behind the scenes. You can also install one by hand. Only do that from sources you trust, because a fake APK can contain harmful software.

A practical scenario

A logistics firm builds an internal scanning app for warehouse handhelds that run Android without Google services. The release pipeline produces a signed release APK for the arm64-v8a architecture, and the firm’s MDM pushes it to 600 devices overnight.

When a later version fails to install, the logs show that the developers had forgotten to increase versionCode. After fixing it, the update installs silently. The team also stores the signing key in a hardware security module, because losing it would make every future update impossible to install over the existing app.