Przypuszczam, że rozwiązałeś go od stycznia, ale pracuję z narzędziami wiersza poleceń, znalazłem podobny problem (komunikat o błędzie różni się t) i rozwiązał to tak, jak wyjaśnię w kolejnych krokach. Cały proces wykonuję od utworzenia projektu fikcyjnego z pustym testem do pomyślnego uruchomienia testu.Mam nadzieję, że może to być przydatne dla kogoś:
Pierwszy krok, utworzyć projekt:
android create project
--name MyExample
--target "Google Inc.:Google APIs:17"
--path MyExample
--package com.example
--activity MyExampleActivity
drugim etapie utworzyć projekt testowy:
android create test-project
--path MyExampleTest
--name MyExampleTest
--main ../MyExample
trzeci etap, dostęp do katalogu projektu, zbuduj go i sprawdź, czy proces zakończy się pomyślnie:
cd MyExample && ant debug
Czwarty krok, zainstalować ją na emulatorze:
adb -s emulator-5554 install -r bin/MyExample-debug.apk
Piąty krok, dostęp do katalogu projektu badawczego i spróbować uruchomić testy:
cd ../MyExampleTest &&
adb shell am instrument -w com.example.tests/android.test.InstrumentationTestRunner
Że wydajność:
INSTRUMENTATION_STATUS: id=ActivityManagerService
INSTRUMENTATION_STATUS: Error=Unable to find instrumentation info for: ComponentInfo{com.example.tests/android.test.InstrumentationTestRunner}
INSTRUMENTATION_STATUS_CODE: -1
android.util.AndroidException: INSTRUMENTATION_FAILED: com.example.tests/android.test.InstrumentationTestRunner
at com.android.commands.am.Am.runInstrument(Am.java:676)
at com.android.commands.am.Am.run(Am.java:119)
at com.android.commands.am.Am.main(Am.java:82)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:235)
at dalvik.system.NativeStart.main(Native Method)
Szósty krok, wymienić swoje clases oprzyrządowanie i upewnić się, że obecny projekt brakuje:
adb shell pm list instrumentation
że w moim wydajności maszyny:
instrumentation:com.android.emulator.connectivity.test/android.test.InstrumentationTestRunner (target=com.android.emulator.connectivity.test)
instrumentation:com.android.emulator.gps.test/android.test.InstrumentationTestRunner (target=com.android.emulator.gps.test)
instrumentation:com.android.example.spinner.tests/android.test.InstrumentationTestRunner (target=com.android.example.spinner)
instrumentation:com.android.smoketest.tests/com.android.smoketest.SmokeTestRunner (target=com.android.smoketest)
instrumentation:com.android.smoketest.tests/android.test.InstrumentationTestRunner (target=com.android.smoketest)
instrumentation:com.example.android.apis/.app.LocalSampleInstrumentation (target=com.example.android.apis)
Jak widać, oprzyrządowania dla com.example.tests
robi istnieje, więc będziemy musieli go stworzyć.
Siódmy krok, budować przetestować projekt i sprawdzić, że nie udało:
ant debug
ósmy etap, zainstalować ją na emulatorze:
adb -s emulator-5554 install -r bin/MyExampleTest-debug.apk
Dziewiąty etap, wymień swoje klasy instrumentacji i wyszukaj jeden z projektów:
adb shell pm list instrumentation
że plony:
instrumentation:com.android.emulator.connectivity.test/android.test.InstrumentationTestRunner (target=com.android.emulator.connectivity.test)
instrumentation:com.android.emulator.gps.test/android.test.InstrumentationTestRunner (target=com.android.emulator.gps.test)
instrumentation:com.android.example.spinner.tests/android.test.InstrumentationTestRunner (target=com.android.example.spinner)
instrumentation:com.android.smoketest.tests/com.android.smoketest.SmokeTestRunner (target=com.android.smoketest)
instrumentation:com.android.smoketest.tests/android.test.InstrumentationTestRunner (target=com.android.smoketest)
instrumentation:com.example.tests/android.test.InstrumentationTestRunner (target=com.example)
instrumentation:com.example.android.apis/.app.LocalSampleInstrumentation (target=com.example.android.apis)
Spójrz na przedostatnia, instrumentation:com.example.tests
, to który chcieliśmy.
Dziesiąty etap, uruchom testy:
adb shell am instrument -w com.example.tests/android.test.InstrumentationTestRunner
że plony:
Test results for InstrumentationTestRunner=
Time: 0.0
OK (0 tests)
to wszystko. Teraz zaimplementuj swoje testy, skompiluj i zainstaluj jak zwykle.Dodatkowo możesz je usunąć:
adb shell pm uninstall com.example.tests
Musisz jednak ponownie utworzyć klasy instrumentów, aby uniknąć tego samego błędu.
Dziękuję, dziękuję, dziękuję Birei! Akcja instalacji rozwiązała mój problem, ponieważ był to powód, dla którego otrzymywałem komunikat "Nie można znaleźć informacji o oprzyrządowaniu". – gsaslis
Sprawdziłem na swój sposób, ale nie działa on wcale. I jeszcze jedno W szóstym kroku mogę zobaczyć nazwę mojego projektu na liście instrumentów, ale kiedy próbuję uruchomić testy, daje to błąd podobny do opisanego powyżej. Proszę pomóż mi. –
czy zrobiłeś coś podobnego z gradle? – c3rin