Free APK test files and sample generator

The package format Android installs apps from: a ZIP holding a manifest, compiled resources and code. Generate valid .apk sample files to test upload handlers, app stores and mobile device management.

Generate a .apk file →

What is a .apk file?

APK: Android Application Package. An APK is how Android installs an app: a ZIP holding a manifest, compiled resources and Dalvik bytecode. The detail that catches people out is that AndroidManifest.xml inside an APK is not text. It is Android's binary XML, a chunked format built around a string pool that every element and attribute indexes into, with each android: attribute identified by a numeric resource id rather than its name. A tool that expects to read the manifest with an XML parser gets nothing useful, which is exactly the kind of assumption worth testing.

Why generate a test APK file?

How a .apk file is identified

Every .apk file begins with 50 4B 03 04, the ASCII letters "PK", the initials of Phil Katz, who created the ZIP format. That is what a validator inspecting content rather than the file name looks for.

How the size lands on the exact byte

The package is a ZIP, so the padding is trailing whitespace inside one of the XML parts it already contains. Extractors and Office readers both ignore it, so the document opens unchanged.

Negative testing with broken APK files

Which failure to reach for, and what to assert for each, is covered in how to make a corrupted file for testing. For upload limits and type checks see testing file upload validation.

Sample APK content

[Android package], ZIP with AndroidManifest.xml, classes.dex and META-INF.

This shows the shape of the file. Your download is generated fresh at the size you choose, so the values will differ.

How to open and verify the file

Inspect it with `unzip -l file.apk`, or read the manifest properly with `aapt dump badging file.apk`. Files here carry a genuine binary AndroidManifest.xml (package, versionCode, minSdkVersion and targetSdkVersion all encoded), a classes.dex whose Adler-32 checksum and SHA-1 signature are computed rather than zeroed, and a valid resource table. They are deliberately NOT signed and contain no working code, so they will not install on a device. They are for testing the upload, detection and extraction stages, which is where most failures happen.

Media type application/vnd.android.package-archive · extension .apk · category Scripts & OS

Generate a .apk file → · questions about sizes, privacy or cost are answered on the site FAQ.

Frequently asked questions about APK files

What identifies a .apk file?

A .apk file begins with the bytes 50 4B 03 04, the ASCII letters "PK", the initials of Phil Katz, who created the ZIP format. Those bytes are what a content-sniffing validator looks for, and what the Corrupted condition destroys.

How can a .apk file be an exact number of bytes?

The package is a ZIP, so the padding is trailing whitespace inside one of the XML parts it already contains. Extractors and Office readers both ignore it, so the document opens unchanged.

Can I download several broken APK files at once?

Yes, select more than one File Condition and you get one ZIP containing a .apk per condition, each named after its condition.

Can the APK file use UTF-16 or a byte-order mark?

No, and deliberately. A .apk file is a container rather than plain text, so rewriting its bytes as UTF-16 would not produce a UTF-16 document. It would produce a broken file. Use a text format such as CSV, JSON or XML for encoding tests.

How do I open or verify the APK file?

Inspect it with unzip -l file.apk, or read the manifest properly with aapt dump badging file.apk. Files here carry a genuine binary AndroidManifest.xml (package, versionCode, minSdkVersion and targetSdkVersion all encoded), a classes.dex whose Adler-32 checksum and SHA-1 signature are computed rather than zeroed, and a valid resource table. They are deliberately NOT signed and contain no working code, so they will not install on a device. They are for testing the upload, detection and extraction stages, which is where most failures happen.

Related Scripts & OS formats

SH · BAT · PS1 · VBS · DEB · RPM · PKG · AAB

Browse all file formats →