Post

Replies

Boosts

Views

Activity

Updating background asset packs during development
Hi all, I am trying to ensure that my code works correctly when updating asset packs. It appears to be more of a hassle than I expected, so I am not sure whether I am missing something. My question broadly is, how is the update flow expected to work, during development and during production? More specifically: Are we generally expected to let the system run the update? Will it update while the app is running and can it interfere somehow (see next point)? When serving with xcrun ba-serve --asset-pack-versions, is a call to contents(at:searchingInAssetPackWithID:options:) after updating a pack with ensureLocalAvailability(of: ..., requireLatestVersion: true) expected to work? For me it almost always throws an "Operation not permitted" error with "The file ... couldn’t be opened because you don’t have permission to view it.". Repeated delayed attempts also throw. I can see from the status update that the download completes before I call contents(at:searchingInAssetPackWithID:options:) and when I check the daemon container contents I can see that the pack has been downloaded & extracted and the file I tried to get the contents of is there. It does work after I quit and relaunch the app. This is both on the macOS dev machine and on an iOS device. I also tried to use the Xcode 27 run scheme option to serve asset packs from a folder. It looks a lot more convenient than going through the certificate hoops for testing with xcrun ba-serve. Unfortunately, I cannot find an equivalent of --asset-pack-versions and the Xcode machinery does not appear to detect changes in the packs to bump versions automatically. How is this supposed to work? Is there a way to bump versions manually in order to test pack updates with the Xcode 27 scheme option? Is there a way to properly purge the local asset pack storage during development? I mean outside the app, not programmatically. If not, it appears that with the Xcode 27 scheme option, I can only add packs, never change any without deleting them in the app first. I tried to delete the Daemon Container directory that stores the downloaded packs on macOS. It worked once in that the app was able to download the updated packs afterwards into a fresh daemon container. The other times I tried, however, it was stuck. While a new daemon container showed up, packs were downloaded into the "Asset Packs" folder next to the Manifest.json but the .aar just sat there unextracted so it was not possible anymore to access any pack content in the app. Only a system restart fixed it. I also tried to kill some of the processes that sound like they belong to the background asset machinery, but that didn't fix anything.
1
0
62
1d
Apple-hosted managed asset pack not found on macOS
Hi all, I have set up a trivial test project to try Apple-hosted background assets following the instructions in the three articles at https://developer.apple.com/documentation/backgroundassets. When I run the local mock server with xcrun ba-serve and set the URL override in Settings as described in the "Testing asset packs locally" article, I am able to download a test pack on my iOS devices. On the Mac that I use to run the mock server, however, the same call to AssetPackManager.shared.assetPack(withID: "TestAssetPack") that works on iOS always reports The asset pack with the ID “TestAssetPack” couldn’t be looked up: No asset pack with the ID “TestAssetPack” was found. even when not running the mock server, which led me to believe that it may not be hitting it at all. In fact, the macOS app will download asset packs uploaded to App Store Connect even when running the local server and setting the xcrun ba-serve url-override to the exact same string as in Settings on iOS. My initial suspicion was that something is wrong with the URL override, so I have tried all combinations of the Mac's hostname, IP address or "localhost" (with the corresponding SSL certificates) with and without port 443, always prefixing with "https://" for the url-override. All the same. Does anyone have an idea what may be the issue here? My asset pack has the following manifest: { "assetPackID": "TestAssetPack", "downloadPolicy": { "onDemand": {} }, "fileSelectors": [ { "file": "TestAsset.txt" } ], "platforms": [ "iOS", "macOS" ] } I am running v26.1 for macOS, iOS & Xcode. Edit: Just to be clear, my assumption here is that the URL overrides (in Settings on iOS or via ba-serve on macOS) is what should cause the app to hit the mock server. Is that correct or am I missing something?
12
0
1k
Mar ’26
Updating background asset packs during development
Hi all, I am trying to ensure that my code works correctly when updating asset packs. It appears to be more of a hassle than I expected, so I am not sure whether I am missing something. My question broadly is, how is the update flow expected to work, during development and during production? More specifically: Are we generally expected to let the system run the update? Will it update while the app is running and can it interfere somehow (see next point)? When serving with xcrun ba-serve --asset-pack-versions, is a call to contents(at:searchingInAssetPackWithID:options:) after updating a pack with ensureLocalAvailability(of: ..., requireLatestVersion: true) expected to work? For me it almost always throws an "Operation not permitted" error with "The file ... couldn’t be opened because you don’t have permission to view it.". Repeated delayed attempts also throw. I can see from the status update that the download completes before I call contents(at:searchingInAssetPackWithID:options:) and when I check the daemon container contents I can see that the pack has been downloaded & extracted and the file I tried to get the contents of is there. It does work after I quit and relaunch the app. This is both on the macOS dev machine and on an iOS device. I also tried to use the Xcode 27 run scheme option to serve asset packs from a folder. It looks a lot more convenient than going through the certificate hoops for testing with xcrun ba-serve. Unfortunately, I cannot find an equivalent of --asset-pack-versions and the Xcode machinery does not appear to detect changes in the packs to bump versions automatically. How is this supposed to work? Is there a way to bump versions manually in order to test pack updates with the Xcode 27 scheme option? Is there a way to properly purge the local asset pack storage during development? I mean outside the app, not programmatically. If not, it appears that with the Xcode 27 scheme option, I can only add packs, never change any without deleting them in the app first. I tried to delete the Daemon Container directory that stores the downloaded packs on macOS. It worked once in that the app was able to download the updated packs afterwards into a fresh daemon container. The other times I tried, however, it was stuck. While a new daemon container showed up, packs were downloaded into the "Asset Packs" folder next to the Manifest.json but the .aar just sat there unextracted so it was not possible anymore to access any pack content in the app. Only a system restart fixed it. I also tried to kill some of the processes that sound like they belong to the background asset machinery, but that didn't fix anything.
Replies
1
Boosts
0
Views
62
Activity
1d
Apple-hosted managed asset pack not found on macOS
Hi all, I have set up a trivial test project to try Apple-hosted background assets following the instructions in the three articles at https://developer.apple.com/documentation/backgroundassets. When I run the local mock server with xcrun ba-serve and set the URL override in Settings as described in the "Testing asset packs locally" article, I am able to download a test pack on my iOS devices. On the Mac that I use to run the mock server, however, the same call to AssetPackManager.shared.assetPack(withID: "TestAssetPack") that works on iOS always reports The asset pack with the ID “TestAssetPack” couldn’t be looked up: No asset pack with the ID “TestAssetPack” was found. even when not running the mock server, which led me to believe that it may not be hitting it at all. In fact, the macOS app will download asset packs uploaded to App Store Connect even when running the local server and setting the xcrun ba-serve url-override to the exact same string as in Settings on iOS. My initial suspicion was that something is wrong with the URL override, so I have tried all combinations of the Mac's hostname, IP address or "localhost" (with the corresponding SSL certificates) with and without port 443, always prefixing with "https://" for the url-override. All the same. Does anyone have an idea what may be the issue here? My asset pack has the following manifest: { "assetPackID": "TestAssetPack", "downloadPolicy": { "onDemand": {} }, "fileSelectors": [ { "file": "TestAsset.txt" } ], "platforms": [ "iOS", "macOS" ] } I am running v26.1 for macOS, iOS & Xcode. Edit: Just to be clear, my assumption here is that the URL overrides (in Settings on iOS or via ba-serve on macOS) is what should cause the app to hit the mock server. Is that correct or am I missing something?
Replies
12
Boosts
0
Views
1k
Activity
Mar ’26