Both are viable but I think it's better to hire a developer as a cofounder. There are a couple of reasons for this but primarily I'd say that it's very rare to find a contractor who is going to care about the product as much as a cofounder or full-time CTO is going to care about it. And this care will impact the product experience so depending on the complexity of your app, this might be a significant concern. Furthermore, if you're planning to be successful and scale your users quickly, then it's very difficult and much more costly in the long-run to rely on contractors.
I experience with both approaches so I'm happy to share more with you in a call.