Change XCode Target > Build Settings > Architecture from Podfile or such

Hi,

I'm running a CD/CI pipeline with Gitlab which builds and deploy a flutter app via a mac mini M1.

Recently we have upgraded xcode to 12.5.1 and our flutter app from v1 to v2, which involved a painful amount of dependencies upgrade.

This upgrade has created some issues only on computer with M1 chip.

As much as we have fixed most of the issue, 1 remaing is fixable ONLY by manually changing the Target > Build Settings > Architecture from ARCHS_STANDARDS to 'arm64' only.

Because each time we deploy a new instance of XCode is created, we can't manually make this change and we need to make it from the code.

I've applied this into my Podfile:

post_install do |installer|
    installer.pods_project.targets.each do |target|
       flutter_additional_ios_build_settings(target)
       target.build_configurations.each do |config|
          config.build_settings['ARCHS'] = 'arm64'
       end
    end
end

but unfortunately it doesn't force the ARCHS to change to arm64. Is there a way to do that from the Podfile or any other files in the code?

Thanks Matt

The snippet of code above doesn't seem to be doing anything. So, I was able to make a change to the project.pbxproj by changing the Architectures inside xcode.

By adding all 'arm64' instead of Architecture Standard, project.pbxproj had ARCHS added to the buildSettings:

buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ARCHS = arm64;
....

but when I run my pipeline, XCode doesn't seem to care what is the setup for buildSettings inside project.pbxproj, and I don't know why. Is there anyone who knows how to change Architecture via any snippet of code? Thanks

Change XCode Target > Build Settings > Architecture from Podfile or such
 
 
Q