I am using the Xcode 4.2. I did not able to see any method to add Entitlements.plist in this version. So how can i do add that file in my project since i need to install my app on iPhone.
Select the target in your project and scroll down. You'll see the option to add a custom entitlement.
For creating a new entitlement, just create a new plist file from new file menu item. Change it's type to iPhone entitlements as shown below.
Related
Has anyone figured out how to add/edit values in the Info.plist of Xcode 13 yet? I see they moved the Info.plist from the navigator pane... but although I can find it, I'm not sure how to edit it.
It's a "feature."
You don't need it anymore. From the Release Notes:
Projects created from several templates no longer require configuration files such as entitlements and Info.plist files. Configure common fields in the target’s Info tab, and build settings in the project editor. These files are added to the project when additional fields are used. (68254857)
So, instead of inside Info.plist, edit properties like NSCameraUsageDescription here:
Project -> Targets -> Info -> Custom iOS Target Properties
The first time you add/edit, Xcode will automatically generate a new Info.plist file that’s kind of synced1 with Custom iOS Target Properties. Xcode will later merge them for you.
[1]: They’re not fully synced. Some properties like NSCameraUsageDescription will only appear in Custom iOS Target Properties, while Application requires iPhone environment will appear in both. I have no idea how Xcode determines this.
Want Info.plist back, completely?
You might want all of your app's properties in one place. Or maybe you don't trust Xcode with the merging. I spoke with an Apple engineer at WWDC21 about this... here's how to get the classic Info.plist back.
Create a new "Property List" file (File -> New -> File)
Name it Info.plist
Copy and paste the existing values from Project -> Targets -> Info -> Custom iOS Target Properties to Info.plist.
Copy
Paste
Note: Currently you can only select and copy 1 row at a time. If you want to save some time, here are the default contents in XML format. To use this, right-click Info.plist -> Open As -> Source Code, then paste.
Copy the path to Info.plist in the attributes inspector.
Paste the path here:
Project -> Targets -> Build Settings -> Info.plist File
Set Generate Info.plist File to No
Last step. Remove Info.plist from Copy Bundle Resources (select, then press the - button).
Project -> Targets -> Build Phases -> Copy Bundle Resources
Yep, that was a lot. But whether you want classic Info.plist or not is up to you — both are fine and won't change your app.
Xcode 13.3.1, macOS Monterey(12.0.1)
Here is the most simple solution which work for both swiftUI and Storyboard projects, if you are not able to find info.plist and want to add target properties like Privacy - Camera Usage Description and things like we can add in older Xcode version. Here is the solution...
***> Select target of you project on top of the files click on Info on
> top of the right side, now you can see "Custom iOS properties" like
> info.plist, do whatever you want.***
Target > Info
see the image below for reference
Here is a link to a raywenderlich tutorial: https://www.raywenderlich.com/19611194-multiplatform-app-tutorial-swiftui-and-xcode-12
The sample projects uses Xcode 12.0-compatible (objectVersion = 54) project format, created with the Multi Platform app template. I borrowed the plists from this project. Until the sample project is revised, it's nice to have a reference project (structure) for comparison.
This also applies to Xcode 14. To be brief, a few pieces of information about this change:
There is a good write up of the issue here:
https://useyourloaf.com/blog/xcode-13-missing-info.plist/
There is a good YouTube video (found in this page above):
https://youtu.be/mml9ZI81VKA
This issue applies to SwiftUI projects not Storyboard. Once you make
a change to the "standard" info settings, Xcode actually
automatically creates an info.plist file in your project navigator. You can then add more custom settings in the info.plist file.
I get this message from Xcode when I try to edit the xib for one of my apps.
_The document "ViewController_iPhone.xib" could not be opened. This version of Xcode does no support Auto Layout for iOS documents. Edit
this document with a newer version of Xcode.
I have Xcode version "4.4"
You may have this problem if the XIB file was originally created in Xcode version 4.5+ (current preview version as of now is 4.5). Auto Layout is a new feature that wasn't supported previously with older versions of Xcode.
Go to the developer portal and download 4.5 Preview Xcode and try that out.
Simple Solution:
Right click on .xib file -> open as "Source Code".
Find & delete object (some int/Hex) from xib source code.
Save File.
Again right click & open xib as "Interface Builder".
It will open your corrupt .xib file & u will not loss whole update in project.
Is it possible to change the name of the project? if possible, how?
What do you mean by change the name of project ? If you want to change the name that display below the icon in iPhone how screen then you can change the bundle display name in your project info.plist
If you are using Xcode 3.2.5 Use Project->Rename option to rename project. If you are using Xcode 4.2 Just simply click on project name till it appears that you can edit projectname.
Bundle display name In the main plist for the app itself. For the project, fn+click on the title (maybe twice) in the finder or in Xcode (it's safer in the finder) and it will be editable.
i have a finished application written with objective c and I would like to rename the file. how do i do that?
Recent versions of Xcode have a "Rename..." item in the Project menu.
Renaming a project has changed in Xcode 4+. (Kris Markel's answer above is for Xcode 3.2.x )
Follow these steps to rename your application in Xcode 4.0 or later:
In Xcode, select your target under "Targets" in the project editor, then choose View > Utilities > Show File Inspector.
Xcode opens the file inspector pane. Enter your application's new name in the Project Name field as shown in Figure 1, then hit the return key on your keyboard.
Xcode displays a project-rename dialog that contains all the items that can be renamed in your project. Leave your application selected in the dialog and deselect all other items as shown in Figure 2, then click Rename to perform the rename operation.
Source: iOS Developer Library Technical Q&A QA1625
I have two cocoa-touch apps in one Xcode project. Xcode gives me iPhone/iPad related options for keys in the first's Info.plist, such as "Launch Image (iPad)". But, Xcode gives me Mac OS X options for keys for the second, such as "Java classpaths" and "Quick Look preview height."
Here's how the project was built:
I created the new project as a Universal Window-based Application using Xcode, which came with a default Info.plist that translates raw plist keys like UIPrerenderedIcon to more human readable values like "Icon already includes gloss effects." All good.
In the same Xcode Project, I added a second target, also a Cocoa-Touch application, and built it from scratch, including the Info.plist file.
I've opened up the "Active Target" project settings for both apps and have exactly one "Setting Defined at This Level": Product Name. At the higher "Project Settings" level, no Product Name is defined and the Info.plist File is defined as ${EXECUTABLE_NAME}/${EXECUTABLE_NAME}-Info.plist. (Other settings, like Prefix Header, are similarly defined with variable substitution.)
Both apps build, run and use their respective Info.plist files appropriately, but Xcode still tries to give me Mac OS X Info.plist values when editing the second app's Info.plist.
How can I tell Xcode that the plist should be an iPad/iPhone Info.plist, not a Mac OS X Info.plist?
Try this: select/open the Info.plist in question, and then from the menu, do
View > Property List Type > iPhone Info.plist
for Xcode 5 there's no View -> Property List Type so the solution is to open the file, right click anywhere in it and right under Show Raw Keys/Values you'll find the Property List Type menu.
Happy coding,
Z.
I'm also curious about this. I ran into the same thing while upgrading an iPhone project for iPad, and after days of trying to figure it out, I just made a new project and reimported the custom classes. I upgraded the target and this time the keys were still for iOS.
My best guess is this is an XCode bug.