Killing an other app from AI app

Hello.
I have an AI app (App1) which open an existing app (App2)
After ew time i need to close App2.
I searched on differents topics but without really succes...

I tried to use :

Linux kïll command help and examples

Linux kïll command help and information with kïll examples, syntax, related commands, and how to use the kïll command from the command line.

ps (get PID of process)
kïll 19260 (kïll MIT Companion)

shell_kill2
shell_kill

killall edu.mit.appinventor.aicompanion3 (kïll process by name)

but it seems i need to be rooted and i'm not

maybe this

but it is a paid extension and i don't know if it can kïll an app in foreground...

I tried this:

but without any succes...nothing happened

is someone have solution to do it ?

You might want to ask the author of that extension in the Niotron thread

Taifun

Unless root, you cannot do that...