Documentation
¶
Overview ¶
Package apkbuild provides functionality for building signed Android APKs from Go packages using the Android SDK/NDK toolchain.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
Build produces a signed APK from a Go package.
The pipeline mirrors what the Makefile does:
- Cross-compile Go → .so (go build -buildmode=c-shared)
- Package with aapt (aapt package -f -M manifest -I platform.jar -F base.apk)
- Add native libs (cd buildDir && zip -r base.apk lib/)
- Align (zipalign -f -p 4)
- Sign (apksigner sign --ks keystore)
Types ¶
type Config ¶
type Config struct {
// GoPackage is the Go package to build (e.g., "./examples/camera/display").
GoPackage string
// OutputPath is the output APK file path.
OutputPath string
// ManifestPath is the path to AndroidManifest.xml.
ManifestPath string
// Architectures to build for (e.g., ["arm64", "x86_64"]).
Architectures []string
// APILevel is the Android API level (e.g., 35).
APILevel int
// KeystorePath is the path to the signing keystore.
KeystorePath string
// KeystorePass is the keystore password.
KeystorePass string
// LibName is the name for the shared library (without lib prefix and .so suffix).
LibName string
// AndroidHome is the path to the Android SDK (default: $ANDROID_HOME or ~/Android/Sdk).
AndroidHome string
// NDKPath is the path to the Android NDK (default: latest in AndroidHome/ndk/).
NDKPath string
}
Config holds the configuration for building an APK.
Click to show internal directories.
Click to hide internal directories.