Search Unity

Building for different platforms

Discussion in 'General Discussion' started by tinycarnival, Jun 1, 2019.

  1. tinycarnival

    tinycarnival

    Joined:
    May 9, 2018
    Posts:
    5
    What is the best way in handling project files for building in different platforms namely android in ios.
    Do I need to keep separate project files targeted for different platforms? Or just switch back and forth from andrdoid - ios whenever I need to build them?
     
  2. Akshara

    Akshara

    Joined:
    Apr 9, 2014
    Posts:
    100
    Unity generates a new Library folder when switching between build platforms, which as a project grows in size can lead to long wait times when switching between multiple platforms. Unity offers a solution with their Cache Server, though this can require special licensing and managing either a local or remote server.

    The solution which I use instead is to replace the Library directory with a symbolic link which points to a unique Library directory for each build platform, then to use a bat file to switch between the Library directories before opening Unity, as described in the following article...

    Fast Platform Switching in Unity3D

    Unity remembers which build platform the Library is set to when switching. So what I do is to setup symlinks and unique Library directories for each installed platform at the creation of a project and then update each platform as the project grows. Hope that I've managed to explain this all clearly and that it may be helpful.
     
    rab and Joe-Censored like this.
  3. bluescrn

    bluescrn

    Joined:
    Feb 25, 2013
    Posts:
    642
    I really don't understand why Unity never implemented per-platform \library folders themselves, leaving platform-switching as such a time-consuming operation.

    Yes, the cache server certainly speeds things up, but if you're switching platform a lot, and assuming you're using source control, another option is to simply have two or more local copies of your project, one set to iOS and the other set to Android, for example.
     
    tinycarnival and Ryiah like this.
  4. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Or as an alternative, if you've got enough space - just duplicate the project and use vcs to update each of them.
     
    tinycarnival likes this.
  5. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    I have a separate build project, it builds to all platforms in one click. All I have to do is commit/push, then start the auto-build and I have an asynchronous build going on in the background. I can keep working on my project while the build is happening.