Best way to generate both "free / demo" and commercial applications from the same source code?

I would like to provide two versions of my iPhone app in the App Store - one free, limited by the number of items displayed through the application, and the other unlimited.

The source code for both applications will be exactly the same, the only distinguishing feature will be the SQLite database, which stores the elements in the application.

I understand that both versions of the application must have different package names and different icons. I am trying to find a way to avoid completely copying the source code directory to be able to customize some of these things: database, icons, nib lines, etc.

Is there a good way to do this without duplicating everything?

+3
source share
6 answers

Just create a second goal in your project. It may be a full-featured application that includes a complete database, and the new goal is your demo build with a demo database. We do this with crosswords, and it works great. Then you can save your entire source in one place and not worry about you being out of sync.

+13
source

Make reasonable use of conditional compilation. I don’t know what language you are working in, but in C / C ++ compilation is done using a macro preprocessor and ifdefs. You must write code, for example:

#ifdef FULL_APP
  // unlimited size
  #define SIZE -1
#else
  #define SIZE 100
#endif

When you create the program, you provide appopriate macros at the compiler command line.

gcc program.cc -o program.o -DFULL_APP

, .

+7

, , - , , , . , URL .

+1

, ( ) , .

0

(iPhone-?) , SQLite ?

, , . . ( iPhone- ) , .

Of course, such a solution can harm your business if your customers are high-tech and malignant, and your code is easy to decompile.

0
source

I researched this, and it seems that doing “downloading the trial version and updating it over the Internet” violates the terms of the app store. You seem to really need two separate versions of the app in the store. (referring to Ben Gottlieb's entry). So, one source, two distributions.

-2
source

Source: https://habr.com/ru/post/1699315/


All Articles