In an automated test I'm trying to perform against a Nexus 5X, this pop-up prompt (in this case, Magisk asking about granting superuser permission) will show up periodically throughout the test. To make it go away, I have to click a button on the pop-up. I've tried to get it to stop prompting me but it to no avail. The easiest solution seems to be to start a side thread in my test that checks the screen every second or so to see if the pop-up is present.

I thought that running

uiautomator dump

while the pop-up was on screen would give me the pixel location of the button to press. However, I scanned the resultant XML file and didn't see the text of the pop-up anywhere.

Also, running uiautomator displayed

ERROR: null root node returned by UiTestAutomationBridge.

Is there another tool I can use the get the pop-up's location?

  • So long as you are running your automated tests, why not tell Magisk to be out of your way? In Magisk settings there is an option called "Automatic Response". Set it to Deny or Grant and the popup won't appear ever. Have you tried this approach?
    – Firelord
    Commented Mar 18, 2023 at 18:27
  • The only options I see in "Settings" are Themes, Language, Update Channel, DNS over HTTP, and Download path. Commented Mar 20, 2023 at 13:44
  • I have Magisk v25.2. There are four sections in the Settings: Customization, App, Magisk, and Superuser. In Superuser section the option "Automatic Response" is listed.
    – Firelord
    Commented Mar 21, 2023 at 3:37
  • I also have 25.2 and only have two sections: Customization and App. Commented Mar 21, 2023 at 14:07
  • Have you tried swiping up in Magisk settings? Magisk's source code does show that setting. See github.com/topjohnwu/Magisk/blob/master/app/src/main/res/values/… So either you are not using the genuine Magisk app from GitHub or you have not swiped up on the Settings to find the aforesaid option.
    – Firelord
    Commented Mar 21, 2023 at 14:44


You must log in to answer this question.

Browse other questions tagged .