Xcodegen: Persist `Deployment Info - Devices`

Created on 27 Jul 2019  路  4Comments  路  Source: yonaskolb/XcodeGen

Is there a way currently to set from the project.yml the supported devices (i.e.: iPhone)? Every time the xcodegen command is run, devices turns back to universal value.

If not currently supported, is there a way around it?
Is it in the pipeline for the near future?

Most helpful comment

Hi @TheInkedEngineer, yes @GabrielMassana is right. In yaml the full spec would look like this

targets:
  MyApp:
    # other target properties
    settings:
      TARGETED_DEVICE_FAMILY: 1

(Note that if we don't use config specific settings, we also don't need the base)

In the future, to get answers to questions like these you can always make a change in an Xcode project that is tracked in git and then see the diff to see how Xcode wrote that change to disk 馃憤

All 4 comments

"settings": {
"base": {
"TARGETED_DEVICE_FAMILY": 1
}
}

Hi @TheInkedEngineer, yes @GabrielMassana is right. In yaml the full spec would look like this

targets:
  MyApp:
    # other target properties
    settings:
      TARGETED_DEVICE_FAMILY: 1

(Note that if we don't use config specific settings, we also don't need the base)

In the future, to get answers to questions like these you can always make a change in an Xcode project that is tracked in git and then see the diff to see how Xcode wrote that change to disk 馃憤

Given that this is a pretty core setting that many apps might set, we could potentially even add this as a built in option on target:

targets:
  MyApp:
    # other target properties
    devices: [iPhone]

This could then also accept iPad, and potentially also Mac which would set the required settings for Catalyst

@GabrielMassana thank you for the answer.
@yonaskolb thank you too, and for that tip. Didn't think about it that way. Cheers

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yonaskolb picture yonaskolb  路  3Comments

djbe picture djbe  路  6Comments

mohammdsss1 picture mohammdsss1  路  6Comments

lukewakeford picture lukewakeford  路  6Comments

brentleyjones picture brentleyjones  路  6Comments