@expo/repack-app
v0.10.4
Published
Repacking tool for Expo apps
Maintainers
Keywords
Readme
@expo/repack-app
Repacking tool for Expo apps
API Documentation
CLI Usage
repack-app [options] [project-root]Options
-p, --platform <platform>(required): Platform to repack the app for (androidorios)--source-app <path>(required): Path to the source app file (APK/AAB for Android, IPA for iOS)--android-build-tools-dir <path>: Path to the Android build tools directory-w, --working-directory <path>: Path to the working directory-o, --output <path>: Path to the output artifact-v, --verbose: Enable verbose logging
Android-specific Options
--ks <path>: Path to the keystore file--ks-pass <password>: Keystore password (supported formats:pass:<password>,env:<name>,file:<file>)--ks-key-alias <alias>: Keystore key alias--ks-key-pass <password>: Keystore key password (supported formats:pass:<password>,env:<name>,file:<file>)
iOS-specific Options
--signing-identity <identity>: Code signing identity (fastlane backend, macOS only)--provisioning-profile <path>: Path to the provisioning profile file(s)--certificate <path>: Path to a.p12signing identity. Signs with zsign instead of fastlane, in-process through WASM — no Xcode or keychain required, so it also works on Linux--key-password <password>: Password for the.p12signing identity
Bundle Options
--embed-bundle-assets: Force embedding of bundle assets--bundle-assets-sourcemap-output <path>: Generate sourcemap at the specified path (used with --embed-bundle-assets)
Programmatic Usage
import { repackAppAndroidAsync, repackAppIosAsync } from '@expo/repack-app';
// For Android
await repackAppAndroidAsync({
platform: 'android',
projectRoot: '/path/to/project',
sourceAppPath: '/path/to/source.apk',
// Optional configurations
workingDirectory: '/path/to/working/dir',
outputPath: '/path/to/output.apk',
verbose: true,
androidSigningOptions: {
keyStorePath: '/path/to/keystore.jks',
keyStorePassword: 'pass:password', // or 'env:KEYSTORE_PASS' or 'file:/path/to/pass'
keyAlias: 'alias',
keyPassword: 'pass:key-password', // or 'env:KEY_PASS' or 'file:/path/to/key-pass'
},
androidBuildToolsDir: '/path/to/build-tools',
exportEmbedOptions: {
sourcemapOutput: '/path/to/sourcemap',
},
env: {
// Additional environment variables
},
});
// For iOS
await repackAppIosAsync({
platform: 'ios',
projectRoot: '/path/to/project',
sourceAppPath: '/path/to/source.ipa',
// Optional configurations
workingDirectory: '/path/to/working/dir',
outputPath: '/path/to/output.ipa',
verbose: true,
// Sign with fastlane and a macOS keychain identity (requires Xcode)
iosSigningOptions: {
signingIdentity: 'Apple Development: Name (Team ID)',
provisioningProfile: '/path/to/profile.mobileprovision',
keychainPath: '/path/to/keychain', // Optional
},
// ...or with zsign and a .p12, which needs no Xcode and runs on Linux:
// iosSigningOptions: {
// backend: 'zsign',
// certificatePath: '/path/to/identity.p12',
// keyPassword: 'p12-password',
// provisioningProfile: '/path/to/profile.mobileprovision',
// },
exportEmbedOptions: {
sourcemapOutput: '/path/to/sourcemap',
},
env: {
// Additional environment variables
},
});Configuration Options
The following options are available when using the API programmatically:
Common Options
platform: 'android' | 'ios' - The platform to repack the app forprojectRoot: string - Path to the project root directorysourceAppPath: string - Path to the prebuilt app file (APK/AAB/IPA)workingDirectory?: string - Working directory for temporary filesoutputPath?: string - Path to the output app file (defaults toprojectRoot/repacked.apkorprojectRoot/repacked.ipa)verbose?: boolean - Enable verbose loggingexportEmbedOptions?: ExportEmbedOptions - Options for embedding JS bundle. When specified, repack will generate bundle assets.skipWorkingDirCleanup?: boolean - Skip working directory cleanupenv?: Record<string, string | undefined> - Environment variables
Android-specific Options
androidSigningOptions?: AndroidSigningOptions - Options for signing the Android appkeyStorePath: string - Path to the keystore filekeyStorePassword: string - Keystore password (supported formats:pass:<password>,env:<name>,file:<file>)keyAlias?: string - Keystore key aliaskeyPassword?: string - Keystore key password (supported formats:pass:<password>,env:<name>,file:<file>)
androidBuildToolsDir?: string - Path to Android SDK build-tools directory- When
sourceAppPathis an.aab, repack usesbundletoolfrom PATH to convert it into a universal APK first and still outputs an APK.
iOS-specific Options
iosSigningOptions?: IosSigningOptions - Options for signing the iOS app. A union discriminated bybackend:backend: 'fastlane'(the default) signs with fastlane'sresignaction and a macOS keychain identity, so it requires Xcode:signingIdentity: string - Code signing identityprovisioningProfile: string | Record<string, string> - Path to provisioning profile file(s)keychainPath?: string - Path to the keychain file for codesign
backend: 'zsign'signs with zsign in-process through zsign-wasm. No Xcode, keychain, or external binary, so it also works on Linux:certificatePath: string - Path to a.p12signing identity, as exported from Keychain Access or downloaded from the Apple Developer portal. It holds the private key together with the certificate chain, including the Apple WWDR intermediate that iOS requires at install timekeyPassword?: string - Password protecting the.p12provisioningProfile: string | Record<string, string> - Path to provisioning profile file(s)
Environment Variables
ANDROID_SDK_ROOT: Path to the Android SDK root directory (required for Android builds)bundletool: Required on PATH for Android.aabinputsUNSTABLE_REPACK_APP_ICON: Set to1ortrueto enable experimental app icon repacking
TV apps
App icon repacking supports Apple TV and Android TV. Repack detects a TV app from the source
artifact — UIDeviceFamily in the iOS Info.plist, and the leanback launcher entries in
AndroidManifest.xml — so there is no extra option to set. When the source app is a TV app,
repack also runs its internal expo prebuild with EXPO_TV=1.
Repack does not generate TV images. It reuses what expo prebuild writes, so the icon comes from
the @react-native-tvos/config-tv plugin options:
- Apple TV:
appleTVImages, which needs all seven images. Without it the asset catalog has no.brandassets, and repack keeps the source icon and logs a warning. - Android TV:
androidTVBannerandandroidTVIcon.
