Unfortunately it does not has good integration with Android Studio, which reduces the among of users. In this tutorial I am going to show how to do it on more manual way, with a simple project.
1. Add the AspectJ plugin
1.1 Go to the main build.gradle file and add the follow one, inside the dependencies, like this.
1.2 In the build.gradle file of the module "app" add the follow line at the top, like this:
apply plugin: 'android-aspectj'
2. Add Monkey talk library
2.1 Download the latest version of MonkeyTalk Agent from their web page. It is contained inside the IDEs.
2.2 Inside of the module app, create a new folder called monkey-libs and paste the Monkey Talk jar library inside.
2.3 Open the build.gradle file of the app and paste the follow lines.
2.3.1 Paste the follow code inside of the buildTypes:
2.3.2 Paste the follow code inside of the dependencies:
monkeytalkCompile fileTree(dir: 'monkey-libs', include: ['*.jar'])
Here is the example:
3. Include the permissions
Just in case you have not added them, add the required permissions to the Manifest file.
3.1 Open the Android Manifest file.
3.2 Copy the follow line into the manifest file. This will adds the Get task and internet permissions.
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_TASKS" />
4. Run the app
4.1 To run the app, open the Terminal or the console and type the follow:
./gradlew clean installMonkeytalk
This command will compile the app and install it into the existence device connected.
Note1: The method above does not works with the version 1.1.0 of the android gradle tool, but the version 1.0.0.
Note2: I have tested the method above with simple projects but with big projects actually it fails. So, good luck!