Xiaomi phones are aggressive about background apps, so tap automation often stops after a few minutes. The fix is four settings on HyperOS (and most MIUI versions).
1. Battery saver
Settings → Battery → choose the automation app → select "No restrictions". Xiaomi's battery saver can pause the app mid-script.
2. Autostart
Settings → Apps → Manage apps → the automation app → Autostart → enable it. Some Xiaomi builds kill apps that do not have autostart, even while in use.
3. Display timeout
Settings → Display → Sleep. Set it long enough for the full run, or the screen turning off stops the taps.
4. Accessibility permission
Settings → Additional settings → Accessibility → the automation app → enable the service. A no-root auto clicker needs this to send taps, and it should only perform gestures you configured and started.
An app I built for this
Phone Operator is a no-root Android tap and swipe automation app: taps, double taps, swipes, delays, loops and reusable scripts. Free: unlimited single-point tapping. Pro: one-time purchase for advanced scripts. Rewarded ads can temporarily unlock Pro. It uses the Accessibility Service only for user-configured gestures and does not read, store or upload screen content. I am the developer of Phone Operator; menu names can vary by HyperOS/MIUI version.
Settings paths are based on common HyperOS/MIUI versions; check your device's current menus.