application requires INJECT_EVENTS permission, Unable to touch

Mobile Testing, Android App Testing.
Ahmad
Posts: 37
Joined: Tue Apr 09, 2019 7:29 am
Location: Berlin

application requires INJECT_EVENTS permission, Unable to touch

Post by Ahmad » Thu Mar 16, 2023 1:22 pm

I'm currently attempting to test an Android application that requires me to press (touch) different elements.

When I attempt to 'touch' any element on the App through Ranorex the test fails & I get an "Inject_Events" permission error telling me that "Injecting to another application requires INJECT_EVENTS permission".

Is there anyway around this?


Thanks

Ranorex 10.5.3
Android v 13
In attachments is the snapshot.
You do not have the required permissions to view the files attached to this post.

wiktor.pajor
Posts: 7
Joined: Thu Apr 24, 2014 3:54 pm

Re: application requires INJECT_EVENTS permission, Unable to touch

Post by wiktor.pajor » Mon Apr 03, 2023 6:50 pm

I have the same issue.
Looks like this problem is caused when using Android API Level 33 (Tiramisu) v13.
When running Android with lower version, everything works as expected and without any problems.
I haven't yet found a proper solution for this. Right now using API Level 32 v12L :(

Ranorex 10.5.4

bTripleSeven
Posts: 1
Joined: Wed May 24, 2023 10:57 am

Re: application requires INJECT_EVENTS permission, Unable to touch

Post by bTripleSeven » Tue May 30, 2023 12:24 pm

Same issue, Android 13.

tech_sp
Posts: 2
Joined: Fri Mar 24, 2023 10:15 am

Re: application requires INJECT_EVENTS permission, Unable to touch

Post by tech_sp » Fri Jun 16, 2023 10:20 am

Same issue, Android 13.

kirit
Posts: 2
Joined: Mon Jul 03, 2023 7:15 am

Re: application requires INJECT_EVENTS permission, Unable to touch

Post by kirit » Tue Jul 04, 2023 1:11 pm

I am able to Touch using Code module.

Workarround with <ElementPath>.PerformClick() method.

Julie.Toussaint
Posts: 15
Joined: Wed Feb 08, 2023 10:47 am

Re: application requires INJECT_EVENTS permission, Unable to touch

Post by Julie.Toussaint » Wed Jul 26, 2023 9:29 am

Same issue
WaitForExists() works, opening the app works, but as soon as an interaction like Touch() is attempted the following error is shown:

Code: Select all

Injecting input events requires the caller (or the source of the instrumentation, if any) to have the INJECT_EVENTS permission.
Solution for others seems to be installing the app as system/app AND signing it with System Certificate, which for our intended purposes is not an option...

Android 13 and Ranorex Service 2.3.4

--
Update July 2023: Downgrading to Android 11 fixed it, Ranorex does not support Android 13. :(
Update October 2023: This error is occurring again on Android 11 using the latest versions of Ranorex Service and Automation Suite
Application Engineer 🇧🇪
The workaround experience, awaiting a reply