xcconfig files with XCode9 for PROVISIONING_PROFILE_SPECIFIER - xcode9

Until now, we were using the xccofnig file per scheme to select the proper provisioning profiles. For example the "PROVISIONING_PROFILE_SPECIFIER" was set to different value in each of the scheme specific xcconfig file and them "xcodebuild" would just work fine by picking up the correct profile based on the xccofnig set for that scheme.
In XCode 9 this is not working and it looks like we need to set "provisioningProfiles" in exportOptionsPlist file. Does this mean that the xcconfig files can no more be used to set the correct profile anymore and we have to use this profile selection in exportOptionsPlist only?
Thanks.

Related

Debug configuration file (.xcconfig)

Is there a way of checking whether your xcode project is using the .xcconfig configuration file with which you have supplied it?
What I mean is, if there is some way of 'printing' a statement eg debugging, like #warning, #error, printf, etc...?
The reason being is that I have set up some configurations, and I feel they are not being used...
Just open the project navigator and select "Build Settings". If you have specified the config files correctly and added any setting to that file, a new column will appear, one for the xcconfig file for each target and on for the project as whole. The column to the far left is a "sum" of all you settings, and there you can verify that the settings you look for are set.
EDIT: Adding some pictures to show the columns with different config file settings.
Build settings without any property in the projects xcconfig file:
And the same with some settings in the projects xcconfig file:
The same applies for the Target as seen in the following two pictures:
No settings in the targets config file:
Some settings in the targets config file:
Check out this beginners tutorial for more visual examples and a step-by-step guide:
http://www.jontolof.com/cocoa/using-xcconfig-files-for-you-xcode-project/
Good luck!

In XCode 4 change output path and run mutiple targets

Is it possible to change the out put folder for where a target's executable and libraries are built to? Also is it possible to run more than one target at a time within XCode?
You can change where Xcode places derived data from Xcode's Locations Preferences. Choosing File > Project Settings allows you to change the derived data location for a single project.
I don't know of any way to run multiple targets simultaneously in Xcode.

How delete the config in Build Settings in a low level in XCode 4

In XCode 4.0.2 there is a good way to configure the program in Build Settings when you click in "Levels" format. Like this screen
The levels are in this way:
Target Settings
Project Settings
iOS Default Settings
So the XCode see if the Target have a config, if not see in project and if not use the iOS default.
The problem here is that when you set a config in a low level and than delete it, it's impossible use the config of a upper level.
Like in image. I set all targets to use Google in Current Project Version, but in this target I want it use stackOverflow and it work. But in the other Generated Versioning ... I first config with stackOverflow but change my mind and want to use the Project Settings. Now is impossible delete the Target Settings and I will have to enter it manually.
How can I delete the target setting to use the project setting?
In xcode 5 it worked right simple for me. I had the same situation as in the picture in the question. Some data in the project setting and an empty but green setting on target level.
You have to select the line e.g. with the mouse that is marked and afterwards press the delete button the green marking is gone from the target level. In my test it and it will never delete the setting on the highes level, so there is no risk.
Click the Combined button and change the build setting value. Now when you click the Levels button, you will see the target and project both have the new value for the build setting.
I just figured this out. It's a little sketchy, but it works, and does not feel dangerous to me (particularly if you're using version control).
In Xcode, delete the text from the target-level configuration. Make sure you still have it defined at the project level.
Look at a diff of the YourProjectName.xcodeproj/project.pbxproj so you can figure out the code-level name of the setting you just changed. For example, in Xcode, I deleted the text from my target-level configuration for "Other C Flags". My diff showed the OTHER_CFLAGS setting changing from OTHER_CFLAGS="mytargetlevelsetting" to OTHER_CFLAGS="". If you're using version control (which you should be), it'll be easy to get this diff.
Quit Xcode.
Open up YourProjectName.xcodeproj/project.pbxproj in a text editor. Find all the lines starting with the setting name you found in step 2. Delete all the ones where the value is an empty string, and keep all the rest. For example, I deleted all the lines that said OTHER_CFLAGS="", but kept all the lines that said OTHER_CFLAGS="settingiwanttokeep". If you don't see any where the value is an empty string, or all their values are empty strings, you probably didn't follow step 1.
When you reopen Xcode and look at your target's build settings again, the setting in question should be using the project-level configuration, not the target.

Xcode - How to make it use different plist file for same code base, different targets

I have a code base that I need to build out to two different targets. The only difference is they read different config.plists, config-1.plist for target #1 and config-2.plist for target #2. What do I need to do in the building to achieve this?
Like this:
Select your project from the navigator to the left
Select the target you want to change (under TARGETS)
Click "Build Settings"
Search for "Info.plist"
In the Packaging section, you should see a setting called Info.plist file.
Change that to you "config-2.plist" or whatever you want.
You also need to create the two plist-files of course.

precompiled header name gets stuck

I'm new to xcode and I must be missing something.
Create a new command-line project. Call it tempprog (for instance).
Select Project/Edit Project Settings.
Edit the name of the prefix header (tempprog_Prefixz.pch).
Build - it will fail, of course, looking for tempprog_Prefixz.pch
Now change the name of the prefix header back to tempprog_Prefix.pch.
Build again - it should work, but doesn't. It's still looking for tempprog_Prefixz.pch
Cleaning does not rectify the situation. What am I missing here? Where is the Prefixz.pch name being retained? If you look in the build output at the ProcessPCH command you can see that it still wants to use Prefixz.
It turns out there's a system of setting priorities.
From Working With Xcode Build Settings:
The levels at which build settings can be set, and their precedences are:
xcodebuild command-line flags (only applicable for command-line builds)
The target, editable via a target's Info inspector
The project, editable via a project's Info inspector
Xcode application settings, as set in Xcode > Preferences...
Xcode's built in defaults
The user environment, perhaps as set in a user's ~/.MacOSX/environment.plist file
Restarting your mac fixes the problem.

Resources