How to install a arbitrary version of iOS on iPhone?
There's no official way of installing an older iOS on a device that Apple has stopped signing the SHSH keys for.

Your best bet is either to get a hold of a device that still has an older iOS or just using a simulator when developing the app.