Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by noble_brandon · Sep 14, 2016 at 12:37 PM · iosassetbundlexcodeassetbundlesasset bundle

AssetBundleManager - what asset bundle URL to specify for iOS (Xcode simulator, Testflight, Appstore)?

Hello,

For my Unity project that is targeting iOS, I'm attempting to use the Asset Bundle functionality with the AssetBundleManager helper (https://www.assetstore.unity3d.com/en/#!/content/45836). My intent is to have a couple of add on scenes available as app bundles (On Demand Resources in iOS) to reduce the initial app size, and only have them downloaded by the user when unlocked within the app. I've got it working as expected from the editor but I feel like I'm missing something simple to set this up to work from the device simulator in XCode, Test Flight, and the app store.

I've basically just plugged in AssetBundleManager as is, tagged some scenes, generated the asset bundles, and run from the Unity editor using the "Local AssetBundle Server" option. I'm not using Simulation Mode nor putting my assets in StreamingAssets folder. I've created a resource collector based on the tutorial here (https://blogs.unity3d.com/2015/11/26/mastering-on-demand-resources-for-apple-platforms/) that adds my bundles to the iOS Xcode project when I build for that player.

This all works great as expected in the editor: loading the scene from the local server using the LoadLevelAsync call in the AssetBundleManager class loads it from that bundle. So I'm ready to test the asset bundle loading running from my Unity iOS project in XCode. In the bundle loading initialization code there is a spot for specifying the source bundle URL. What should this be set to if I'm not using streaming assets or deploying to my own http web server? I just want to test it from the simulator in Xcode using localhost, as well as have it work on TestFlight and the app store using those remote URLs.

 // Use the following code if AssetBundles are embedded in the project for example via StreamingAssets folder etc:
         //AssetBundleManager.SetSourceAssetBundleURL(Application.streamingAssetsPath + "/");
         // Or customize the URL based on your deployment or configuration
         //AssetBundleManager.SetSourceAssetBundleURL("http://www.MyWebsite/MyAssetBundles");

If I don't set that URL when downloading the asset bundle manifest immediately it obviously builds an invalid URL, with the AssetBundleManager logging this error:

Failed downloading bundle iOS from iOS: unsupported URL

Is there a nice way I can configure this to be handled for simulator development as well as test and production deployment? My Xcode project is set with "Embed Asset Packs in Product Bundle" to true, and I have the "Asset Pack Manifest URL Prefix" set to the default empty string. I notice that my resources after building the Xcode project are stored here with these settings, which seems right.

/$HOME/Library/Developer/Xcode/DerivedData/Unity-iPhone-gepcjqmzrhbprfhlfinpkhzebhuy/Build/Products/Release-iphonesimulator/OnDemandResources/

There is an AssetPackManifestTemplate.plist in the simulator app bundle that provides the local URLs to the asset bundles, but I'm assuming I don't want to use this as my asset bundle URL, since it'll differ in Test Flight and the app store.

Example:

http://127.0.0.1/$HOME/Library/Developer/Xcode/DerivedData/Unity-iPhone-gepcjqmzrhbprfhlfinpkhzebhuy/Build/Products/Release-iphonesimulator/OnDemandResources/blah.assetpack

I figure someone has this working at least in the simulator so it's probably something obvious I'm missing or misunderstanding. Thanks!

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image helios · Nov 06, 2016 at 09:29 PM 0
Share

@noble_brandon Were you able to resolve this? I'm having similar issues. I don't know how to test things properly outside of "simulation." Using the same resources you are, and my tags are properly set. I get Failed to open archive "res://iOS/iOS"

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Is there a scene count limit for asset bundles? 0 Answers

Assetbundle memory leaks 0 Answers

Loading asset from an asset bundle crashes on ios. 1 Answer

IOS build from unity 2017.1.2 and use the unity trash dash package and the game is not running on iphone 5s and game is stuck and not access the assetbundle on IOS ? 0 Answers

Loading different bundles give me a null exception 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges