Running on device 4.2.1 with XCode 4.2 - device

I have xCode 4.2, and I've done all the steps about the $99 ios dev program.
Now I need to test my project on my device, which is an iPhone4 in 4.2.1, but I failed to run the app on the device, where the xcode says Xcode cannot run using the selected device.
But in the Organizer my device seems well, because there is a green bulb nearby, like it is in the picture:
Does anyone know the solution to this problem? Should I find something like 4.2.1 sdk to add to my Xcode?
Thanks a lot for your answering!

Download latest version of the SDK, the one supporting iOS 5.0.1. Use the latest SDK as the base SDK. This is not necessarily the oldest version of iOS your app will support.
If you'd like to support/test on devices running iOS 4.2, just go to project build settings and set "iOS Deployment Target" to 4.2.

Related

Is it possible to install iOS 7 SDK on Xcode 6?

I have Xcode 6 installed but realise that I am only able to develop for iOS8. I am aware that this beta development kit is meant for the development of the iOS 8 beta release but I am in a position where I don't have the time yet to develop for it but wish to take advantage of some of Xcode's new features while I am developing for my current iOS 7 apps.
What can I do to get the iOS 7 SDK installed on xcode 6?
Seems like if you symlink the relevant SDK from a previous installation of Xcode to the Xcode 6 Beta directory, Xcode 6 will be able to use it. Assuming you still have Xcode 5.1.1 on your machine, try the following in terminal:
ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk /Applications/Xcode6-Beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk
This should link the iOS 7 SDK for iPhone (not sim), allowing you to select iOS 7 as the Base SDK in Xcode 6 Beta. If you want to do this for the simulator, replace iPhoneOS.platform with iPhoneSimulator.platform.
NOTE: Just because you have the iOS 7 SDK now doesn't mean it'll build. I'm personally having trouble with the fact that Xcode 6 Beta is using the Apple LLVM 6.0 compiler, which apparently isn't compatible with some of the stuff I'm trying to build.
ref: https://stackoverflow.com/a/11424966/2383003
Just posting so that someone might find it useful: I wanted to debug my app in iPhone running iOS 7.1, in XCode 6.0.1. The previous iOS version was not being listed in the settings page, to choose as base SDK/deployment target. (I'm using OS X 10.10 Yosemite). I installed both XCode 6.0.1 and Xcode 5.0.1 and copied
/Application/XCode501.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk
to
/Application/XCode601.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
Now I'm able to run iOS 7 apps from XCode 6.0.1.
I changed the deployment target just fine and installed on my iOS7 iPhone 4s all the same. You can do all your development this way and then use 5.1.1 to make your relevant builds. I wouldn't advice to build apps for production in this beta environment even if you could.
Just repeating Christian's comment (on Ziewvater's answer) so it's more prominent:
What's strange is the fact that after adding the symbolic link to my Xcode folder, I see my device twice with the exact name and with some infos (iOS build number, model, device identifier) in the target selector in the upper left corner of Xcode. Depending on which of the both entries I chose, my app works fine or not, no matter which BASE SDK I chose. ??! Anybody experiencing the same?
This is exactly my experience also! Me and my team were tearing our hair out trying to understand why some builds seemed to be working and others were not.
It looks like Apple must be ignoring the base SDK (or target... or something) when you pick the wrong device from the list.
in Xcode 6.1.1 (Window -> Preferences - Downloads) you can install iOS 7.1 simulator. unfortunately it doesn't install iOS 7.1 SKD. if you set deployment target to 7.1 all builds without any trouble. be worry!!!! it is up to you to check the compatibility with 7.1 (SDK is still 8.1). so or so, all runtime trouble should be seen in simulator. i use this approach to build for my iPhone 4 in swift, where iOS 7.1.2 is the last available. (simply don't use any classes available only for newer devices :-))

Xcode cannot run using the selected device on 7.1.1

I got the following error:
Xcode cannot run using the selected device.
No provisioned iOS devices are available with a compatible iOS version. Connect an iOS device with a recent enough version of iOS to run your application or choose an iOS simulator as the destination.
xcode 5.0.2 (5A3005)
iphone 4S with iOS 7.1.1
Development Target is 7.0
Code signing Provisioning profile is set to IOS Team Provisioning Profile.
In Xcode -> Window -> Organizer - Devices
The version of iOS on is not supported by this installation of the iOS SDK. Please restore the device to a version of the OS listed below, or update to the latest version of the iOS SDK; which is available here.
OS Installed on
7.1.1 (11D201)
Xcode Supported iOS Versions
Not sure why the xcode supported IOS versions is blank here.
Already tried to project clean, remove device and reconnect and set target to lower version. None of these methods work.
Please advise.
thank you
After upgrading to Xcode 5.1.1, it's working fine now.
Thx

Does xcode4.5 support ios4.3 simulator or prior?

I have upgrade to xcode4.5 from 4.4, but i can't find ios simulator 4 or prior within it. I open Xcode menu, preference, downloads, i can see simulator5 and 5.1 only. I am not sure whether xcode4.5 support ios simulator 4 and debugging with ios4.3 and prior.i know almost iphone and ipad people upgrade their ios to 5 already. but we have some project runs in ios 4.3.does someone know how to install simulator 4 in xcode 4.5?
thanks in advance.
Looks like it has been removed from xcode 4.5 on Mountain Lion:
xcode 4.5 runs ios 4.0 simulator (NOT)
According to Apple you can still set the deployment target for 4.3 though:
https://discussions.apple.com/docs/DOC-3461
The minimum supported deployment target with Xcode 4.5 or later is iOS 4.3.

Can't download App to iOS 5.1.1 iPhone

I installed the latest iOS update (5.1.1) on my development iPhone. In Xcode, I now get the error "Could not support development". Xcode says that I'm up-to-date on the latest SDK. How can I fix this? I'm using Xcode 4.3.2 (4E2002).
Go to your organizer and make sure you have a green dot next to the device you are using. If not click Use For Development.

Base SDK missing after a fresh install of XCode 3.2.5 which includes iOS SDK 4.2

I'm new to iPhone development. I just did a fresh install of XCode 3.2.5 with iOS SDK 4.2. No previous XCode or iOS versions have been installed before. However trying to compile some sample project from some books gives "Base SDK Missing". :( What to do? How can I use XCode 3.2.5 for older iPhones like 3GS if it only supports 4.2?
When I go to "Project/Edit Project Settings/Architecture/Base SDK/iOS SDK's" only iOS 4.2 is available to be selected.
Do I need to install older XCode first and then upgrade?
In the build settings, you can support older phones by setting "iOS Deployment Target" to something like 3.0. http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/cross_development/Configuring/configuring.html has more details on the difference between this and the Base SDK setting.
Set Project/Edit Project Settings/Architecture/Base SDK to the Latest OS version, then quit and restart Xcode. You can later set the Deployment target to a lower OS version.
I had the same problem for most of the afternoon. I did everything suggested and nothing worked UNTIL I cleaned and cleaned and saved and rebooted and re-built. Unfortunately that doesn't tell me what actually worked, but it does give everyone "just one more thing" to try.

Resources