PatchAndroidCommand class

Command for creating patches for Android applications through Shorebird.

This command creates a Shorebird patch for Android applications, allowing for over-the-air updates to be deployed to existing Android app installations without requiring a full app update through the app store.

Usage

morpheme shorebird patch android --flavor dev
morpheme shorebird patch android --flavor prod --build-number 123

Options

All standard Shorebird options are supported:

  • --flavor: The build flavor (dev, staging, prod)
  • --target: The main entry point file
  • --morpheme-yaml: Path to morpheme.yaml configuration
  • --build-number: Build number for targeting specific release
  • --build-name: Build name for targeting specific release
  • --obfuscate: Enable code obfuscation (must match original release)
  • --split-debug-info: Path for split debug information
  • --generate-l10n: Generate localization files

Patch Targeting

Patches are applied to specific releases. You can target a release by:

  • Specifying build number and build name
  • Using the release version string format

Examples

Create a patch for the current development version:

morpheme shorebird patch android --flavor dev

Create a patch targeting a specific production release:

morpheme shorebird patch android --flavor prod --build-number 42 --build-name 1.2.0

Create a patch with obfuscation (matching original release):

morpheme shorebird patch android --flavor prod --obfuscate

Important Notes

  • The patch must be compatible with the target release
  • Obfuscation settings should match the original release
  • Dart defines and environment must match the target release
  • Some code changes may not be patchable and require a full release
Inheritance

Constructors

PatchAndroidCommand()

Properties

aliases → List<String>
Alternate names for this command.
no setterinherited
argParser → ArgParser
The argument parser for this command.
no setterinherited
argResults → ArgResults?
The parsed argument results for this command.
no setterinherited
category → String
The command's category.
no setterinherited
description → String
A description of this command, included in usage.
no setteroverride
globalResults → ArgResults?
The parsed global argument results.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
hidden → bool
Whether or not this command should be hidden from help listings.
no setterinherited
invocation → String
A single-line template for how to invoke this command (e.g. "pub get package").
no setterinherited
isAndroid → bool
Whether this is an Android patch command.
no setterinherited
isIos → bool
Whether this is an iOS patch command.
no setterinherited
name → String
The name of this command.
no setteroverride
parent → Command?
The command's parent command, if this is a subcommand.
no setterinherited
platformType → String
The platform type for this patch command (android, ios).
no setteroverride
runner → CommandRunner?
The command runner for this command.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
subcommands → Map<String, Command>
An unmodifiable view of all sublevel commands of this command.
no setterinherited
suggestionAliases → List<String>
Alternate non-functional names for this command.
no setterinherited
summary → String
A short description of this command, included in parent's CommandRunner.usage.
no setterinherited
takesArguments → bool
Whether or not this command takes positional arguments in addition to options.
no setterinherited
usage → String
Generates a string displaying usage information for this command.
no setterinherited
usageFooter → String?
An optional footer for usage.
no setterinherited

Methods

addPlatformSpecificOptions(ArgParser argParser) → void
Adds platform-specific options.
inherited
addStandardOptions(ArgParser argParser) → void
Adds standard options that are common to all Shorebird commands.
inherited
addSubcommand(Command command) → void
Adds Command as a subcommand of this.
inherited
buildDartDefines(Map<String, String> flavorConfig) → List<String>
Builds dart defines list from flavor configuration.
inherited
buildEnvironmentVariables(Map<String, String> flavorConfig) → Map<String, String>
Builds environment variables map for command execution.
inherited
executeCommand(ShorebirdCommandConfig config) → Future<ShorebirdResult>
Executes the actual Shorebird command.
inherited
extractCommonArguments() → Map<String, dynamic>
Extracts common arguments from command line results.
inherited
handleError(dynamic error, Duration duration) → void
Handles command execution errors.
inherited
handleSuccess(ShorebirdResult result, Duration duration) → void
Handles successful command execution.
inherited
logCommand(String command) → void
Logs the command that is about to be executed.
inherited
logCommandComplete(String commandName, Duration duration) → void
Logs the completion of a command execution.
inherited
logCommandStart(String commandName, String flavor) → void
Logs the start of a command execution.
inherited
logDebug(String message) → void
Logs debug information (only when debug mode is enabled).
inherited
logError(String message) → void
Logs an error message.
inherited
logInfo(String message, {String prefix = 'Info'}) → void
Logs an informational message.
inherited
logSetup(String component) → void
Logs a setup step.
inherited
logStep(String step) → void
Logs a step in the execution process.
inherited
logSuccess(String message) → void
Logs a success message.
inherited
logValidation(String item) → void
Logs a validation step.
inherited
logWarning(String message) → void
Logs a warning message.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postExecutionCleanup(ShorebirdResult result) → Future<void>
Performs post-execution cleanup tasks.
inherited
preExecutionSetup(ShorebirdCommandConfig config) → Future<void>
Performs pre-execution setup tasks.
inherited
printUsage() → void
Prints the usage information for this command.
inherited
run() → Future<void>
Template method defining the command execution workflow.
inherited
toString() → String
A string representation of this object.
inherited
usageException(String message) → Never
Throws a UsageException with message.
inherited
validateAndBuildConfig() → Future<ShorebirdCommandConfig>
Validates command arguments and builds the command configuration.
inherited
validateAndGetFlavor(ArgResults? argResults, {String defaultTo = Constants.dev}) → String
Validates and extracts the flavor value from command arguments.
inherited
validateAndGetFlavorConfig(String flavor, String morphemeYamlPath) → Map<String, String>
Validates that a flavor exists in the configuration.
inherited
validateBuildNumber(String? buildNumber) → void
Validates build number format.
inherited
validateExportMethod(String? exportMethod) → void
Validates export method for iOS builds.
inherited
validateExportOptionsPlist(String? exportOptionsPlist) → void
Validates that export options plist file exists (if specified).
inherited
validateMorphemeYaml(String morphemeYamlPath) → void
Validates the morpheme.yaml configuration file.
inherited
validateRequiredArguments(ArgResults? argResults) → bool
Validates that all required arguments are present and valid.
inherited
validateShorebirdConfig(String flavor, String morphemeYamlPath) → (String?, Map?)
Validates that Shorebird configuration exists for the flavor.
inherited
validateTarget(String target) → void
Validates that a target file exists and is accessible.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited