Background-only apps

Making background-only apps in Xcode used to involve modifying the internal Info.plist to create the LSUIElement property which toggles the background only bit of an app. This was done by going to “Build>Edit Active Target For…” and then going to the Expert View under Info.plist Entries to add a new sibling with a property list of LSUIElement, with a class of string, and a value of 1 (for background only) or 0 (for standard). (This info was originally taken from “Jon’s Little Page of AppleScripts”)

Anyway, I haven’t done it for a while and when I tried today I couldn’t seem to figure out how to go about it as there seems to have been some changes made in the process in the new Xcode 2.2 that I am now using.

So, my question is, could anyone please give a straight forward explanation as to how to create a background-only app in the new Xcode 2.2?

Thank you for your time and I look forward to hearing from you soon.:smiley:

With your project open in Xcode 2.2, if you are using a native project, click on the “Info.plist” file in the “Groups & Files” pane to edit the plist. In that plist, add the LSUIElement key/value pair:

<key>LSUIElement</key>
<string>1</string>

For non-native targets, the process is the same as it was in earlier versions of Xcode, just add the LSUIElement key/value pair in the expert section of the target info window.

Jon

Thank you Jon for the quick response. You’re a lifesaver. It works like a charm. (Actually, the first time I tried it didn’t work, but I realized that I had the “Project-Set Active Build Configuration” set on Debug. After changing it to “Release” it worked perfectly.)

Again, many thanks

I just tried this in an app I made in Xcode 2.4.1 and it kind of worked. The app did stay in the background but the windows of another app that I had running at the time where removed from the fore ground while the menu at the top remained that apps menu it’s windows where hidden. That seems a little weird. Any ideas on why that might happen and how to prevent it?

Ah Never mind. I figured it out. I was launching the app from a script with the term “activate” instead of the term “launch” and apparently the activate term tries to bring it to the front even though it’s a background only app. Switching to “launch” cleared up that problem. Thanks anyway.