No "Distribution" setting in latest Xcode? - iphone

For some reason, a choice for "Distribution" configuration is not showing up for building an app in the latest Xcode 3.2.2 with iPhone SDK 3.2 when I'm trying to build an app for the iPad
Any one else seeing this? I can set it to "Debug" or "Release" but there isn't even an option for Distribution.

Double Click on the .xcodeproj icon in the left pane, I believe called Groups & Files. Then, In the Configuration Tab, duplicate the "Release" and rename it "Distribution".

You add it yourself. Duplicate the Release config.

Related

How to ignore some static library for iOS simulator

I am trying to build my project for sdk iphoneos and iphonesimulator. There are few .a static libraries that can only be utilized for iphoneos. Where can I go an ignore these files if its being build for iphonesimulator within XCode?
Thanks.
Instead of hard linking the libraries, use the "Other Linker Flags" setting in the project configuration settings. You'll be able to link different versions of libraries based on the current build configuration.
By default you already have Debug and Release build configuration, press the "plus" button on the Debug will add a configuration for a specific architecture. Choose "Any iOS Simulator" and link the libraries you would like to use to run the app on simulator. Then press the "plus" button on the Debug again, this time choose "Any iOS" and link the libraries you would like to use to run the app on the device.
Lastly, do the same thing for the Release configuration.
You can set two targets, one for simulator and one for device, and in the simulator target settings (Build Phases -> Link Binary With Libraries) remove the unwanted *.a files
I just had this issue and I solved by creating a new target just for the simulator.
At the new target you can go to the target settings -> build phases -> link binary with libraries and removed the static library just for that target.
Also make sure you do not include the files from the static library by using the TARGET_IPHONE_SIMULATOR macro for checking, just as #MDT did.

There is no "share" button in Xcode 4.3 organizer

I have a valid Apple iOS dev account and all provision profiles set. I can debug the application on my iPhone. But when I do Product -> Archive and went to the organizer, there is only a "Validate..." and "Distribute..." button.
Clicking the "Distribute..." button only provides me with "Save built products" and "Save Xcode archive" which both doesn't contains any "IPA" file.
There is however an "MyApp.app" file built. I'm not sure what to do about it though.
Suggestions?
In short: Make sure you have configured all linked libraries with "Skip Install" to "YES" in the build settings screen. There are a few detailed instruction on how to do that here on SO.
Failing that, clicking on "Validate..." should clue you in to any potential fixes.
So, I just set-up my machine and somehow on one of a library project "Skip Install" was reverted to "NO".
The first sign that this is wrong is that the "Archive Type" shows up as "Generic Xcode Archive" which is the wrong one.
You can verify this by selecting the archive in organizer and clicking "Validate...", Xcode should tells you about the multi-bundle problem.
The "contains multiple product" is a known Xcode issue and can be worked around by making sure that all built products in all of your projects have the build setting "Skip Install" set to "YES" except for your main application project. This can happens if you add a library project by dragging the xcodeproj file into Xcode.
After fixing it and re-archiving, it should now shows up with an archive type of "iOS App Archive".
And if you click "Distribute..." now, you will now be able to properly export an IPA by selecting the second option.
Your PROJECT - Skip Install - set to NO
Your libraries - Skip Install - set to YES
In your SUBproject you should check "Copy headers" section
click on SUB project
Building Phases
DRAG all files fron Public and Private sections to PROJECT section

How can I make my xcode project automatically select the correct Xcode version when I double click on it?

I have multiple versions of XCode installed on my MAC. When I install a new version of the SDK, I noticed that I can't no longer double-click on the project file for the newer version of XCode to launch the project. I have to constantly do a right-click and then select the newer Xcode version. (multiple versions now show up when I do a right click). I thought maybe once I right-click selected the newer Xcode app once, it would remember, but it does not. Is there a way to make it so that my project will ALWAYS launch with the newest XCode when I double-click..or must I constantly do a right-click and select the right Xcode version?
Right-click on your project and choose Get Info, then where it says Open With, choose the correct version of Xcode you want to open it. This may not be the official way, but it will work as expected. Also, doing it this way, and clicking on the Change All... button will change all of your Xcode projects to open with the one you selected.
Do a right click on your .xcodeproj file. Then select the "Open With" option.
Then select "Other" and navigate to the path the the specific version of Xcode you want to be selected automatically for this project. You will need to navigate to the correct xcode.app file. To help you find the right file, note that when you do a default install of Xcode, it gets put into the Macintosh HD->Developer->Applications folder. However, if you have installed multiple versions of Xcode, navigate to the specific version you have installed and then select the appropriate Xcode.app file. Make sure you select "Always Open With" in the window you are using to select the app.
Once you do this, you can finally double click on the project and the correct Xcode version will now launch.
Is there any reason to have to old version on your MAC still?

TableSearch sample and error: "There is no SDK with the name or path 'iphoneos4.0'"

I downloaded the latest sample code from the Apple developer site and even though I've set the Project settings, I can't build the project.
I have the XCode version 3.2.4 with iOS 4.1 and I get the error:
There is no SDK with the name or path
'iphoneos4.0'
I've changed the value of "Base SDK" to "iOS Device 4.1" found in the Build tab that you get to via "Project" :: "Edit Project Settings" page.
What else should I change to get this project to build? There are no #ifdefs defined to say it can only build on 4.0.
It turns out that I had to go to the Targets item from the Groups and Files pane and change the Base SDK there as well. I thought changing it one place would do it in XCode, but alas, not so.

Frameworks are 'red' in Xcode

I downloaded a project developed by Apple employees ( who taught course at Stanford on iPhone application development). Strangely , the frameworks are red.
http://img.skitch.com/20100730-kcjun96mp2pxnpg7w3x6njw57.jpg
I tried to locate coreGraphics.framework and UIKit.framework to add them again but i couldnt find them either.
Taimur
The red text indicates that the actual files are not at the path that the project has for them.
Get info on the framework and look under the General tab. The first section shows the name and path of the framework bundle itself. The most common cause of a problem with system supplied frameworks is that the path type has been changed to something that breaks the path. The default setting is Relative to Current SDK. Change the path until you get one that leads to the actual framework.
If you have the developer tools installed in a custom location, you are more likely to run into this problem. If you copy a project from someone with non-standard settings, you can encounter it as well.
Are you building for a Simulator or for Device?
Try building for Device.
Found a way to fix this automagically:
Right click your main Xcode project file (the blue one at the top ),
Get info,
'General' tab,
At the bottom, set 'Base SDK for All configurations' to your desired one.
Done!
Steps to fix this issue in M1 Macs:
Install "sudo gem install cocoapods-deintegrate cocoapods-clean" to install deintegrate if not installed.
Run "pod deintegrate" in terminal in your project folder to uninstall all pods.
Run "pod cache clean —all"
Run "pod install"
Go to Project Explorer Select "Pods" in blue
Select the each pods in the target section
Search for "Excluded Architecture" in Build Settings Tab under "All" sub category.
Add "Any iOS Simulator SDK" in both debug and release and set the value to "arm64"
Repeat this for each Pod with the error "Framework not found".
Clean Build the project.
#Taimur Hamza - Its happen (red color) following any one of reason,
Your downloaded project may be miss some required files
Before run the application at first time.
so, first you have to find that above reason is happen and try to solve via copy the framework from another running project and paste it your project.
I had faced this problem before. I got over it by copy the missing (in red) framework from my friend's Mac then copy it to the Framework folder.
This is the path of my framework folder:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks
You may need to change the path depend on your system or your sdk version.
Most likely you decided to remove some of the frameworks you don't need and you deleted them but selected "Move to Trash" instead of "Remove reference".
The problem is that this framework was not included in your project's folder. It sits in a System folder when it can be used by multiple projects. So not only did you cause the current project not to compile, but also all projects on your computer.
If you have any frameworks left, you can right-click on them and check "Show in Finder". Than you can find your deleted frameworks in the trash (if it's not wiped already), and put them back in the system's Frameworks folder.
If you can't find this folder, for me it was here:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library
Of course, when you go in Applications folder and select Xcode, you have to right-click on it and click "Show Package Contents".
If you deleted your frameworks even from the trash, than I guess you could re-install Xcode...