Search Unity

Question -buildTarget command line argument

Discussion in 'Editor & General Support' started by hugeandy, Jul 23, 2021.

  1. hugeandy

    hugeandy

    Joined:
    Nov 2, 2016
    Posts:
    131
    Hi,

    I'm trying to start Unity in batch mode and then switch the build target. I found
    EditorUserBuildSettings.SwitchActiveBuildTarget
    but see that this doesn't operate correctly in batch mode. I then found that you can feed in the
    -buildTarget
    option in the command line args to do just this.

    Strangely, the values you have to pass into this do no match the BuildTarget enum. Our build pipeline uses the BuildTarget enum to define what target is being built, so it's a total pain that we now need a lookup table of BuildTarget to -buildTarget. Does Unity provide a method to convert between the two, or is this something we need to make and maintain ourselves?

    Secondly, the docs have an incomplete list of possible options (Standalone, Win, Win64, OSXUniversal, Linux64, iOS, Android, WebGL, XboxOne, PS4, WindowsStoreApps, Switch, tvOS). What are the values for Game Core Xbox One/Series X?

    Cheers,
    Andy
     
    allyn_alves likes this.
  2. allyn_alves

    allyn_alves

    Joined:
    Jan 15, 2022
    Posts:
    18
    I think GameCoreScarlett or GameCoreXboxOne should work