sign_apk
Align and sign a rebuilt APK with a debug key for local installation and testing; uninstall the original app first, and do not use the signed result for distribution.
Instructions
Align and sign an APK so it can be installed - typically the rebuilt APK from build_apk. It signs with a debug key generated on first use and kept in the Gateway's data directory, so the signature differs from the original app's: to install over the original you must uninstall it first, and the result is not suitable for distribution. It uses the Android SDK's apksigner and zipalign when present (and verifies the signature afterwards), or Termux's lightweight apksigner. Writes to the workspace's apksigner/signed/ folder and returns { outputPath, apkPath, signed, flavor, aligned?, schemes?, warnings? }; pass apkPath to adb_install. Only use it on apps you own or are authorized to modify.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flavor | No | Which apksigner this is: sdk for the Android SDK's, lite for Termux's lightweight one. Normally omit it - it is detected. | |
| apkPath | Yes | Absolute path to the .apk to sign, e.g. the outputPath returned by build_apk. | |
| workspace | No | Workspace name (not id). Created if it doesn't exist, and this call is recorded as a job in its history. Defaults to "default". | |
| outputName | No | Output file name only, not a path (no "/" or ".."). Defaults to the input name with "-signed" added. |