diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml
index 6f50aab..472ee1c 100644
--- a/tests/AndroidManifest.xml
+++ b/tests/AndroidManifest.xml
@@ -98,14 +98,15 @@
         android:label="Contacts app tests">
     </instrumentation>
 
-    <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
-        android:targetPackage="com.android.contacts"
-        android:label="Contacts app tests">
-    </instrumentation>
-
     <instrumentation android:name="com.android.contacts.ContactsLaunchPerformance"
         android:targetPackage="com.android.contacts"
         android:label="Contacts launch performance">
     </instrumentation>
 
+    <instrumentation
+        android:name="com.android.contacts.RunMethodInstrumentation"
+        android:targetPackage="com.android.contacts"
+        android:label="Run Contacts Method">
+    </instrumentation>
+
 </manifest>
diff --git a/tests/src/com/android/contacts/RunMethodInstrumentation.java b/tests/src/com/android/contacts/RunMethodInstrumentation.java
new file mode 100644
index 0000000..77f36ed
--- /dev/null
+++ b/tests/src/com/android/contacts/RunMethodInstrumentation.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.contacts;
+
+import android.app.Activity;
+import android.app.Instrumentation;
+import android.content.Context;
+import android.os.Bundle;
+import android.support.test.InstrumentationRegistry;
+import android.util.Log;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+/**
+ * Runs a single static method specified via the arguments.
+ *
+ * Useful for manipulating the app state during manual testing.
+ *
+ * Valid signatures: void f(Context, Bundle), void f(Context), void f()
+ *
+ * Example usage:
+ * $ adb shell am instrument -e class com.android.contacts.Foo -e method bar -e someArg someValue\
+ *   -w com.google.android.contacts.tests/com.android.contacts.RunMethodInstrumentation
+ */
+public class RunMethodInstrumentation extends Instrumentation {
+
+    private static final String TAG = "RunMethod";
+
+    private String className;
+    private String methodName;
+    private Bundle args;
+
+    @Override
+    public void onCreate(Bundle arguments) {
+        super.onCreate(arguments);
+
+        InstrumentationRegistry.registerInstance(this, arguments);
+
+        className = arguments.getString("class");
+        methodName = arguments.getString("method");
+        args = arguments;
+
+        Log.d(TAG, "Running " + className + "." + methodName);
+        Log.d(TAG, "args=" + args);
+
+        start();
+    }
+
+    public void onStart() {
+        Log.d(TAG, "onStart");
+        super.onStart();
+
+        if (className == null || methodName == null) {
+            Log.e(TAG, "Must supply class and method");
+            finish(Activity.RESULT_CANCELED, null);
+            return;
+        }
+
+        try {
+            invokeMethod(args, className, methodName);
+        } catch (Exception e) {
+            e.printStackTrace();
+            finish(Activity.RESULT_CANCELED, null);
+            return;
+        }
+        // Maybe should let the method determine when this is called.
+        finish(Activity.RESULT_OK, null);
+    }
+
+    private void invokeMethod(Bundle args, String className, String methodName) throws
+            InvocationTargetException, IllegalAccessException, NoSuchMethodException,
+            ClassNotFoundException {
+        Context context;
+        Class<?> clazz = null;
+        try {
+            // Try to load from App's code
+            clazz = getTargetContext().getClassLoader().loadClass(className);
+            context = getTargetContext();
+        } catch (Exception e) {
+            // Try to load from Test App's code
+            clazz = getContext().getClassLoader().loadClass(className);
+            context = getContext();
+        }
+
+        Object[] methodArgs = null;
+        Method method = null;
+
+        try {
+            method = clazz.getMethod(methodName, Context.class, Bundle.class);
+            methodArgs = new Object[] { context, args };
+        } catch (NoSuchMethodException e) {
+        }
+
+        if (method != null) {
+            method.invoke(clazz, methodArgs);
+            return;
+        }
+
+        try {
+            method = clazz.getMethod(methodName, Context.class);
+            methodArgs = new Object[] { context };
+        } catch (NoSuchMethodException e) {
+        }
+
+        if (method != null) {
+            method.invoke(clazz, methodArgs);
+            return;
+        }
+
+        method = clazz.getMethod(methodName);
+        method.invoke(clazz);
+    }
+}
diff --git a/tests/src/com/android/contacts/tests/AccountsTestHelper.java b/tests/src/com/android/contacts/tests/AccountsTestHelper.java
index be826f7..11476b3 100644
--- a/tests/src/com/android/contacts/tests/AccountsTestHelper.java
+++ b/tests/src/com/android/contacts/tests/AccountsTestHelper.java
@@ -20,10 +20,12 @@
 import android.content.ContentResolver;
 import android.content.Context;
 import android.os.Build;
+import android.os.Bundle;
 import android.provider.ContactsContract.RawContacts;
 import android.support.annotation.NonNull;
 import android.support.annotation.RequiresApi;
 import android.support.test.InstrumentationRegistry;
+import android.util.Log;
 
 import com.android.contacts.common.model.account.AccountWithDataSet;
 
@@ -32,8 +34,12 @@
 
 @SuppressWarnings("MissingPermission")
 public class AccountsTestHelper {
+    private static final String TAG = "AccountsTestHelper";
+
     public static final String TEST_ACCOUNT_TYPE = "com.android.contacts.tests.testauth.basic";
 
+    public static final String EXTRA_ACCOUNT_NAME = "accountName";
+
     private final Context mContext;
     private final AccountManager mAccountManager;
     private final ContentResolver mResolver;
@@ -103,4 +109,32 @@
     private AccountWithDataSet convertTestAccount() {
         return new AccountWithDataSet(mTestAccount.name, mTestAccount.type, null);
     }
+
+    /**
+     * Invoke from adb using the RunMethodInstrumentation:
+     * $ adb shell am instrument -e class com.android.contacts.tests.AccountTestHelper\
+     *   -e method addTestAccount -e accountName fooAccount\
+     *   -w com.google.android.contacts.tests/com.android.contacts.RunMethodInstrumentation
+     */
+    public static void addTestAccount(Context context, Bundle args) {
+        final String accountName = args.getString(EXTRA_ACCOUNT_NAME);
+        if (accountName == null) {
+            Log.e(TAG, "args must contain extra " + EXTRA_ACCOUNT_NAME);
+            return;
+        }
+
+        new AccountsTestHelper(context).addTestAccount(accountName);
+    }
+
+    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP_MR1)
+    public static void removeTestAccount(Context context, Bundle args) {
+        final String accountName = args.getString(EXTRA_ACCOUNT_NAME);
+        if (accountName == null) {
+            Log.e(TAG, "args must contain extra " + EXTRA_ACCOUNT_NAME);
+            return;
+        }
+
+        AccountWithDataSet account = new AccountWithDataSet(accountName, TEST_ACCOUNT_TYPE, null);
+        new AccountsTestHelper(context).removeTestAccount(account);
+    }
 }
