Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build both Lite and Full version of iPhone app based on one xcode project?

Tags:

ios

iphone

I do not want to maintain two sets of code. I just need to limit some features in the Lite version and add some advertisements on it.

How to do that?

like image 634
virsir Avatar asked Jan 12 '11 03:01

virsir


People also ask

How do you create both a paid and lite version of an iPhone app?

The Bad Approach: Multiple ProjectsCreate a free version of the app. Copy the project folder and rename it to something like “Paid Version”. Add your extra features to the paid app, and Voila! You have both a free and paid version that you can build and deploy to the App Store.

Can you make IOS apps with Xcode?

The Xcode developer tools include everything you need to create apps for iOS, iPadOS, macOS, tvOS, and watchOS.

How do I build and run an app in Xcode?

Build, Run, and Debug Your App To build and run your code, choose Product > Run, or click the Run button in your project's toolbar. Xcode analyzes your scheme's targets and builds them in the proper sequence. After a successful build, Xcode launches the associated app.

How do I create a swift project in Xcode?

To create a new Swift package, open Xcode and select File > New > Swift Package. Choose a name and select a file location. Select “Create Git repository on my Mac” to put your package under version control. On completion, the Swift package opens in Xcode and looks similar to a standard Xcode project.


1 Answers

Create multiple targets.

You can vary build configurations by right-clicking on a target and selecting Get Info. From there, you can do things like change which Info.plist file it's looking at (to do things like add "Lite" to the name and change the icon/load images) and set compiler flags so that you can #ifdef in places.

If there are lots of files that are only applicable in the full version, then you can right-click on them and remove them from the Lite target to make a smaller app.

I've experimented with various alternatives, such as multiple configurations, and I keep coming back to multiple targets. I usually have at least three defined - Development, Ad hoc and App Store, each with their own particular settings.

like image 97
Jim Avatar answered Sep 28 '22 04:09

Jim