Archive for category XCode

Xcode 8 Changes #2

I started updating an older project to build in Xcode 8.  I very quickly ran into these error messages:

– <Product_Name> requires a provisioning profile. Select a provisioning profile for the “Debug” build configuration in the project editor. – “Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly. – Code signing is required for product type ‘Application’ in SDK ‘iOS 10.0’

The center message was quickly corrected in project “Build Settings” tab by setting “Use Legacy Swift Language Version” to YES.

As I began to work on the signing and provisioning profile messages, this message began to appear:

Provisioning profile “iOS Team Provisioning Profile: <profile_name>” is Xcode managed, but signing settings require a manually managed profile.

I searched for variations on this string, but turned up nothing.  (That’s when I knew I needed to write a blog post about it.)

As it turned out, there is a release note about Xcode and manual settings:

The signing system has been rewritten to include a new mode for automatically managing signing assets, in addition to a dedicated manual mode where the profiles for the target must be explicitly selected. When automatically managing signing assets, Xcode will create signing certificates, update app IDs, and create provisioning profiles. For manual mode, only custom created profiles can be selected and Xcode will not modify or create any signing assets.
Xcode now encodes profiles in the target using the PROVISIONING_PROFILE_SPECIFIER build setting. This setting allows specifying both the team ID and the name or identifier of the profile. (23992778)

After searching and trying out different things,  I found that having the signing identity set to a specific identity instead of “Automatic” is what required the manual provisioning profile.

But in the end, a StackOverflow article gave me what I really needed:  The “General” tab of the project now has entries for signing.  If you just set them to “automatic” the signing-related problems cleared up.

Let me know if that helped you.

Finding Xcode’s Predefined Macros for iOS Devices (updated)

Update to my old post:…or-ios-devices

To find the iOS predefined macros For Xcode 6, type this into the terminal:

llvm-gcc -arch armv7 -dM -E – < /dev/null | sort

(Yes, there is a single dash by itself.)
Change the -arch option to “armv6” or “armv7” or “armv7s” as needed.


Xcode 4.3.2 pains and tips 1

So far, XCode 4.3.2 has been irritating.  It crashes far too often.  But here is some of what I’ve learned:

Get a funny response from copy and paste in Xcode? Strange response from Xcode from undo?  Did the change not appear in Xcode?  Did lines disappear from Xcode?

These kinds of things usually indicate that a crash will be happening soon.

Sometimes I can recover by changing to another file, then changing back. This does seem to help keep Xcode running.

My editing habits probably contributed a little. I tend to scroll around, then use undo-redo in quick succession as a way to go back to where I was in the file.  Usually this was fine in previous versions, but Xcode 4.3.2 seems to crash a lot right after I do this.



IDE Feature Wish List – Spell Check Comments

More things for the IDE (Integrated Development Environment).  Xcode is the one I use for iPhone development,  so hint, hint Apple.

 Check Spelling Inside Comments
This a useful feature, really.  I often use the TextEdit application that came with my Mac and it will auto-correct while I type.  On average, this is a big plus when my fingers get a little out of order and transpose two letters.
Since the comments are about the written communication from one human developer to other human developers, having spell-check is really important.
See my previous posts that talk about having comments written in RTF so we can communicate with more than plain text.  (Why are we still stuck with plain-text source files in 2012?)

Tags: , ,

IDE Feature Wish List – Comments in Project File

More things for the IDE (Integrated Development Environment).  Xcode is the one I use for iPhone development,  so hint, hint Apple.

Provide space to comment settings provided to the compiler by the IDE.

We can specify compiler macros and such in lots of IDEs. One example is a preprocessor flag named “DEBUG”.  Yet there may be definitions for preprocessor macros that do not explain themselves.  A deliberately bad example may be  “MAKEOBSCUREOPERATIONSALLOWED”.

If there is a place in your work where you as “why did someone do that?” then you have a need for more information.  And that information should travel with the thing it describes, not in some separate file where it may be lost (or never found).

If there is a slot to make a decision (especially a decision for another file), then there needs to be a slot to record the reason for the decision.

Tags: ,

Finding Xcode’s Pre-defined Macros for iOS Devices

I regret not making better notes about exactly why I was looking for a full list of the pre-defined macros Apple made available for iOS development.  I usually like starting an entry talking about why I was trying to solve a particular problem.  While I made a note to write up what I found, I did not note why I needed it at the time.  Assuming you are reading this because you need or might need such a thing, I’ll write on.

Some of the pre-defined macros are published in Apple’s documentation, but not all.  (Well, as far as I remember anyway.)  I feel the most confident that I didn’t miss one that could solve a problem when I get the list from the compiler itself.

While searching the internet I found instructions to use

I changed ‘i386’ to ‘armv6’ and ‘armv7’ but that failed on my setup.  I don’t really know if I messed something up in the /Developer folder or if this line just generally won’t work for ARM.

The error message mentioned a missing file and after finding it, I changed the above command to this:

For Xcode 3.2.5:

For Xcode 4.2.1

Change the “armv6” to “armv7” and vice-versa as needed.

Tags: , , , , ,

Fix to Symbolicate System Symbols in iOS 5.0.1 (9A405) Crash Logs

I found this one many weeks back and had it in my to-do list for the blog.  Now that 5.1 is out, I feel guilty I didn’t write it up sooner.  But then, my day job is keeping me very busy.

I had a long period where I could not fully symbolicate crash logs that were made by iOS 5.0.1 devices.  The symbols of my app would be symbolicated, but the system symbols of the device would not.  I was especially frustrated because a coworker with the exact same version of XCode could symbolicate those system symbols with no problem.  Neither of us knew why.

After a huge amount of searching with Google and reading items on,  I finally found a note saying the symbols in the iPhone 4S were corrupted somehow and they should be replaced with symbols from another device.  I don’t know if there was a problem with all the iPhone 4S devices, or just some of them or just early ones.

As much as I tried to do this,  I still could not symbolicate properly.  I triple-searched my computer for all copies of symbols for 5.0.1 (9A405) and removed them.  (You can compress them into .zip files if you want to keep them just in case.)

What I needed to know was to look in ~/Library/Developer/Xcode/iOS DeviceSupport   Xcode 4.2 had been putting device symbol information in there.  Once I got rid of that folder, and attached a device, XCode pulled a new copy of the symbols and symbolication worked like a charm.

Top top it all off,  something about the symbolication script in XCode 4.2 works better than any of the previous symbolication scripts, either from Apple or from any developer site.  While symbolication inside XCode can be horribly slow, it does work pretty well.

Hope that helps

Tags: , ,

XCode 4 – Stopping in the Debugger on NSAssert

I’m not sure if XCode 4 makes this technique unnecessary. Since I originally wrote this, I’ve seen XCode 4.0.2 stop at NSAssert on its own, without me setting this breakpoint. But it may be helpful to someone somehow. So here it is:

Xcode 3: Run Menu -> “Manage Breakpoints”
XCode 4: Go to the breakpoint navigator.

Click the + button at the bottom of the navigator, select “Add Symbolic Breakpoint…” from the contextual menu that appears.

In the “Symbol” box, enter

Then click “Done”. (NOTE: this is the default assertion handler. If you are using a custom assertion handler, you probably need to specify a symbol for its object and method.)

Now execution will break immediately on assertion failure. And very usefully, XCode shows the nearest source code of the stack, not the assembly of the assertion handler.

Tags: ,

XCode 4: Conversion Problem

Did you try to build your project in XCode 4 for the first time and get an error that starts with “There is no SDK with the name or path”?

That happened to me recently.  And the path given in the message had nothing to do with SDK’s.  In fact it was an open-source sub-project I was using.

I Googled for the answer, but mostly just found references to posts on how to fix actual SDK path problems.

It turned out that the problem was how XCode 4 looked at the sub-project.  Somehow, XCode 4 had noticed a missing Base SDK, had a static library as the product, and assumed it was a Mac OS X project.

I closed the project and opened the sub-project directly.  I corrected the project settings back to iOS and it built correctly. Closing and going back to the first project, the build now built correctly (with some warnings that I did not recall from XCode 3.)