How to start Instrumentation project programmatically using Android Intent?

后端 未结 2 1289
青春惊慌失措
青春惊慌失措 2021-01-01 02:52

one way to start testcase is,

adb shell am instrument 
  -w com.google.vishal.test/android.test.InstrumentationTestRunner 

i want to start

2条回答
  •  独厮守ぢ
    2021-01-01 03:19

    This is actually not possible to do, the reason being is that to run instrumentation you need to it via ADB, adb has certain special privileges because of security and therefore can not be run on the phone (As with anything open source, it is of course possible but you would have to rewrite some android and then it would only work on phones you installed that on!).

    May I ask your reason for doing this? If you really need to automate across applications your better choice might be to either us the new android ui test framework or to test only on the emulator and use something that runs on top of the view hierarchy because trying what you are currently is a dead end.

提交回复
热议问题