Search Unity

target sdk 4.1?

Discussion in 'iOS and tvOS' started by mindengine, Sep 8, 2010.

  1. mindengine

    mindengine

    Joined:
    Sep 8, 2008
    Posts:
    114
    can unity 3 target SDK 4.1?
    the latest xcode doesnt seem to have 4.0 as one of its base SDK's.
    any ideas?
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    set it to unknown for base sdk, build and change the active target setting in sdk and it will remain like that

    and right, new sdks will no longer include older ones, as apple will not accept older ones than the current for submission
     
  3. mindengine

    mindengine

    Joined:
    Sep 8, 2008
    Posts:
    114
    hmmm. did that but the the device is still listed at 3.2 in xcode, even after i changed the 'base SDK for all configurations' to iOS 4.1 in the info rollout.

    when i build it doesn't build for 4.1 as fast app switching is gone and so is the native resolution display on my iphone 4.
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    then you didn't change base sdk and target os on the active target and project settings in xcode I guess


    and 3.2 was never an iphone os, just to mention that :) (.2 is ipad)
     
  5. mindengine

    mindengine

    Joined:
    Sep 8, 2008
    Posts:
    114
    well i am pretty sure i did. here is a screen shot, i change the target iOS as well....
     

    Attached Files:

  6. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    thats base sdk on project settings.

    the real one as well as deployment target are in the settings of Active Target right below this
     
  7. mindengine

    mindengine

    Joined:
    Sep 8, 2008
    Posts:
    114
    you mean this one?? also changed...
     

    Attached Files:

  8. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    Make sure the drop down says 'All Configurations'. You are only changing the build settings for Release.
     
  9. mindengine

    mindengine

    Joined:
    Sep 8, 2008
    Posts:
    114
    thanks all...

    my mistake was i was not changing the config from the top down menu but rather the project pane which doesn't seem to affect the outcome.
     
  10. Skyrise

    Skyrise

    Joined:
    Nov 3, 2005
    Posts:
    158
    Any problem compiling with Unity 1.7 in SDK 4.1? I'm testing a project now with SDK 4.0 and it works beautifully, I don't want to mess anything up now... :?
     
  11. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    No problem with Unity 1.7, you can compile on 4.1 ;-)
     
  12. itech

    itech

    Joined:
    Jul 28, 2010
    Posts:
    139
    So for all current submits to iTunes Connect I need download iOS4.1 to my iPhone ( for testing my application on the device ), and I must upgrade my XCode to latest version that support iOS4.1 , am I correct ?
    And when I create my current project on Unity 1.7 I need in set Edit->Player-> SDK version to unknown , am I correct ?
    So is that mean that there is no need to build project for iPhone OS from 3.0.0 to iOS4.1, just and only for iOS 4.1 build are neccessery for proper and correct iTunes Connect submits ?
    Thanks
     
  13. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    Yes, update sdk
    In unity 1.7 target 3.2 or other, and modify in xcode after
     
  14. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Wrong
    you must update the SDK and xcode right, but the device must not be updated if you don't want.


    Right


    Right but you none the less want to go into the active target settings and modify the deployment target to 3.1.3 unless you do a 3GS+ only application
     
  15. itech

    itech

    Joined:
    Jul 28, 2010
    Posts:
    139
    Thanks for help, but I have one other question , so if I wish create application for iPod Touch ( I don't know how many versions of iPod's are compatible for iOS4.1 ) iPhone 3G , iPhone 3GS, iPhone 4 which iOS version do I need build for ?
    I read that iOS4.1 are compatible with iPhone3G, 3GS and 4 so I suppose if I build for iOS4.1 then my application will run on all iPhone devices which have installed iOS 4.1, am I correct or wrong ?
    And Apple will no approve applications that are builded for earlier version of iPhone OS .
    Sorry for asking this nOOb questions but soon I will finish my appliaction created by Unity and I wish to now all the answers on this silly questions :)
     
  16. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    base sdk is always the current one
    target os would normally be 3.1.3 unless you need an os4 feature for sure (like local notification). that way you can target any device if you want.
    If you set it like these all devices with at least iOS 3.1.3 can run it :)


    for further information, also on the upload procedure etc, do yourself the favor and read apples documentations cause you must read them or you will find a lot of frustration later on
     
  17. Skyrise

    Skyrise

    Joined:
    Nov 3, 2005
    Posts:
    158
    Thanks! :)
     
  18. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    For that :

    1 - build project with unity1.7 for 3.2 device target (for exemple)

    2 - In xcode modify "Project Info" (maybe not usefull, but I don't have problem like that):
    - Architectures : Standard (Armc6 Armv7)
    - Base SDK : IOS DEVICE 4.1
    - Build Active Architecture Only : uncheck
    - Valid Architectures : Armv6 armv7

    3 - In Xcodee modify "Target""Info :
    - Architectures : Standard (Armc6 Armv7)
    - Base SDK : IOS DEVICE 4.1
    - Build Active Architecture Only : uncheck
    - Valid Architectures : Armv6 armv7
    - IOS DEPLOYEMENT TARGET : Choose minimum version of iOS you want (for your apps stay compatible with 3.1.2, choose 3.1.2...) or choose 4.1

    Buid and enjoy !!
     
  19. bliprob

    bliprob

    Joined:
    May 13, 2007
    Posts:
    901
    Here's a postProcessBuildScript that will set the XCode project's SDK version to 4.1. Just stick it into "Assets/Editor" and it will run the next time you build the project. YMMV but it seems to be working fine for me (running in Unity 3 beta).

    Code (csharp):
    1. #!/usr/bin/perl
    2.  
    3. # Post Process Build Script
    4. # Unity iPhone Enhancement Pack
    5. # Rob Terrell (robterrell _at_ gmail.com)
    6. #
    7. #   Switches the project to SDK 4.1 after the project is built
    8. #
    9. #   Place this file in your project's "Assets/Editor" folder
    10.  
    11. $installPath = $ARGV[0];
    12. $projfile = $installPath."/Unity-iPhone.xcodeproj";
    13. $pbxfile = $projfile."/project.pbxproj";
    14.  
    15. #
    16. # SDKROOT = iphoneos4.1
    17. #
    18.  
    19. $find = "SDKROOT = iphoneos4.0";
    20. $replace = "SDKROOT = iphoneos4.1";
    21.  
    22. `perl -pi -i.bak -e 's|$find|$replace|' $pbxfile`;
    23.  
     
  20. diese440

    diese440

    Joined:
    May 25, 2007
    Posts:
    105
    Thanks, but I did that and it did'n work fine for me : Unity3.0.0b7. :roll:
    Cheers :D
     
  21. bliprob

    bliprob

    Joined:
    May 13, 2007
    Posts:
    901
    Maybe it's the build SDK version? My project is set to build against SDK 4.0, which is what the script is searching for. If you're using a different SDK to build against, you may need to adjust the $find string, i.e.

    $find = "SDKROOT = iphoneos3.1"
     
  22. diese440

    diese440

    Joined:
    May 25, 2007
    Posts:
    105
    I use the SDK 4.0 and I don't have iPhone Pro, just the basic version...:roll:

    Thanks for help :D
     
  23. marjan

    marjan

    Joined:
    Jun 6, 2009
    Posts:
    563
    You simply must du it like this:

    1. Set the Base SDK to 4.0 or higher. Apple wants you to use 4 as base.

    2. Set "iPhone OS Deployment Target" to the lowest possible (or in case you use something from the sdk requiring a higher version to the minimum you need). As far as i know you cannot or are not allowed to use something lower than 3.0 here.

    This means in the end you are building with 4.0 and your app will run on devices from iOs 3.0 (or whatever you set in deployment target )



    And in case you want your app to run on older devices like iphone3 or lower, you also need to make sure that Architectures is set to (Standard) and Valid Architectures to armv6 armv7.

    This of course in XCode, Edit Project settings and make sure that you set this for the desired target.
     
  24. bliprob

    bliprob

    Joined:
    May 13, 2007
    Posts:
    901
    diese440: Should work with Basic. I've modified the script to change SDK settings with any version number, including 3-digit numbers (i.e. will now match against 3.1.3) and it now matches globally, so it will change both the root project's SDK setting, and the SDKROOT setting of all targets.

    Code (csharp):
    1. #!/usr/bin/perl
    2.  
    3.  
    4. # Post Process Build Script
    5. # Unity iPhone Enhancement Pack
    6. #
    7. #  Switches the project to SDK 4.1 after the project is built
    8. #
    9. #  Place in your project's "Assets/Editors" folder
    10.  
    11. $installPath = $ARGV[0];
    12. $projfile = $installPath."/Unity-iPhone.xcodeproj";
    13. $pbxfile = $projfile."/project.pbxproj";
    14.  
    15. #
    16. # SDKROOT = iphoneos4.1
    17. #
    18.  
    19.  
    20. $find = "SDKROOT = iphoneos[0-9].[0-9](.[0-9])*";
    21. $replace = "SDKROOT = iphoneos4.1";
    22.  
    23. `perl -pi -i.bak -e 's|$find|$replace|g' $pbxfile`;
    24.  
    Hope this helps.
     
  25. diese440

    diese440

    Joined:
    May 25, 2007
    Posts:
    105
    Hi Bliprob !

    Thanks for all. After downloading Unity 3.0.0f1, today, i can see that NOW ios 4.1 appears in the "SDK Version" and "Target IOS Version". 8).


    :D :D :D :D :D :D :D :D