Search Unity

Android: Faster APK creation (Experimental)

Discussion in '5.1 Beta' started by jonas-minnberg, May 23, 2015.

  1. jonas-minnberg

    jonas-minnberg

    Unity Technologies

    Joined:
    Oct 8, 2014
    Posts:
    6
    I have included support for an external tool that can pack and sign APK files faster than using the normal tools. This support is only enabled for 5.1 and is activated by copying the appropriate tool into the Unity BuildTargetTools directory.

    So if you are brave and want to experiment with faster APK creation, download the tool (fastzip) from here:

    https://drive.google.com/open?id=0B...U1VM09JbDFEdWE4VnNLOEYtN2VBRUhSS2s&authuser=1

    And copy the executable here for Mac OS X:
    <UnityBeta.app>/Contents/BuildTargetTools/AndroidPlayer/

    Or here for Windows (64 bit)
    <BetaDir>\Editor\Data\BuildTargetTools\AndroidPlayer

    Now when you Build an APK from Unity. It should say "Fastzipping everything" during the APK creation phase, and that should be relatively quick.

    This process is NOT very well tested, so if you have some issues, just remove the tool and the build should work as before again.
     
    -chris, scheichs, MrEsquire and 6 others like this.
  2. jonas-minnberg

    jonas-minnberg

    Unity Technologies

    Joined:
    Oct 8, 2014
    Posts:
    6
    Some benchmarks.

    Results from the Unity Teleporter Demo:

    Export APK from Unity. Timed from Progress Dialog open until it closes. Resulting APK ~300MB

    WINDOWS (i7 3.50GHz 8core)
    • Without Fastzip: 7:30min
    • With Fastzip: 19s
    • Constant overhead (staging area setup and moving APK) ~10s
    • Speedup: ~23x overall (actual APK creation ~48x)
    MAC OS X (i7 2.8GHz 8core)
    • Without Fastzip: 7:52min
    • With Fastzip: 30s
    • Constant overhead (staging area setup and moving APK) ~20s
    • Speedup: ~16x overall (actual APK creation ~46x)
     
    scheichs, rwetzold and larku like this.
  3. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,412
    Wow, that's some impressive improvements!

    Top work!
     
  4. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Interesting, so whats the long term plan for this, integration with a Unity final release?
     
  5. jonas-minnberg

    jonas-minnberg

    Unity Technologies

    Joined:
    Oct 8, 2014
    Posts:
    6
    Yes, but I was hoping to get some external testing first, to see how it works on real projects :)
     
    MrEsquire likes this.
  6. scheichs

    scheichs

    Joined:
    Sep 7, 2013
    Posts:
    67
    That's some really usefull development. Will try it out next week and post some benchmarks. Faster deploy/turnaround times are always welcome!
     
unityunity