Download PDF
Download page マッピングファイルの自動アップロード.
マッピングファイルの自動アップロード
各ビルドでクラッシュレポートの ProGuard または DexGuard マッピングファイルを自動的にアップロードできるように、EUM アカウント情報を追加するビルドを設定できます。
これは、これらのタイプのマッピングファイルを管理するために推奨される方法ですが、マッピングファイルのアップロードでは手動モードも使用できます。ProGuard または DexGuard を使用してファイルを難読化しない場合は、このセクションを無視できます。「難読化とクラスの削除を防止するための ProGuard の設定」を参照してください。
DexGuard の制限
DexGuard マッピングファイルは、デフォルトの場所に配置する必要があります。つまり、DexGuard 設定で --printMapping
を指定しないでください。これにより、マッピングファイルの出力先が変更されます。
SaaS EUM サーバへのアップロード
SaaS EUM サーバーを使用している場合は、次のようにアカウント名とライセンスキーを入力して、アップロードを自動化します。
マッピングファイルを自動的にアップロードするには、コードで適切な URL を指定します。
SaaS の場合、次の条件を満たす場合は、リージョンのエンドポイントを設定します。
- ProGuard/Dexguard マッピングファイルまたは NDK シンボルファイルは、ビルドプロセス中にアプリケーションサーバーに自動的にアップロードされます。
- リージョンのエンドポイントは、https://api.eum-appdynamics.com(デフォルト値)とは異なります。
必要なリージョンの EUM API URL を [Cisco AppDynamics SaaS Domains and IP Ranges] で検索します。
- オンプレミス EUM サーバーの場合は、
ON_PREM_COLLECTOR_URL.
を指定します。
adeum {
url SaaS_EUM_API_URL/ ON_PREM_COLLECTOR_URL
//For SaaS, set the region's endpoint if the ProGuard/Dexguard mapping files or NDK symbol files are automatically uploading to the application server during the build process and region's endpoint is different from https://api.eum-appdynamics.com (default value). Find the EUM API URLs for the required region from https://docs.appdynamics.com/paa/saas-domains-and-ip-ranges.
// For on-prem it is the public collector URL.
account {
licenseKey EUM_LICENSE_KEY name EUM_ACCOUNT_NAME
} symbolMappingFileUpload {
failBuildOnUploadFailure false
enabled true // This specifies whether the entire build should fail if mapping file upload fails. Enabled refers to whether auto-uploading of mapping file is enabled.
}
excludeClasses = ['android.support.multidex.*', 'okio.**'] // This specifies any classes customers would like to exclude from auto-instrumentation. The notation is standard java package/class specification used in Gradle.
enabledForDebugBuilds = true // Whether auto-instrumentation is enabled for debug builds, true by default.
enabledForReleaseBuilds = true // Whether auto-instrumentation is enabled for release builds, true by default.
webViewCallbackCrashReportingEnabled = false // Auto-instrumentation is enabled for WebChromeClient and WebViewClient
...
// This block specifies how to handle native crashes. By default, this is not enabled.
nativeCrashHandling {
if (BUILD_NDKLIB) {
enabled = true
symbolUpload {
variantLibraryPaths = ["appRelease": "ndkLib/obj/local"]
}
}
}
}
オンプレミス EUM サーバへのアップロード
オンプレミス展開を使用している場合は、アカウント名とライセンスの入力に加えて、次に示すように、オンプレミス EUM サーバへの URL を url
プロパティに割り当てる必要もあります。
adeum{
// The account information is also needed for on-prem deployments.
account {
name "The EUM Account Name from the License screen"
licenseKey "The EUM License Key from the License screen"
}
...
// Add this information to point to the on-prem EUM Server.
url "https://<your-on-prem-eum-server>:7001"
}
デフォルトのアップロード動作の変更
オンプレミスと SaaS の両方の展開でデフォルトのアップロード動作を変更することもできます。オンプレミス展開の場合、url
プロパティを使用してオンプレミス EUM サーバへの URL を指定する必要があります。
次の設定例では、url
によって指定された URL へのアップロードが不可能な場合、ビルドが失敗するように failBuildOnUploadFailure
を true
に設定しています。オブジェクト symbolMappingFileUpload
は、Proguard と DexGuard の両方のマッピングファイルで使用されます。ProGuard または DexGuard マッピングファイルをアップロードできなくても、ビルドが失敗しないようにするには、デフォルト設定を変更しないでください。
adeum{
...
// Add this information to point to the on-prem EUM Server.
url "https://<your-on-prem-eum-server>:7001"
// Add this information if you want to modify upload behavior. symbolMappingFileUpload {
failBuildOnUploadFailure true // If true, will fail build. Defaults to false.
enabled true //enables automatic uploads. Defaults to true
}
}
難読化とクラスの削除を防止するための ProGuard の設定
ProGuard を使用してコードを確認または最適化する場合は、[Gradle Scripts] で ProGuard 構成ファイル proguard-rules.pro
に次の行を追加します。適切なインストゥルメンテーションに必要なクラスを難読化または削除しないようにします。
-keep class com.appdynamics.eumagent.runtime.DontObfuscate
-keep @com.appdynamics.eumagent.runtime.DontObfuscate class * { *; }