Restart foreground app
Please consider this small contribution this works for me you can minimise it into one line of shell command with REGEX by eliminating the extra steps of variable splits I'm sorry I can't dig further into REGEX.
RestartApp (43)
A1: Run Shell [ Command:dumpsys window windows | grep -E 'mCurrentFocus' Timeout (Seconds):0 Use Root:On Store Output In:%what Store Errors In: Store Result In: ]
A2: Variable Split [ Name:%app Splitter:/ Delete Base:On Regex:Off ]
A3: Variable Split [ Name:%app1 Splitter:u0 Delete Base:On Regex:Off ]
A4: Run Shell [ Command:am force-stop %app12
monkey -p %app12 -c android.intent.category.LAUNCHER 1
am start -n %app12 Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]