If your build system is Ant-based and you want to build Android apps with the AppDynamics SDK< you must:
Note: The Android SDK does not support IBM Worklight or other frameworks that do not use the
build.xmlfile defined in Android projects.
libs directory in your application root directory. libs directory might be located here: ProjectName/Application/libsADEumAgent.jar to the libs directory.ADEumInjector.jar to your application root directory.The steps to adding or editing a post-compile target depend on your project's existing structure:
custom_rules.xml with "-post-compile" target, append provided text t...custom_rules.xml file?If your project doesn't have a custom_rules.xml:
custom_rules.xml.Copy and paste the following into that file.
<project>
<target name="-post-compile">
<taskdef name="injector"
classname="com.appdynamics.android.ant.EUMAgentInjectorTask"
classpath="ADEUMInjector.jar"/>
<injector classfilespath="${out.classes.absolute.dir}"
outputlocation="${out.absolute.dir}/instrumented-jars/"
instrumentationjarlocation="${jar.libs.absolute.dir}/ADEUMAgent.jar"
jarfilesrefid="project.all.jars.path"
androidjarlocation="${project.target.android.jar}"/>
</target>
</project>
custom_rules.xml file doesn't contain a "-post-compile" target?If there is an existing custom_rules.xml file in your project but it does not contain a "-post-compile" target:
custom_rules.xml file, add the following text to the end of it's existing <project> element:<target name="-post-compile">
<taskdef name="injector"
classname="com.appdynamics.android.ant.EUMAgentInjectorTask"
classpath="ADEUMInjector.jar"/>
<injector classfilespath="${out.classes.absolute.dir}"
outputlocation="${out.absolute.dir}/instrumented-jars/"
instrumentationjarlocation="${jar.libs.absolute.dir}/ADEUMAgent.jar"
jarfilesrefid="project.all.jars.path"
androidjarlocation="${project.target.android.jar}"/>
</target>custom_rules.xml file already contains a -post.compile target:If there is an existing custom_rules.xml file in your project and it already contains a -post-compile target:
<target> element:<taskdef name="injector"
classname="com.appdynamics.android.ant.EUMAgentInjectorTask"
classpath="ADEUMInjector.jar"/>
<injector classfilespath="${out.classes.absolute.dir}"
outputlocation="${out.absolute.dir}/instrumented-jars/"
instrumentationjarlocation="${jar.libs.absolute.dir}/ADEUMAgent.jar"
jarfilesrefid="project.all.jars.path"
androidjarlocation="${project.target.android.jar}"
/>If you're using Eclipse and Ant, do not include android.jar in the list of jar files provided as "jarfilesrefid" to your injector task—for example, if your build.xml looks something like this:
<taskdef name="injector"
classname="com.appdynamics.android.ant.EUMAgentInjectorTask"
classpath="ADEUMInjector.jar"/>
<injector classfilespath="${out.classes.absolute.dir}"
outputlocation="${out.absolute.dir}/instrumented-jars/"
instrumentationjarlocation="${jar.libs.absolute.dir}/ADEUMAgent.jar"
jarfilesrefid="project.all.jars.path"
androidjarlocation="${project.target.android.jar}"/>
Make sure that
android.jaris not included in the list of files specified by therefid"project.all.jars.path". Otherwise, the injector will fail to instrument your build properly.