admin管理员组

文章数量:1642331

I made my test-runner inherit from InstrumentationTestRunner and took the extra data in onCreate():


public class DepponTestRunner extends InstrumentationTestRunner {


    public static String BAR;


    public void onCreate(Bundle arguments) {


        if (null != arguments) {    
            BAR = (String) arguments.get("foo"));
        }    
        super.onCreate(arguments);
    }
}


I added to Android.mk:


LOCAL_JAVA_LIBRARIES := android.test.runner
And to AndroidManifest.xml:


<instrumentation 
    android:name="com.example.MyTestRunner"
    android:targetPackage="com.example" />
Ran it using this command line:


      adb shell am instrument -e class test类全名\#方法名 -e foo june123456789asdfghjklqwertyuiopzxcvbnm -e bert june123 -w com.deppon.app.june.test/deppon.util.DepponTestRunner

本文标签: TestfunctiondeliverparametersShell