--- title: "Installing on Android" layout: default permalink: /page_install_android.html ---

Dr. Memory

Installing on Android

Download the ``.tar.gz version of Dr. Memory for Android. Untar the package into a directory on your local machine:

    tar xzf DrMemory-ARM-Android-EABI-X.X.X-X.tar.gz

Now copy the entire unpacked directory to your Android device (typically using adb push). The bin/drmemory front-end can be invoked directly from the adb shell. Dr. Memory for Android is targeted toward native applications that use Android's NDK.

Dr. Memory requires a writable temporary directory. If neither /data/local/tmp nor the current working directory are writable, you will need to specify a writable directory via the `TMPDIR` environment variable. Configuration, symbol caching, and result log files will be placed at the specified location.

For Android Java applications on recent versions of Android, SELinux prevents writing to /data/local/tmp. The application's data directory should be pointed at in the `TMPDIR` environment variable, as shown below in the example wrapper script. SELinux also prevents executing from /data/local/tmp. For non-native applications, we recommend copying the Dr. Memory package into /system/xbin, though be sure to point `TMPDIR` to a location both allowed by SElinux and with more space (typically the application's own /data/data sub-directory: see the preparation instructions specific to Android).

If you run into problems with configuration files being created due to SELinux denials (look in the logs for such denials), it may be simplest to disable SELinux via setenforce 0. We have attempted to get everything to work without this step, but we are not able to test on all versions or configurations of Android.