Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

Lite Game: Duplicate Xcode Project

rjgrunerjgrune Posts: 106Registered Users
Is there a good way to duplicate an xcode project so i can use the same basic game, but cut out a bunch of stuff for a "lite version".

i've tried just copying the folder and renaming the xcode file, but when I build there is only 1 version of the app on the simulator - it just replaces the "full version".
Post edited by rjgrune on
Check out one of my Apps!

BlackOut, or <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=293047953&mt=8"
«1

Replies

  • RickMaddyRickMaddy Posts: 2,122New Users
    Don't create a separate project. Just add a second target to the existing project.

    In the build settings for the new target change the "Product Name" setting to "ProductLite" or something similar.

    You should also end up with a new file in resources named "Copy of Info.plist" (or something similar). I usually rename this to "InfoLite.plist". Then in the build settings for the new Lite target your created change the "Info.plist File" setting to match whatever you renamed the file to.

    You'll want to create an IconLite.png and update the InfoLite.plist to reference the new icon file.

    With this all in place you should now be able to build two targets - the full version and the lite version. They will now have different app names (based on the Product Name change so they can both be deployed at the same time. They will have unique bundle ids so they can be submitted to Apple as separate apps.

    Now the last part. For the Lite target, edit the build properties. Scroll way down the list of settings to the "GCC 4.0 - Language" group. Make sure "All Configurations" is selected and edit the "Other C Flags" setting. Set it to something like:

    -DLITE_VERSION

    Now in your code you can do things like:


    #ifdef LITE_VERSION
    // Code specific to lite version
    #else
    // Code specific to full version
    #endif

    // Or

    #ifdef LITE_VERSION
    // Code specific to lite version
    #endif

    // Or

    #ifndef LITE_VERSION
    // Code specific to full version
    #endif
    iPhone Apps: My Stuff, My Stu
  • rjgrunerjgrune Posts: 106Registered Users
    Now the last part. For the Lite target, edit the build properties. Scroll way down the list of settings to the "GCC 4.0 - Language" group. Make sure "All Configurations" is selected and edit the "Other C Flags" setting. Set it to something like:
    I'm not quite sure where this is in my build settings. I highlight my targetLite and click the info button to edit the build settings. "All Configurations" is selected...where do I find the "Other C Flags" settings?

    Also, at this point before doing your last step when I build to the simulator for my TargetLite I always get an "Error From Debugger: Failure to launch simulated application: Unknown Error"

    Thanks for this, I am much further along then I was before.
    Check out one of my Apps!

    BlackOut, or <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=293047953&mt=8"
  • RickMaddyRickMaddy Posts: 2,122New Users
    The GCC 4.0 sections only seem to show up if you select the right combination.

    On your main project window select the drop down list that lets you quickly pick the SDK, configuration, and target. Select the one the says "Use Project Settings". The drop it down again and select your new Lite target leaving all the others checked as-is. Now your build settings should include all of the GCC 4.0 sections in the settings list.
    iPhone Apps: My Stuff, My Stu
  • eduzeduz Posts: 55Registered Users
    Hey RickMaddy, thanks for the tip!!! Helped a lot.

    Here is another tip: How to maintain two Default.png files, one for the full version and another for the Lite version in the same project:

    - Create a Default.png file for the full version and a DefaultLite.png file for the Lite version. Add both to the Resources folder in your xcode project.
    - Right click on your lite app Target, click Add, New Build Phase, New Run Script Build Phase.
    - Paste this code in the script field:
    mv ${TARGET_BUILD_DIR}/${CONTENTS_FOLDER_PATH}/DefaultLite.png ${TARGET_BUILD_DIR}/${CONTENTS_FOLDER_PATH}/Default.png

    - Move the "Run Script" phase you just created right after to "Copy Bundle Resources"

    That's it, everytime you build the project with the Lite app target it will copy the DefaultLite.png and rename it to Default.png in your build dir.
    Want to download documents directly from Safari and save them for offline reading? SaveMyDocs

    Send emails with emoji that can be seen
  • KnightKnight Posts: 26Registered Users
    Using this method is it possible to selectively add which resources get copied into the binary? For example, our game binary is about 40 megs, if we were to do a Lite version, we can probably knock it down to under 10 megs by removing stuff we won't need in the Lite version.

    If its possible, any suggestions as to how to do it? Thanks.
  • RickMaddyRickMaddy Posts: 2,122New Users
    If you right click on a file and select "Get Info" you will see a Targets tab. Select that tab. Then check/uncheck the appropriate targets for that file.
    iPhone Apps: My Stuff, My Stu
  • KnightKnight Posts: 26Registered Users
    Thanks RickMaddy.

    This thread has helped a lot.

    One thing I can't seem to get working is using a different icon for the Lite version. I am using 'iconLite.png' for the Lite, and the full version uses 'icon.png'. I am seeing the default white blank icon when I do this.

    Any ideas?
  • RickMaddyRickMaddy Posts: 2,122New Users
    Did you change the icon property in the corresponding info.plist for the lite version? Make sure the case matches too.
    iPhone Apps: My Stuff, My Stu
  • KnightKnight Posts: 26Registered Users
    Ah jeez, I suck. The icon for the lite version was set to full version's target, so it never got included when building the lite.

    Thanks RickMaddy. Your post made me go check everything and was able to find it. Sorry for wasting your time. Its always the little things that one forgets. ;)
  • bit101bit101 Posts: 4New Users
    One thing I had trouble with was using Project->New Target... to create the new target. This was failing consistently. Turns out the info.plist that gets created when you do this isn't complete. Instead, selecting the original target and choosing "duplicate", then following the rest of the directions, works fine.
  • tommy-personataptommy-personatap Posts: 19Registered Users
    RickMaddy;35988 said:
    The GCC 4.0 sections only seem to show up if you select the right combination.

    On your main project window select the drop down list that lets you quickly pick the SDK, configuration, and target. Select the one the says "Use Project Settings". The drop it down again and select your new Lite target leaving all the others checked as-is. Now your build settings should include all of the GCC 4.0 sections in the settings list.

    Alternatively, you can just create a user-defined entry named "OTHER_CFLAGS"
  • roocellroocell Posts: 98Registered Users
    always grateful of rickmaddy's answers.
    I tried this, but i just get
    "failed to launch simulated appliation: unknown error"
    when i try to launch my new lite target.

    when creating the target, so i have to specify what to build?
    I tried adding my full version app as a dependency, but that didnt work either.
  • roocellroocell Posts: 98Registered Users
    answered my own question yet again.

    1. if you create your new target from the top menu, you'll have to drag all the resources, files from your original target to the new target. This is how it knows what to build.

    2. i didnt try it, but I think you could just right click on the original target and click duplicate. This is save some trouble.
  • QuantumDojaQuantumDoja Posts: 623Registered Users
    roocell;81309 said:
    answered my own question yet again.

    1. if you create your new target from the top menu, you'll have to drag all the resources, files from your original target to the new target. This is how it knows what to build.

    2. i didnt try it, but I think you could just right click on the original target and click duplicate. This is save some trouble.

    Step 2 worked for me, I'm using the latest xcode for iphone os 3.0
    www.itheme.com
    deal.gameweaver.com
    guessem.gameweaver.com
  • brendandbrendand Posts: 223Registered Users
    Should the bundle identifier be changed also? My bundle identifier is com.clickspace.tapforms for my regular. Should the lite one be something like com.clickspace.tapformslite?

    It would be nice if a user could upgrade to the full version and keep their database. But I guess that's not really possible. Well, I can keep the backup function in the lite version so they could backup their database and then restore to the full version if they upgrade.
  • KazoolessKazooless Posts: 61Registered Users
    I'm having trouble creating a lite version that does not replace my full version. I copied the folder for my full version and in this I changed the code for my lite. I created a new target by duplicating the old and renaming it to lite I also changed the Bundle identifier but it does not seem to matter they both still overwrite the other if I try to install it on my device.

    I read above that Product Name should be changed but Product Name is Blank in my full version. I tried to add a value there but it did not seem to make a difference.

    I'm also noticing that under products the two .app files have the same name.

    what am I missing?
  • odysseus31173odysseus31173 Posts: 295Registered Users
    the Ifdef statements are neat, i'm gonna read up on that tonight when I get home.
    Phantom Dev! My blog about tech.
  • CarlosHCarlosH Posts: 34Registered Users
    RickMaddy;38686 said:
    Did you change the icon property in the corresponding info.plist for the lite version? Make sure the case matches too.
    I created 2 apps, version a and version b. Using this method, of creating a different target for each version. When debugging, and even in release mode, the icon in the device is the one I set on the infoVersionA.plist, and infoVersionB.plist. But after uploading the app to the appstore, the icon that appears on the appstore on the device is the same for both apps. So for example, I have one icon named, icon.png, and another iconVersionB.png. I included both files, both the .plist files define which icon is which. Do I need to do something else, or is this an appstore error? Any ideas. Also, If I download the apps from the AppStore, once installed on my device, the icons are correct for each version.

    Thanks.
  • QuantumDojaQuantumDoja Posts: 623Registered Users
    CarlosH;86219 said:
    I created 2 apps, version a and version b. Using this method, of creating a different target for each version. When debugging, and even in release mode, the icon in the device is the one I set on the infoVersionA.plist, and infoVersionB.plist. But after uploading the app to the appstore, the icon that appears on the appstore on the device is the same for both apps. So for example, I have one icon named, icon.png, and another iconVersionB.png. I included both files, both the .plist files define which icon is which. Do I need to do something else, or is this an appstore error? Any ideas. Also, If I download the apps from the AppStore, once installed on my device, the icons are correct for each version.

    Thanks.
    Dude, you're not making two xcode projects are you?
    www.itheme.com
    deal.gameweaver.com
    guessem.gameweaver.com
  • CarlosHCarlosH Posts: 34Registered Users
    QuantumDoja;86222 said:
    Dude, you're not making two xcode projects are you?
    Nope, is just one project, with 2 targets. With conditional compiling, and different info.plist files. They work pefectly, and downloading the app from the appstore works as expected, with the correct icon. The problem is the icon that appears in the Appstore on the device. It appears as if the Appstore looks just for an icon.png file, instead of the icon file I set on the info.plist
  • tawpietawpie Posts: 348Registered Users
    CarlosH;86223 said:
    [snip]The problem is the icon that appears in the Appstore on the device.[snip
    Confused. Do you mean that when you go to the appstore using your device, that the icons for both a and b are the same? Yet when downloaded they are different (and correct)?

    Is it possible that you used the same 512x512 appstore .jpg for both when uploading?
    "Hardware will break. Software comes broken" Unknown

    Calc-12E <-- ditch your old calculator.

    <a href="htt
  • CarlosHCarlosH Posts: 34Registered Users
    tawpie;86271 said:
    Confused. Do you mean that when you go to the appstore using your device, that the icons for both a and b are the same? Yet when downloaded they are different (and correct)?

    Is it possible that you used the same 512x512 appstore .jpg for both when uploading?
    They look the same in the appstore listing, on the device. The 512x512 images are correct, and they show correctly on iTunes, on the mac. So since the icons that appear on the appstore listings on the device come from the bundle, so I think the problem has to be related with targetting 2 apps.
  • tawpietawpie Posts: 348Registered Users
    Sounds like your first theory was well founded... the appstore app must use Icon.png, I wonder what happens if there isn't an Icon.png in the bundle? One would hate to experiment with a live app but if you didn't use Icon.png in either app would they show anything?
    "Hardware will break. Software comes broken" Unknown

    Calc-12E <-- ditch your old calculator.

    <a href="htt
  • brendandbrendand Posts: 223Registered Users
    Did you include Icon.png and iconVersionB.png in both targets? Make sure that each one is in its own target so that your bundle will only include one or the other, but never both.
  • CarlosHCarlosH Posts: 34Registered Users
    brendand;86337 said:
    Did you include Icon.png and iconVersionB.png in both targets? Make sure that each one is in its own target so that your bundle will only include one or the other, but never both.
    I included both by mistakes. Since on my tests the icons looked correctly on the device, I will upload a new version without both files to see what happens. I only hope it works, because if not, I will be having an iconless app on the listing. Here are the 3 apps from the same project, with 3 different targets. I explained my problem with 2 targets, just to make the example easier, but the actual problem is with 3 apps. So one app has the correct icon on the app store on the device, the other 2 do not.

    Bad Icon
    iTunes Store/Bubble Level

    Bad Icon
    iTunes Store/TiltMeter

    Good Icon
    iTunes Store/TiltMeter Pro

    http://www.tiltmeterapp.com
Sign In or Register to comment.