How to delete user-defined build settings in Xcode 4.3.1
Asked Answered
I

7

52

I have created several user-defined build settings in Xcode 4.3.1. I no longer need these settings and want to delete them, but there doesn't seem to be a way to delete them!

I am aware that these are stored in the project settings (project.pbxproj) file located within the xcodeproj file. But I don't want to edit these in a text editor as there are all sorts of repetitions and guids which I don't understand.

Any suggestions on how I can do this within Xcode? (or have they forgotten to add a "delete" button)

Imparadise answered 16/4, 2012 at 7:51 Comment(2)
Dup of #5350938Entrance
I don't think so. That answer doesn't work for user-defined build settings.Imparadise
D
76

Just figured this out myself: you need to make sure you're at the right scope to be able to delete the setting. If you defined the setting at the project scope, no amount of key-bashing will remove it if you're looking at the target-scope. Remember, targets inherit settings from project scope. That last bit is what I tripped over :)

Dulsea answered 16/5, 2012 at 23:36 Comment(3)
You can tell if it's the right scope by examining the setting. If it's bold then you're in the right place and can go ahead and delete. Otherwise, if the setting font appears normal, then the setting has been set elsewhere and inherited.Band
Selecting Levels rather than Combined really helps for finding where a setting is coming from.Brightwork
Once you find the right scope (selecting Levels as indicated by funroll) pressing 'delete' won't work. Instead, double-click the identifier to open the editor and then use the delete keyStrategy
L
51

Try selecting a user-defined setting that you created then hit "Delete" button on your keyboard. That works for me when I encountered the same problem.

Luz answered 23/8, 2013 at 9:19 Comment(2)
No, you have to be at the right scope to delete the setting. Brian's answer is correct.Blinker
Well, I found this valuable... since right-click had no "DELETE" and there was no minus-sign-shaped button near the plus-sign. :)Diffluent
N
19

On Xcode 6:
Select the row and hit Fn + Delete.

Nasty answered 27/2, 2015 at 10:52 Comment(1)
Thanks, this works but it really has to be on the project level. On target level it won't work if it inherits from the project, i.e., it won't disappear even after you hit the Fn + Delete. Good thing is that the UI will imply that it's an inherited field (the filed name would be in bold if it were the source).Tiemannite
C
8

Follow the steps below:

  1. Select Project
  2. Tap on the Info tab
  3. Select Configurations
  4. Select Configuration to remove
  5. Press the Delete button on the keyboard
Camire answered 13/2, 2017 at 4:39 Comment(1)
Deleting User-defined build configuration can be done in the same steps on Xcode 12.3 too.Proverbial
C
4

Removing User-Defined build settings depends on where those settings have been created.

Lets assume that you've created one already and named it as PROJECT_SETTING. In order to check your PROJECT related User-Defined settings, you have to select your project first on the project and targets list, then you should see something like this:

enter image description here

Here you can see only PROJECT related settings, and here you have the only ability edit/delete PROJECT_SETTING.

Besides that if you set up a TARGET, so can add new User-Defined settings there, that only affects that TARGET scope.

enter image description here

You can edit/delete TARGET_SETTING_1 and TARGET_SETTING_2 here, but PROJECT_SETTING is read-only, as it is inherited from your PROJECT settings.

Here you will notice that your TARGET contains your PROJECT User-Defined settings and also your TARGET related User-Defined settings marked as bold letters. This helps you to know which setting can be edited on this level.

You won't be able to delete your settings here if that was created under PROJECT scope, and also editing a PROJECT related User-Defined settings will result a newly created settings that affects only the selected TARGET.

Also if you prefer more visibility on Build Settings, you can select Levels view instead of Combined view, so you should see it more separated:

enter image description here

Colobus answered 20/4, 2017 at 6:25 Comment(0)
G
2

Select one of them and press keyboard's delete button.

Gilmagilman answered 17/2, 2019 at 10:49 Comment(0)
S
0

There's a caveat to these answers: If you're using a Build Configuration File (.xcconfig) it doesn't seem possible to delete the user-defined settings generated from these files directly on either the project or target level in the "Build Settings" GUI. You'll have to delete the flag and its value from the configuration file and rebuild the project. If you're using multiple build configuration files that use the same flag, you'll have to delete them from each file.

Although settings that come from these configuration files are displayed in the User Defined build settings section (just like any other user-defined flag that one would create from the GUI), they are not written to the .xcodeproj file like the settings that one adds from the GUI are (which probably prevents them from being able to be deleted from the GUI). They are also not displayed in bold text like these GUI-added settings are.

Salleysalli answered 26/6, 2020 at 3:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.