-
Notifications
You must be signed in to change notification settings - Fork 514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Device specific build: actool --filter-for-device-model #13116
Comments
I believe Apple calls this "modelIdentifer" here: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/DeviceTypes/iPhone 13.simdevicetype/Contents/Resources/profile.plist
|
Thanks for the feedback. TargetiOSDevice is set by the IDE (VS or VSfM) based upon the device selector. This seems to be a case where TargetiOSDevice is being incorrectly set, but I'm having real difficulty reproducing your issue. Could you please provide concrete steps to reproduce your issue? |
Use Visual Studio Mac
_Target CoreCompileImageAssets:
--filter-for-device-model iPod touch (7th generation) Actual value for --filter-for-device-model is iPod. It is obviously not valid. There is no model with such an identifier:
That means that resulting app bundle has all image assets instead of applicable for ipod 7gen only. besides that 3 junk extra parameters passed
|
So, VS for MAC (haven't checked on windows) reports wrong value for "model" key in $(TargetiOSDevice) plist if it simulator - kind of human friendly model name. For real devices it reports model identifier - that should be an input for actool. |
I am able to confirm this issue now. Thanks for the steps to reproduce! |
As a concrete example: This fails, and is what VSfM executes by default:
And changing it to |
As this is an IDE issue, I've filed an internal bug. I will leave this open for now as a public facing record. |
Preamble
actool (_CoreCompileImageAssets, ACTookTask) is called with "--filter-for-device-model" whenever project has "device specific build" option enabled.
The value for the option is extracted from $(TargetiOSDevice) build property. I guess it is provided to msbuild by IDE.
Reference from man:
If your target is physical device that call looks like this:
$(TargetiOSDevice)
actool --errors --warnings --notices --output-format xml1 --output-partial-info-plist /Users/Yauheni/Projects/assetclone/assetclone/obj/iPhone/Debug/device-builds/iphone8.1-13.6/actool/partial-info.plist --app-icon AppIcon --compress-pngs --filter-for-device-model iPhone8,1 --filter-for-device-os-version 13.6 --target-device iphone --target-device ipad --minimum-deployment-target 13.0 --platform iphoneos --compile /Users/Yauheni/Projects/assetclone/assetclone/obj/iPhone/Debug/device-builds/iphone8.1-13.6/actool/bundle /Users/Yauheni/Projects/assetclone/assetclone/obj/iPhone/Debug/device-builds/iphone8.1-13.6/actool/cloned-assets/Assets.xcassets
If your target device is simulator you get following:
$(TargetiOSDevice)
actool --errors --warnings --notices --output-format xml1 --output-partial-info-plist "/Users/Yauheni/Projects/assetclone/assetclone/obj/iPhoneSimulator/Debug/device-builds/iphone 13-15.0/actool/partial-info.plist" --app-icon AppIcon --compress-pngs --filter-for-device-model iPhone 13 --filter-for-device-os-version 15.0 --target-device iphone --target-device ipad --minimum-deployment-target 13.0 --platform iphonesimulator --compile "/Users/Yauheni/Projects/assetclone/assetclone/obj/iPhoneSimulator/Debug/device-builds/iphone 13-15.0/actool/bundle" "/Users/Yauheni/Projects/assetclone/assetclone/obj/iPhoneSimulator/Debug/device-builds/iphone 13-15.0/actool/cloned-assets/Assets.xcassets"
Problems
Value is not quoted
--filter-for-device-model iPhone 13
this causes following error which can be observed in asset-manifest.plist (output of actool)
At first we supplied "iPhone" instead of "iPhone 13" to the --filter-for-device-model parameter. So the system can not get any traits for such a device.
At second we supplied extra "13" parameter. That is tried to be proceed as input file for actool, and actool can not find it.
Value is wrong itself
"iPhone 13" human friendly string is not what actool expects. It expects device model code iPhone14,5 instead. Passing wrong value leads to "Could not get trait set for device iPhone with version 15.0" warning. That makes impossible to test assets thinning, assets are not filtered.
I don't know exactly how $(TargetiOSDevice) plist is populated. By its model key should be set to code instead of name.
The text was updated successfully, but these errors were encountered: