在目录:/packages/app/Contact/test/中,构建和我得到了ContactsTest.apk
将ContactsTest.apk安装到设备上。
执行以下命令:
adb shell am instrument -e class com.android.contacts.activities.OnStarContactEditorActivityTest#testInitial -w com.android.contacts.tests/android.test.InstrumentationTestRunner它抛出异常:
INSTRUMENTATION_RESULT:longMsg=java.lang.illegalArgumentException:未知操作字符串android.intnet.action.MAIN.只支持com.gm.contacts.action.EDIT_CONTACT..............
发布于 2016-03-25 02:58:20
我不知道为什么会出现异常,但可以按以下方式修正:添加Intent("com.gm.contacts.action.CREATE_CONTACT"));(在getActivity()之前添加新的getActivity)。
https://stackoverflow.com/questions/36194992
复制相似问题