Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Is it possible to get bundles from Android and iOS builds?

Discussion in 'Unity Build Automation' started by chatpongs, Jul 15, 2016.

  1. chatpongs

    chatpongs

    Joined:
    Mar 2, 2015
    Posts:
    24
    There is an option to build asset bundles and copy them to StreamingAssets folder. In my case, I do not want to put the bundles inside the build, but want to grab them and upload them to my server instead. Is it possible to do so? Because if I choose to build but do not copy, I cannot find it anywhere in the downloadable file (apk or ipa)
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    You said that you don't want the bundles to be included into your game (apk or ipa).

    You can deliver asset bundles as part of your initial game download, or download them from a remote server at runtime (or a mix of both, of course).
     
  3. chatpongs

    chatpongs

    Joined:
    Mar 2, 2015
    Posts:
    24
    Thank you and sorry that I didn't mention clearly. The problem I have is with Unity Cloud Build service. As it let me choose to automatically build and copy the bundles into StreamingAssets folder, once the building process is done, I can get an IPA or an APK with the bundles inside it. But what I want is to download the bundles separately and upload them to my remote server.
     
  4. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    The option in Unity cloud build will automatically build all asset bundles in your project and include them under StreamingAssets.

    Note that (as far as i remember), it builds uncompressed asset bundles (which result in a larger file size).

    You may be able to achieve what you want by unchecking the "build asset bundles" step in Unity cloud build, and have your own custom build step that executes post build. This build step will build all asset bundles and then copy them to the same path as your APK / .IPA. I am not sure it will work but worth trying...
     
  5. chatpongs

    chatpongs

    Joined:
    Mar 2, 2015
    Posts:
    24
    Thanks, custom build step is a good idea, I will try that. Anyway, the download button in Cloud Build dashboard is pointing directly to the APK / IPA. It seems no way to download the bundles even they are in the same path with the APK / IPA. Hope there will be a workaround
     
  6. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Did you try that? I know that for WebGL builds you get a link to a .zip file that contains the build output (since the output contains a folder with more than 1 file).

    I assumed that if you place more files in the output folder it will let you download all of them.

    Another option is to use the new "Notifications" system. It's basically an API that allows you to call into other web services at various build stages. It may be possible to do something like uploading generated files to some storage service (Google drive, Dropbox, etc).

    If this doesn't work you may be able to have a PostProcessBuild step that will upload the files for you (instead of relying on the "Notifications" i mentioned).

    Anyway, the easiest solution would be built-in support in cloud build :)
     
  7. chatpongs

    chatpongs

    Joined:
    Mar 2, 2015
    Posts:
    24
    tonialatalo likes this.