Detection of ANR

Hi Everyone,

I have an app basically it’s a launcher, and I just wanted to detect whenever it crashes or ANR occures. I really want to know how to detect this ANR while executing my test suite, and the thing is I don’t know when exactly ANR is gonna occur. Its should be like continuously running in background if ANR occured it should detect.

Thank you.