Xcode: Convert App to static Library

Sorry this is not ionic related although I am trying to do this for my new ionic app. So I have this Xcode App that I want to use in a Cordova plugin I am creating. How I can convert it to static library?