Shell command: Permission denied when trying to issue a settings command

446 views
Skip to first unread message

Mikael Lindholm

unread,
Jan 7, 2022, 8:39:27 AM1/7/22
to Automate
Hello all,

I'm new to Automate so please excuse the noob question:

I would like to run a shell command when the Android device is pulled of the USB power, and I managed to create a flow that reacts to that (that was super easy, thanks to dev for that!).

The challenge I have is that I'd like to run the following command:
"settings put global overlay_display_devices 0"

I get a permission denied error message. I've tried also the Super User shell command, but didn't have high hopes since my rooting my device is not an option.

I also tried ADB Shell command, but a connection refused message there, and I would really prefer to use shell command since I would need the ADB connection for something else. (Doing ADB

Many thanks for any hints in advance!

Mikael

Henrik "The Developer" Lindqvist

unread,
Jan 7, 2022, 9:05:59 AM1/7/22
to Automate
Just use the System setting set block, but as the documentation say, "Modifying a setting in the Global or Secure category isn’t officially supported and may require the “modify secure settings” or “modify private settings” privilege, may not work on all devices."

Mikael Lindholm

unread,
Jan 7, 2022, 9:50:52 AM1/7/22
to Automate

Thanks for the tip Henrik! I must be blind, but as the setting has to be selected from a drop down box, I couldn't find anything that matched what I needed to do. It seems like all Categories offers the same  settings names, is that how it should be?

Many thanks again,
Mikael

Henrik "The Developer" Lindqvist

unread,
Jan 7, 2022, 5:56:57 PM1/7/22
to Automate
Click the fx icon next to Name then write "overlay_display_devices" (including quotes), choose Global as Category, and set Value to 0

Mikael Lindholm

unread,
Jan 10, 2022, 9:22:17 AM1/10/22
to Automate
Thanks Henrik - that worked but then rights apparently was not enough or something (I gave it rights to system and private settings) as it produced an exception.

I guess this will not solve my challenge, but I want to thank for the support and the app in itself seems like a very capable and well designed one!

Many thanks again!
Mikael
Reply all
Reply to author
Forward
0 new messages