Firebase Performance Monitoring is a free mobile app performance analytics service that helps you to gain insight into the performance characteristics of your app.
For more information about app performance and many other cool mobile services, check out Firebase.
Follow the instruction in the Root README to clone the repository.
Add the following lines to your ~/.bash_profile
:
For Mac:
export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_SDK_ROOT=~/Library/Android/sdk
For Linux:
export ANDROID_HOME=~/Android/Sdk
export ANDROID_SDK_ROOT=~/Android/Sdk
firebase-android-sdk$ git fetch origin main:main
firebase-android-sdk$ git checkout main
Build the SDK in firebase-android-sdk
folder:
firebase-android-sdk$ ./gradlew :clean :firebase-perf:build --stacktrace
Please note that :clean
and --stacktrace
are optional. The build output will be generated in
firebase-android-sdk/firebase-perf/build/outputs/aar
.
firebase-android-sdk$ ./gradlew :clean :firebase-perf:test --stacktrace
firebase-android-sdk$ ./gradlew :clean :firebase-perf:testDebugUnitTest --tests "PackageName.ClassName.TestMethodName" --stacktrace
TestMethodName
is optional, if not provided, all tests underPackageName.ClassName
will be run. Similar mechanism applies toClassName
as well.
Follow the instructions here for the initial one time setup.
firebase-android-sdk$ ./gradlew :firebase-perf:connectedCheck
firebase-android-sdk$ ./gradlew :firebase-perf:deviceCheck
Change the version field in gradle.properties
to reflect the RC status:
version=20.4.1-SNAPSHOT
And then generate the library with required libraries:
# firebase-perf requires firebase-sessions
./gradlew -PprojectsToPublish="firebase-perf,firebase-sessions" firebasePublish
This will generate various files in the root build directory that align with the release candidates.
Alternatively, you can just build the repository in isolation:
# firebase-perf requires firebase-sessions
./gradlew -PprojectsToPublish="firebase-perf,firebase-sessions" buildMavenZip
You can publish the project directly to your local maven repository like so:
# firebase-perf requires firebase-sessions
./gradlew -PprojectsToPublish="firebase-perf,firebase-sessions" \
publishReleasingLibrariesToMavenLocal
Add mavenLocal() to your project-level build.gradle
file
buildscript {
repositories {
mavenLocal()
google()
jcenter()
}
dependencies {
. . .
# Adds several features that are specific to building Android apps
classpath 'com.android.tools.build:gradle:<agp-version>'
# Required for loading the 'google-services.json' file
classpath 'com.google.gms:google-services:<google-services-plugin-version>'
# Specify the version of 'perf-plugin'
classpath 'com.google.firebase:perf-plugin:<perf-plugin-version>'
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
}
}
Add implementation dependency to your module-level build.gradle
file
apply plugin: 'com.android.application'
# Applies the 'perf-plugin'
apply plugin: 'com.google.firebase.firebase-perf'
. . .
dependencies {
implementation 'com.google.firebase:firebase-perf:x.y.z-SNAPSHOT'
}
where the version number can be found in ~/.m2/repository/com/google/firebase/firebase-perf/maven-metadata-local.xml
.
See Reference for detail.
Generate code coverage:
firebase-android-sdk$ ./gradlew firebase-perf:checkCoverage --stacktrace
Open the report in:
firebase-android-sdk$ open firebase-perf/build/reports/jacoco/firebase-perf/html/com.google.firebase.perf/index.html
Checkout internal release guidelines at go/fireperf-android.