App to turn off cell phone

Hi everyone! My phone’s button is broken, so I want to make an app for turning off and restart. I have searched in the forum without sucess. It is possible to do this with app inventor?
Thanks in advance.

1 Like

You can make a button like this with floating extension, but the app will have to be manually opened when the app restarts.
Also, I don’t know if with kodular apps is possible to turn the smartphone off.

But there are tons of apps that do it for you. If you want to make this app to solve this problem, don’t worry. Just download an app from playstore. I personally like one that allow me to personalize what each button of my phone does (example: volume+ can turn off screen) and other that use acelerometer to make actions. Example: if you shake the app the screen go off or on, or open youtube, etc.

You can use some third party apps to achieve what you want to. But, if you want to make something like that in Koduar/AI2. Here are some suggestions.

Try using shell component with some commands.

Power off
reboot -p or reboot --poweroff ( the same command )


Note : this doesn’t require root access as this binary is world executable ( non-root users can execute this ). I haven’t tested this myself in newer android versions. Maybe this could’ve been changed for security reasons.

These below commands will work as well. But, I don’t know if they’ll require root access or turn off them properly / forcefully.

halt, poweroff

By sys-rq ( root/su )
( System Request ) works by echoing letter commands to it ( > ). This is a kernel temp file.
echo o > /proc/sysrq-trigger for Shutdown
echo b > /proc/sysrq-trigger for Reboot

I don’t understand, can you give me an example of how to put this in Kodular? Which blocks should I use, how do I?


Maybe you could use shell component

1 Like

is that linux console etc

Yea, shell commands or if you’re asking abt the shell component. It just executes the commands and returns the values and the changes doesn’t persist ( cd etc.,. )

1 Like

I’ll try this, for now, thank you very much.


I still haven’t been able to execute the command to hang up the phone by pressing a button.
Can you give me an example of how to do this in kodular?

I don’t know how to add a picture, can you help me?

How about this:
Accessibility extension

Can open power dialog to shutdown or restart phone

1 Like

Can you help me to open the power dialog to turn off or restart the phone, and then automatically go to the option and turn off the phone?

1 Like

Does anyone know any extension that turns off the cell phone by pressing a button inside the application created in kodular?
or can you show me how to do this procedure with kodular blocks?

I still couldn’t find this solution.

You have to search on playstore for this type of apps


1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.