@Mojo(name="run") public class RunMojo extends AbstractAndroidMojo
Android provides a component-based architecture, which means that there is no "main" function which serves as an entry point to the APK. There's an homogeneous collection of Activity(es), Service(s), Receiver(s), etc.
The Android top-level launcher (whose purpose is to allow users to launch other applications) uses the Intent resolution mechanism to determine which Activity(es) to show to the end user. Such activities are identified by at least:
android.intent.action.MAIN
android.intent.category.LAUNCHER
And are declared in AndroidManifest.xml
as such:
<activity android:name=".ExampleActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
This Mojo
will try to to launch the first activity of this kind found in AndroidManifest.xml
. In
case multiple activities satisfy the requirements listed above only the first declared one is run. In case there are
no "Launcher activities" declared in the manifest or no activities declared at all, this goal aborts throwing an
error.
The device parameter is taken into consideration so potentially the Activity found is started on all attached devices. The application will NOT be deployed and running will silently fail if the application is not deployed.
Modifier and Type | Field and Description |
---|---|
protected String |
runDebug
Debug parameter for the the run goal.
|
aaptExtraArgs, aaptVerbose, adbConnectionTimeout, androidManifestFile, assetsDirectory, attachJar, attachSources, combinedAssets, configurations, customPackage, dependencyGraphBuilder, destinationManifestFile, device, devices, deviceThreads, ENV_ANDROID_HOME, ENV_ANDROID_NDK_HOME, execution, extractedDependenciesDirectory, extractedDependenciesJavaResources, extractedDependenciesJavaSources, finalName, genDirectory, generateApk, ips, nativeLibrariesDirectory, ndkOutputDirectory, proguardFile, project, projectHelper, projectOutputDirectory, release, renameManifestPackage, resourceDirectory, resourceOverlayDirectories, resourceOverlayDirectory, resources, session, sourceDirectory, sourceEncoding, SUPPORTED_PACKAGING_TYPES, targetDirectory, undeployBeforeDeploy
Constructor and Description |
---|
RunMojo() |
Modifier and Type | Method and Description |
---|---|
void |
execute() |
copyFolder, deployApk, deployBuiltApk, deployDependencies, doWithDevices, extractInstrumentationRunnerFromAndroidManifest, extractPackageNameFromAndroidArtifact, extractPackageNameFromAndroidManifest, extractPackageNameFromAndroidManifestXmlTree, extractPackageNameFromApk, getAndroidManifestPackageName, getAndroidNdk, getAndroidSdk, getArtifactResolverHelper, getDependencyResolver, getDirectDependencyArtifacts, getJack, getLibraryUnpackDirectory, getNativeHelper, getRelevantCompileArtifacts, getResourceOverlayDirectories, getTransitiveDependencyArtifacts, getTransitiveDependencyArtifacts, getUnpackedAarClassesJar, getUnpackedApkLibSourceFolder, getUnpackedLibAssetsFolder, getUnpackedLibFolder, getUnpackedLibHelper, getUnpackedLibNativesFolder, getUnpackedLibResourceFolder, getUnpackedLibsDirectory, initAndroidDebugBridge, isAPKBuild, isInstrumentationTest, resolveArtifactToFile, undeployApk, undeployApk, waitForInitialDeviceList
@Parameter(property="android.run.debug") protected String runDebug
Copyright © 2008–2019 simpligility technologies inc.. All rights reserved.