java - How can i start the uiautomator in android code? -


i want start uiautomatortest program in android code. use:

runtime.getruntime().exec("uiautomator runtest autorunner.jar -c com.runner.autorunner"); 

i error:

java.lang.securityexception: not have android.permission.retrieve_window_content required call registeruitestautomationservice pid=7071, uid=10156 

can tell me how solve problem? thanks

as discussion seems, permission granted system apps , seems may have forgot add permission also,

to add permission :

add directly manifest

   <uses-permission android.permission.retrieve_window_content /> 

or inside service want operation done like

    <service android:name=".myaccessibilityservice"          android:permission="android.permission.bind_accessibility_service">      <intent-filter>          <action android:name="android.accessibilityservice.accessibilityservice" />      </intent-filter>      . . .  </service> 

have brief @ doc


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -