thank you mateFor a frame already built, I use two ways.
First, assuming that your front and rear wheels/tires are the same diameter, same inflation, and that you don't have any suspension settings to mess things up, you can use an angle finder. I have one that's accurate to 0.1 degrees. You put it flat on the ground, zero it, then stick it on the seat tube. It will give you the angle. I have analog ones that are accurate to +/- 0.5 degrees. I don't know how accurate your phone sensor is, but it sounds like you are trying to do this with your phone.
The second method is to take a photo at the appropriate perspective and use ImageJ to measure the seat tube angle. I have used ImageJ to measure frame angles many times and it gives results that are pretty accurate if you do it right.