Search Unity

iOS build extraordinarily slow

Discussion in 'Unity Build Automation' started by andreasvh, Sep 17, 2020.

  1. andreasvh

    andreasvh

    Joined:
    Sep 26, 2018
    Posts:
    3
    Hello,

    I am in the process of setting up unity cloud builds. I have noticed that iOS builds are taking an extraordinarily long time.

    When watching the full logs it looks like it gets stuck AFTER having: 1) Checked out the code 2) Compiiled the unity project to an xcode project (il2cpp) 3) compile all the c++ code and generated the app file.

    Below is an excerpt of the full log up to the point where it hangs for a long while (more than half an hour in one case, in a current build I am running nearing a full hour). While I am not actually sure if they are supposed to be secret, I have redacted some id numbers to be safe.

    I don't know what it is doing after having generated that plist file. But I assume that it cannot be retreiving the code, compiling to cpp, or compiling the cpp code to native iOS, since I can see in the logs that those steps are already completed.

    I have already searched a bit around and read about this. In particular I have seen this: https://support.unity3d.com/hc/en-u...my-build-times-on-Cloud-Build-taking-so-long-

    I don't think the issue here is checking out code or importing assets. The time I have a problem with is spent during
    fastlane gym
    . Which can be verified in the fastlane summary also included below. (my build has just finisehd while writing this. Took 1:38 hours vs about 10 minutes "locally", where "locally" was actually on a Mac setup to do CI, so this time also includes checking out code. This is significantly more than a factor 2-3 as mentioned in the article).

    If it is not possible to make this go faster, could you (addressing Unity) at least provide information about what this time is spend on (maybe update the linked article above). That way maybe we can do something to optimize our projects for faster builds, or at least you will avoid more question like this from people have read that article and still don't understand what the time is spent on.


    Log excerpt up to the point it hangs:
    Code (csharp):
    1.  
    2. ...
    3. Generating 'UnityFramework.framework.dSYM'
    4. 8196: ▸ Copying RenderPluginDelegate.h
    5. 8197: ▸ Copying UnityFramework.h
    6. 8198: ▸ Copying UnityAppController.h
    7. 8199: ▸ Copying UndefinePlatforms.h
    8. 8200: ▸ Copying RedefinePlatforms.h
    9. 8201: ▸ Copying LifeCycleListener.h
    10. 8202: ▸ Running script 'Run Script'
    11. 8203: ▸ Running script 'Unity Process symbols'
    12. 8204: ▸ Touching UnityFramework.framework
    13. 8205: ▸ Signing /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-ehkqmksllengzpbgufnexegfaztu/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/UnityFramework.framework
    14. 8206: ▸ Touching UnityFramework.framework.dSYM
    15. 8207: ▸ Check Dependencies
    16. 8208: ▸ Copying Data
    17. 8209: ▸ Compiling main.mm
    18. 8210: ▸ Compiling main.mm
    19. 8211: ▸ Linking tilecut
    20. 8212: ▸ Linking tilecut
    21. 8213: ▸ Generating 'tilecut.app.dSYM'
    22. 8214: ▸ Copying /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-ehkqmksllengzpbgufnexegfaztu/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/UnityFramework.framework
    23. 8215: ▸     skipping copy phase strip, binary is code signed: /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-ehkqmksllengzpbgufnexegfaztu/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/UnityFramework.framework/UnityFramework
    24. 8216: ▸ Signing /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-ehkqmksllengzpbgufnexegfaztu/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/APPLICATION_PATH/tilecut.app/Frameworks/UnityFramework.framework
    25. 8217: ▸ Running script 'Unity Process symbols'
    26. 8218: ▸ Touching tilecut.app
    27. 8219: ▸ Signing /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-ehkqmksllengzpbgufnexegfaztu/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/APPLICATION_PATH/tilecut.app
    28. 8220: ▸ Touching tilecut.app.dSYM
    29. 8221: ▸ Archive Succeeded
    30. 8222: Generated plist file with the following values:
    31. 8223:-----------------------------------------
    32. 8224:{
    33. 8225: ▸   "method": "ad-hoc",
    34. 8226: ▸   "provisioningProfiles": {
    35. 8227: ▸     "dk.odico.tilecut": "[redacted]"
    36. 8228: ▸   },
    37. 8229: ▸   "signingStyle": "manual",
    38. 8230: ▸   "teamID": "[redacted]"
    39. 8231:}
    40. 8232:-----------------------------------------
    Log excerpt of fastlane summary
    Code (csharp):
    1.  
    2. 8287: +------+---------------------------------------------------------------+-------------+
    3. 8288: |                                  fastlane summary                                  |
    4. 8289: +------+---------------------------------------------------------------+-------------+
    5. 8290: | Step | Action                                                        | Time (in s) |
    6. 8291: +------+---------------------------------------------------------------+-------------+
    7. 8292: | 1    | Verifying fastlane version                                    | 0           |
    8. 8293: | 2    | default_platform                                              | 0           |
    9. 8294: | 3    | set_info_plist_value                                          | 0           |
    10. 8295: | 4    | update_project_provisioning                                   | 0           |
    11. 8296: | 5    | sed -i '' '/PROVISIONING_PROFILE_SPECIFIER/d;/DEVELOPMENT_TEA | 0           |
    12. 8297: | 6    | gym                                                           | 5349        |
     
  2. dirty-rectangle

    dirty-rectangle

    Joined:
    Apr 23, 2015
    Posts:
    78
  3. andreasvh

    andreasvh

    Joined:
    Sep 26, 2018
    Posts:
    3
    I am indeed using an ad-hoc provisioning profile

    I have noticed that the really long 1:38 hours build was after I had set it to a development build.

    After putting it back to production it is around 44 minutes.

    Still, it is using a huge amount a large amount (around half I think) of that time on that post compile step I am not sure about what is actually doing and which does not seem to print anything to the log.