Xcode 4: My iPhone projects have become Mac OS projects.. and I can't change this - iphone

I have two iOS projects that under Xcode 3 built properly and these iPhone been on sale in the app store for some time. After upgrading to Xcode 4, Xcode now thinks these are Mac OS projects!
When I select Project Settings > Info, it actually says at the top "Mac OS Deployment Target" with a drop down allowing me to select 10.4, 10.5 or 10.6! These are not nor ever have been Mac OS projects.
In my build settings, Xcode allows me to select 32 bit or 64 bit Intel architecture. not armv6 or armv7.

You need to change your build settings. Fortunately, this is really easy to do.
Start by clicking on your project's name in the Project Navigator.
Now, click on your Project Name as it comes up in the list. (You may need to do this for your build as well.)
Next, click on Build Settings. Finally, you should be able to change your Base SDK to the appropriate one.
Note that you might need to repeat steps 3 and 4 after selecting your Target in the screen shown below.

Have you restarted Xcode since the upgrade? Often times Xcode 4 seems to need to be restarted after SDK changes.

I didn't face any issues opening the projects in Xcode 4 which are built in Xcode 3. However there can be wired issue with the Xcode 4 you are using. Try resetting the architecture to armv6 or armv7 and base SDK to latest iOS SDK using the build settings. Also set the deployment target properly. This should allow you to run the application in Xcode 4.
Also, try uninstalling the xcode and install Xcode 4 again. This should fix the wired issue you have with your xcode 4.

Related

Issues after installing upgraded XCode version

I installed XCode DP 4.5 recently - just to try out iOS 6.
I opened a project using it.
When I reopened using XCode 4.2.1 again, I started having storyboard data loss issue mentioned here.
I don't get this issue in 4.5 DP, but then I don't want to continue with XCode 45 DP. I am not sure if its valid to build my app with it. Also, it shows me "iPhoneOS 5.0 sdk not found warning" which is the base sdk I have set within my project.
What should I do to get rid of this issue?
Is it ok to continue using 4.5 DP?
If not, how can I safely go back to 4.2.1?
Is there any workaround in project to make, to regain my storyboard?
I also have storyboard backed up, but as soon as I import it into my project (within 4.2.1) - it complains it cannot open it. So I suspect it's due to a setting shared both by 45 DP and 4.2.1.
Please help...
Download the Golden Master for iOS 6 and use that for your development. As the GM version App may be compiled for distribution with it and Xcode 4.2.1 will become obsolete.
By default storyboards are set to be compatible with the current release of Xcode, and one previous release. You can choose to make them compatible with even older releases by modifying the development version pop up in the storyboard's file inspector.

iOS simulator only list the latest iOS version. How can I set earlier versions

According to the documentation should be able to choose which iOS version the simulator should run, however only the latest 4.3.2 is listed under "Hardware/Version".
The helps says:
"To set the iOS release used in the simulation environment, choose Hardware > Version, and choose the version you want to test on."
I don't want to support 3.x (although it would be nice) but at least I want to simulate my app on 4.2, 4.1 and 4.0.
What's going on? Why aren't they listed?
UPDATE:
I'm on Lion so I cannot install an earlier version of Xcode. Before my Upgrade I could test different versions easily.
the problem is that you have no other Simulator SDK installed which can be used. As #dorada has mentioned you have to install an older Xcode which in fact doesn't work because you're using Lion. I haven't tried it with Lion but principally it should work like before with Snow Leopard.
I'm referencing to my other answer how to get an older Xcode (don't know if it's still working)
After you have an older Xcode version, mount the image an navigate with terminal to that volume. There should be a hidden folder Packages. open that folder with open . and locate the two .pkg files you need (e.g. iPhoneSDK4_0.pkg and iPhoneSimulatorSDK4_0.pkg) and install both.
They will appear in your root directory and you have to move them to your Developer dir (don't simply overwrite, it will delete all other SDKs. go to the last different folder it should be iPhoneSimulator4.0.sdk\ and copy that one)
DONE (and at that point I have verified it: it works on my Lion. I used the dvd image which I have started backup'ing since 3.2.1)
Although iPortable has the correct answer I decided to post a step-by-step guide which is easer to follow:
Download Xcode 3.1
Mount the dmg file
In Finder menu select "Go\Go to folder" and enter "/Volumes/Xcode and iOS SDK/Packages"
Install the simulators you need (Double click)
Copy the simulation folders from /Platforms/iPhoneSimulator.platform/Developer/SDKs/ to /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
If your have some SDK missing Install the missing SDK from "/Volumes/Xcode and iOS SDK/Packages" and copy subfolders from /Platforms/iPhoneOS.platform/DeviceSupport/ to /Developer/Platforms/iPhoneOS.platform/DeviceSupport/ (for me they were all there from 3.1 to 4.3)
you may download the older ios sdk / xcode from . https://developer.apple.com/downloads/index.action
(i found this answer in another stack overflow topic actually, but now i can not seem to find that question!)
Open Xcode and in the menu at the top left, where you select what device to run on, click "More Simulators..."
The download section of Xcode preferences will open,
Click the "Components" tab.
You will see a list of simulators that can be installed, click install on version you need.
The simulator will need to restart to install.
To run the newly installed version of the simulator just select it from the run menu in Xcode.
You actually have to install previous simulator versions, they aren't there on a new install.
Maybe you can search and download them somewhere? - we keep them on a shared drive at the office.
After installing the Xcode 4.2 for Snow Leopard, I noticed there was a choice for iPad 3.2 Simulator, but using it just brings up some alerts that say "iOS Simulator could not find the SDK. The SDK may need to be reinstalled." and another alert that says "Simulated application quit. Click Relaunch to try again." with Quit, Switch SDK, and Relaunch buttons.
I can successfully use iPhone 4.0 Simulator, iPhone 4.1 Simulator, iPad 4.2 Simulator, etc up to iPad/iPhone 5.0 Simulator, but really would like to have iPad 3.2 Simulator and iPhone 3.1.3 Simulator and earlier down to 3.0 if possible.
Our apps generally run all the way back to 3.0 and we occasionally receive bug reports from earlier iOS users, and would love to be able to debug these issues more effectively.
I tried the technique summarized by Tibidabo and although I am able to copy the simulator folders as mentioned, and though they show up as choices in Xcode, I cannot get them to actually run as simulators and I get the same problem alerts mentioned above.
What are other developers doing to support debugging of older iOS versions?
Go to Project Settings -> Summary an change Deployment Target.

Is it possible to target older iOS versions when using Xcode 4.2 and iOS 5 SDK?

I just recently downloaded the Xcode 4.2 with iOS 5 SDK package and I immediately noticed that I am unable to use my iPhone 3Gs with iOS 4.2.1 for debugging. I am only able to debug and test on my iphone 4 with iOS 5 installed.
For any of my devices running any iOS less than 5.0 Xcode just says "Finished running for iPhone3GS" and doesn't run it. I have my deployment target set to 3.0 because I am not using any features in my app above 3.0 and I want to be able to target all versions 3.0 or higher. I have all my provisioning profiles installed and up to date.
I have quit and restarted xcode, I have cleaned the build multiple times. I have tried adding armv6 in the archtecture build settings, but nothing will allow me to build and run my app on my old phone with ios 4.2.1.
My question is, is it possible to still make apps with the new SDK work for iOS versions lower than 5? How can I be sure that my app will still run on lower iOS versions if I am unable to install them on my old phone?
Edit:
OK it looks like iOS SDK 5 dropped support for armv6 by default. What you have to do is add armv6 in the Architectures field under Build Settings for both your Target and your Project. Then your app will be able to run on iPhone 3G devices.
Answer can be found here
How to build for armv6 and armv7 architectures with iOS 5
I was having the same issue trying to get a newly created Xcode 4.2 project running on an iPhone 3G 4.2.1. Here is how I was able to get it to run.
1) Change the Target's "Build Settings" ==> "Architecture" from "Standard (armv7)" to "other". Add armv6 and armv7.
2) Change the Target's "Build Settings" ==> "Valid Architecture" to armv6 and armv7.
3) Change the Target's "Build Settings" ==> "iOS Deployment Target" to iOS 4.2.
4) Open the projects *-Info.plist, remove the setting "Required device capabilities" (note it required armv7)
btw I figured this out when I tried to manually add the app via the organizer and it reported:
Can't install application
The Info.plist for application at /Users/.../TestsDebug.app specifies
device capability requirements, which are not met by Dev iPhone 3G
All should work after that. Talk about a PITA.
Go to Xcode > Preferences > Downloads and install debugging support for older iOS versions.
mmorris got me close to resolving the issue...
In the Info.plist, I had to set the Required Device Capabilities to armv6, not armv7
Hope this helps others out as well.
You need to connect the phone and then go to the organizer. Xcode should automatically request the older version.
See the developer page for more info. It was described in the notes for the 4.2 beta
I encountered a similar problem trying to run my app on an old iPod Touch. I upgraded to Xcode 4.3.3 and the app would no longer run in the debugger for me on older hardware.
I believe the other comments here about "Architectures" and "Required device capabilities" are important details to specify correctly. Unfortunately, they weren't enough to fix my problem.
In my case, I found the build scheme to be the culprit. Xcode 4.3.3 prompted me to switch from the GDB debugger to LLDB when it upgraded my project. When I changed the Run action of my scheme back to GDB, I was able to run the app again on my old hardware from Xcode.
I found out that I had to add armv6 to architectures, but still did not work. And now I have removed armv7 from required capabilities, and that was it! It worked!
This worked for me and should work for you if you had an older version of Xcode previously. If not then you should follow the advice given by others to obtain the SDK from an older version of SDK:
sudo cp -a /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk
This command is only a little bit different from that shown by others, but those commands dropped the files in the SDKs folder itself for me - we want a subdirectory of it to be created with the appropriate name.
In my case there was a redundant line
in Required device capabilities
I just removed it...
Hopefully it will help someone else.

XCode 4 - Device does not show up in the schema "destination" dropdown

I can't for the life of me find out how to run applicaitons on a device (specifically, and iPhone 4) using XCode 4.
The documentation says to "Set the run destination to iOS device in the scheme editor and build and run your application."
The dropdown menu in the schema editor only has simulator options.
Could someone present a step-by-step method for running applications on devices using Xcode 4?
Using:
Xcode 4.0.2 (iOS 4.3)
iPhone 4.3.3
UPDATE
I ended up doing a series of restarts (Macbook Pro, iPhone 4, Xcode), did a few cleans and builds of the project, and set the "Base SDK" build attribute for the TARGET to "Latest iOS (iOS 4.3).
After that, the device appeared in the destination drop-down in the scheme editing menu.
(Thank you for your time septi!)
Be sure to Verify the BASE SDK used in your project. From the docs:
"
Note: If you are building to your development device, the Base SDK version number defined on your Xcode project must be greater than or equal to the software version number on your development device; otherwise Xcode cannot initiate a debugging session with the device. In that case, you will need to download and install the latest iOS SDK version that is greater than or equal to your device software version.
"
I had a similar problem. My phone has iOS 4.2.1
I downloaded a sample app and my phone did not show up as an option, only the simulators were listed.
So this is just a configuration issue:
To fix this you need to select the project, and:
(as noted above) Select Build Settings/Base SDK = (in my case) Latest iOS (iOS 4.3)
Select Summary: Devices: iPhone
Select Deployment Target: (in my case) 4.2
Now I get the following in the dropdown list of targets:
Myiphone (4.2.1, overriding Base SDK to 4.3)
Also watch out for the UIRequiredDeviceCapabilities property in the plist file. This can prevent a device from showing up sometimes.
I encountered this today in XCode 5 and tried the steps specified. Eventually, I found another solution that may be of use to future readers (Xcode 4 or otherwise).
Go to your project settings and select your target.
Select the "General" tab and scroll to Deployment Info.
Under "Deployment Target", make sure that your device's OS, or something lower, is specified.
---> Your device should now show up as available for debugging in the listing.
Came across this by checking the same device in another project. In that project, the device was listed just fine. When looking at the project settings between the two, the above difference was what stuck out and resolved the issue.
The "Deployment Target" in the project general settings needs to be <= your device, as Danny said above.
Be aware that when you create a new project in a new version of XCode, the default deployment target will be the latest OS release. If your iPhone is on a lower release, this means you either need to upgrade your iPhone, or install an older SDK into your XCode.
You can install an older SDK by copying it into the XCode package at location:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs

Why is the iPhone Simulator 3.0 not showing up in Xcode?

I have installed the new 3.0 SDK, but when I start up Xcode, I don't see an option to build for "Device - iPhone OS 3.0" or "Simulator - iPhone OS 3.0"
The Xcode About box says I am running: 3.1.2
Is there something else I have to do?
I think you need to upgrade to Xcode 3.1.3. I have the latest version and that's what my About box reads.
If you are sure you downloaded the latest version, perhaps you installed in to a different location?
If you are using an existing project you may have to tell your project to build to the 3.0 targets. I didn't have to do this for any of my projects but ...
Under the Deployment section of your project properties you should see:
iPhone OS Deployment Target - (change this to use iPhone OS 3.0)
You can also check that the Architectures section has the Base SDK set to 3.0.
This happens quite often when downloading Apple's sample code projects which are targeted for iOS 3.x but you've got iOS 4.x.
To show Simulator option go to Project Info window -> General tab -> Base SDK for All Configurations - choose Latest iOS.
If it doesn't appear straight away, close and reopen Xcode.
This is what worked for me:
I clicked on the box (where I expected iPhone Simulator to be shown), right clicked manage scheme. After that deleted all schemes, and in similar way, created a new scheme. It automatically produced all simulators including the ones for devices.