Sync Asset Bundles from Unity Cloud to S3

Hello.

What is the recommended approach to uploading asset bundles built with Unity Cloud to Amazon S3?

After looking through the documentation and forums, I see some people asking similar questions, but the way to do this is unclear to me.

I’ve successfully built the asset bundles with Unity Cloud. Looking at the logs, the asset bundles are output to ‘AssetBundles/iOS/…’, but I’m not sure how to handle the next step.

  • I originally tried to integrate the AWS Mobile SDK and perform the s3 sync via PostProcessBuild or Post-Export Method, but I had issues getting the AWS SDK to run in the Unity Editor. It also was a LOT of code and dependencies to add to our project, just for the purpose of syncing assets during the build process, so I wanted to avoid this.

  • My current thought is to have a separate service running (on heroku for example), which will download the asset bundles from ‘AssetBundles/iOS/…’ and then perform an s3 sync. Does this seem like a valid approach? One thing I am stuck on with this approach is how to actually access the asset bundle contents of the cloud build at ‘AssetBundles/iOS/…’ from a remote server. I don’t see any documentation about this. I guess another approach would be to zip up the files in Post-Export, and POST them to my remote server, then the remote server unzips and does the sync… hmm…

Ideally this will be something that Unity will support in the near future (;)), but until then, any guidance would be super helpful.

Thanks.

Currently, asset bundles are just copied to StreamingAssets/ as part of the build and aren’t being hosted independently, so there would be no way to get them through the API.

If you want to go the post-export route, you will need to make sure that all of your requests are synchronous. I have not tested this myself, but I would probably recommend using the .NET HTTP classes to make synchronous requests to upload the asset bundles to your server and have the server do the sync.

Ok, thanks for the reply. I’ll try that method and see what happens.

I’m assuming it’s just functionality that you guys haven’t gotten to yet, but count it as a feature request! :slight_smile: It looks like you’re already hosting the built IPA on S3, so giving us some hooks to directly sync our assets to S3 would be a welcome addition.

Thanks again.