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

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

Related

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

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.

xcode cannot find the software image to install this version

I'm new to xCode development and struggling my way through the provisioning system trying to run a Hello World app on a real device. I went through al steps and everything seems fine but one thing:
When i click my device (Iphone 3G running IOS 4.2.1) in the xCode organizer the following message is displayed under Software Version: Xcode cannot find the software image to install this version...
Also the provisioning profiles show no status in the organizer (both in the library and on the device). On the provisioning portal they have the status active.
I hope someone can help me, thanks!!
ps. i am working with xcode 4
Update: OK, I've found the solution -> set deployment target to 4.2 in info tab: https://discussions.apple.com/thread/2780316?start=0&tstar
The message "xcode cannot find the software image to install this version" seen in the organiser window... This is just a notification rather than a problematic error.
If you want to eliminate this message anyway, I found I was able to do this by running restore within iTunes. Part of that process involves downloading some stuff, which I presume is the 'software image'.
But, as explained in Technical Q&A QA1569 "This message does not prevent you from using the device for development purposes. The only effect is the inability to reinstall the OS currently on the device using Xcode." ...and that has been my experience. Back in the main Xcode window you're still able to click 'run' and send the app to the device to run.
...and it will run assuming everything else is set-up OK, but there are various other gotchas related to Xcode 4.2 and v4 devices:
As mentioned by Overbeeke you should ensure the 'deployment target'
of your project is set down to the desired version (the minimum
version of the devices you want to support) Additionally I would
point out that the 'SDK version' should normally remain set to the
latest (it's whatever SDK Xcode on your machine is using)
As mentioned by Kenneth Lam, in the new Xcode you need to frig around
with "armv6/armv7" settings if you want to support earlier models of
iPhone. Follow these instructions to add the right "Architecture" armv6 setting. Additionally I would point out (as per this answer further down) that there is a setting called "Required device capabilities" from which you need to remove 'armv7'. This is in your app's plist file.
I'm saying all this like I'm an expert, but I still can't get it to work on a v3.1.3 device :-)
I think Xcode 4 requires that you are running the latest iOS to use that feature, but you don't need it to install apps on a device. I have run my apps on an iPod Touch 1G (which can't be upgraded to iOS 4.3) with the same iOS as you and it worked.
Have you added your device to the provisioning profile?
What I did is opened the organizer, right click on the device on the left pane and select "Add device to provisioning profile" where you will be asked for your Apple ID (within xcode) and it will add the device to your profile without you leaving xcode, much simpler than using the online portal.
Xcode 4.2 only builds armv7 targets by default. (Iphone 3G running IOS 4.2.1 is armv6) Add armv6 build targets by following these excellent instructions from Nick "Warning: iPhone apps should include an armv6 architecture" even with build config set
just an update, to update the iOS deployment target, click your project in the left pane, the one with the blue 'A' icon. click the build settings tab (not info), instead of showing "basic," show "all." iOS deployment target is in the deployment section.
There could be a number of things, but i would make sure that that your deployment taget in build settings is at or below your target . Check the "deployment section" in the build settings of your project. The default sets the deployment to the highest iOS version, if the ios version is below what is set you will not be able to run the app on that device.

Base-SDK of v4.0 means it won't install on 4.1 or 4.2 devices?

I was using xCode v3.2.3 and SDK 4.0 to write iPhone apps that worked on my iOS v3.1.3 device... as well as v4.0. (Deployment target set to 3.1.3. Base SDK set to v4.0)
Does that mean everyone that uses my app will need a minimum of iOS 3.1.3 and a maximum of v4.0? Or will they also run on v4.1 and v4.2?
Second part of my question:
I now upgrade my iOS v3.1.3 to v4.2.1.
Xcode now says my v4.2.1 device is now no longer provisioned.
Doesn't a Base-SDK setting of v4.0 mean apps will also run (or at least install) on v4.x?
No. Base SDK just means that your app will be built against the iOS 4.0 libraries. Any 4.x device will be able to run a release build of your app, but for debugging, Base SDK and the iOS version on your device must match. In the end, you need to build your app with the newest available Base SDK anyway, because Apple won't accept apps built for older SDKs into the App Store.
No, they will. iOS has Backward compatibility.
I agree with Irene. I found the solution:
The hint came from here: Can't make Xcode 4 run a barely empty project using SDK 4.2 (runs fine in 4.3)
And this is how i resolve: my xcode 4.0 my SDK 4.3 and my Ipod touch device is 4.2.1 - You see it is backward compatible. There are 2 things you must do in order to resolve. 1) In your xcode 4.0, You click on your project name under Target to ensure you change the target not the Project setting. Find the row >IOS deployment target to the version of your device in my case it was back to 4.2.1 ipodtouch so i set 4.2 (do not worry about basesdk it is for your application not the same as your application's target. 4.3 basesdk requires you provide codesign so you have to select code sign if do not have one apply for one looking up in Apple website or google)
After setting your target to compatible version with your device you now can go to "set the active scheme" that is where you select which device to install and run on including the simulator. So you will find you device there select it and you are good to go.
And if you still can not get it going. You can try to select your project under Project this time adn set the ios deployment target to your version mine was 4.2 ipodtouch ios. Then go select "set the active scheme" that is where you select which device to install and run on including the simulator. So you will find you device there select it and you are good to go.

xcode 3.2.4 (sdk 4.1) unable to install to device

I recently installed XCode 3.2.4 to my machine. This comes with iOS SDK 4.1. Annoyingly I can no longer install my app to any iPhone. The option to tick "Device" in the drop down for where to install to is present, but when I click it, it doesn't become ticked. Strangely I can only run my app on the simulator, despite the option to select the simulator not being present.
Does anyone know how to fix this or what might be the problem?
Thanks in advance,Tristan
Alrighty, I'm answering my own question.
What I didn't realise is that there's seperate build configurations depending on wether you click 'info' while selecting your project's title or the project's Target. I had set the project one to SDK 4.1 but not the Target one.
Did you set the iOS Deployment Target in your Debug or Release Build Settings to match the OS version on your iPhone? Did you set the Targeted Device Family to iPhone?
All these questions just remind me that something is very confusing in xCode.
And don't let me start talking about all the provisioning misunderstandings

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.