I've seen this question about whether or not it's possible to make an iOS App and a Mac OS X App in the same project, while I was trying to ask this. I'm not asking about whether or not it's possible. I had to delete and re-install Xcode (because I wanted to update and my MacBook Air's SSD is really low on space), and I came across this screenshot.
Besides the absolutely beautiful 3D scenery on the right side, I looked at the project structure on the left. They have OS X files in one group and iOS files in another.
How would I be able to make my project this organized? As in, how would I go about making a project where I can simply have OS X files and iOS files be simply two different groups of files in the same project, and work on each app almost synchronously?
iOS and macOS support many of the same frameworks and features, and most iOS apps run smoothly in macOS. However, you might choose to opt out of running your iOS app in macOS under the following circumstances: You already created a Mac version of your app using AppKit or Mac Catalyst.
In the Mac App Store, iPhone and iPad apps that work on Mac computers with Apple silicon are labeled 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.
In the App Store on your Mac, click your name in the bottom-left corner, or click Sign In if you're not already. Your account appears with all of your purchased apps. If you're using a Mac computer with Apple silicon, any iPhone or iPad apps you purchased that work on your Mac are also listed.
Apple announced its transition to Apple Silicon for its Mac lineup in 2020. In addition to offering a boost in performance and efficiency on the new Macs, this move also opened the possibility to run iOS (and iPadOS) apps on the Mac.
However, if you wish to develop an iOS app on Windows, you need virtualization software. Using a virtual machine such as VirtualBox and VMware, you get access to virtual Mac OS. Hence, developing iOS apps on Windows will be easier for you.
The workflow to creating Android and iOS apps is relatively simple. In order to create an iOS application in Android Studio, we first need to start with an Android Project. Finally, we configure the Gradle* scripts, build and launch our apps.
You can also develop your Android* and iOS* applications in Android Studio on Windows* but in order to simulate your iOS application, you will need to remotely deploy your app to a Mac system running Xcode* (hence remote build). For this scenario, check our getting started guide with Multi-OS Engine (remote build).
Figure out how to do this, leave some screenshots in case it may help others.
I did the OSX App first, put the common code apart, then click file menu to create the target as iOS App.
Use the common code to build iOS App, Now you can already see the target has both OSX and iOS, remember to add the needed files in the Compile Sources and Resources.
Now you can both choose whether to run on iOS or OSX. Done!
The answer seems quite straight-forward. Xcode allows you to create groups in order to organize files. Each source file can belong to one-or-more targets, so it's just a case of putting all common, iOS-specific and OSX-specific files in their own groups and setting their targets.
- Source
- Common
- File1.m Target: iOS and OSX
...
- iOS
- File2.m Target: iOS
...
- OSX
- File3.m Target: OSX
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With