Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to have both an iOS app and Mac app in the same project?

As the title says, I'm wondering if it's possible and reasonable to have both an iOS app and Mac app in the same project. That is, an Xcode project that has a Mac app target, and an iOS target.

If so, what should I watch out for, and is this even a good idea.

A little context: I'm working on a client app for a web-service, that will share a lot of the API connection (model-layer) code between the iOS and Mac platforms.

like image 545
Kenneth Ballenegger Avatar asked Feb 02 '11 09:02

Kenneth Ballenegger


People also ask

Can all iOS apps run on Mac?

After you sign the updated developer agreement, the App Store automatically makes compatible iOS apps available to users of a Mac with Apple silicon. However, if you're planning to ship a macOS version of your app, or if your app doesn't make sense for a Mac, you can change your app's availability in App Store Connect.

Are Mac apps the same as iPhone apps?

There is no porting process — the same frameworks that your apps use on iPhone and iPad are available and tuned just for Mac, taking advantage of the same shared architecture across all three platforms.

Can I install iOS app on Mac?

In the Mac App Store, iPhone and iPad apps that work on Mac computers with Apple silicon are labelled with Designed for iPhone or Designed for iPad. Any iPhone or iPad apps you purchase that work on your Mac with Apple silicon are shown when you view your purchased apps in the App Store.

Can you make an iOS app without a Mac?

You cannot develop iOS apps without a Mac computer, but you can set up CI/CD to handle building and publishing!


2 Answers

It's quite straightforward to do this. Make sure you have the build setting "Base SDK" set appropriately for each target.

You can also add SDK-specific build settings by clicking the little (+) symbol next to a build setting: per-SDK build setting

and then you can create appropriate Xcode schemes to build everything at once.

like image 169
bleater Avatar answered Oct 04 '22 19:10

bleater


Yes, it is possible to have an iOS App and a Mac App under the same Xcode project.

Managing builds and settings will be easier if both Apps are in a different project.

But at the same time, it will be a lot easier to maintain and debug code, if both them are under the same project. For eg. when making changes to common API, it is faster if both apps compile under the same project to ensure that both Apps accept the common changes.

like image 40
akrules Avatar answered Oct 04 '22 20:10

akrules