Xcodebuild showSDKs shows different available iOS sims than Xcode 6.3 GUI - xcode

OSX 10.10.1
Xcode 6.3 or 6.3.1
xcodebuild version "Xcode 6.3.1"
This happened on one machine and I thought it was a fluke. Has now happened on two machines. I have followed the advice in
Why aren't simulators showing in the Xcode 6.3.1 scheme selector?
to no avail. Here is what I see on the command line:
xcodebuild -showsdks
iOS Simulator SDKs:
Simulator - iOS 8.3 -sdk iphonesimulator8.3
in "xcode GUI -> prefs -> Downloads"
iOS 8.2 Sim (checkmark)
iOS 8.1 Sim (checkmark)
iOS 7.1 Sim (checkmark)
in the ios sim application (opened from Xcode -> Open dev tool -> ios sim)
in the "hardware -> device" dropdown menu i see
iOS 7.1 > (lots of choices)
iOS 8.1 > (lots of choices)
iOS 8.2 > (lots of choices)
iOS 8.3 > (lots of choices)
So the Xcode GUI generally agrees with itself, but I need to build for and kick off all of these iOS sims programmatically from the command line, but xcodebuild doesn't see all of the available simulators.

Ignore what xcodebuild -showsdks tells you. You are confusing SDKs with destinations. A simulator is a destination.
The way to know what simulators you've got is with xcrun simctl list.
The way to tell xcodebuild what destination to build for is with the -destination option. You can construct and specify any simulator with which your project's deployment setting is compatible.

Related

XCode 10 shows no simulators or devices

I just reinstalled XCode 10 and now navigating to XCode -> XCode -> Open Developer Tool -> Simulator -> Hardware -> Device -> Manage Devices shows no devices or simulators:
Does anyone know what might cause that behavior, or what I can do to install a simulator version (e.g. iOS 6s)? Any help would be greatly appreciated!
So this machine had a previous version of XCode installed, and had some legacy simulators that were left over from that earlier XCode installation. Step one was to remove those simulators:
xcrun simctl delete unavailable
Then I manually created a new simulator:
xcrun simctl create duhaime-6s com.apple.CoreSimulator.SimDeviceType.iPhone-6s com.apple.CoreSimulator.SimRuntime.iOS-12-0
Those arguments are: xcrun simctl NAME DEVICE_TYPE RUNTIME. You make up the simulator name, and can select a device type and runtime from the list of options displayed if you run xcrun simctl list. After creating the simulator, you can start it:
xcrun simctl boot 4A6368C3-A94C-4D83-8AA3-9E9900ABCC74
That GUID / simulator ID will be displayed if you rerun xcrun simctl list.

Which version of Xcode supported in iPhone XR

the iPhone XR is running ios 12.4.1(16G102),which may not be supported by this version of Xcode
the running version of Xcode is 10.14
You can download zip from here and unzip it. And copy to dir /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport.
Final restart Xcode, your Xcode will support iOS 12.4.1 device

Unable to launch iOS7.1 simulator in Xcode 6.2 instruments

Code which was working fine in xcode 6.1.1 now fails to launch the iOS 7.1 simulator in xcode 6.2 (but works fine for the iOS 8.2 sim).
Here is the command I am using:
instruments -t Automation -w /Users/USER/Library/Developer/CoreSimulator/Devices/233D1DE0-8660-4D98-8E45-5E0794CF7366 /Users/USER/Library/Developer/CoreSimulator/Devices/233D1DE0-8660-4D98-8E45-5E0794CF7366/data/Applications/APPNAME/APPNAME.app -v -l 20
This is the error returned:
instruments[2274:66214] -[UIAInstrument(UIAInstrument_Simulator) _startAgentForApp:withPID:]: Warning: Automation instrument could not locate sim tool.
That command launches the simulator and briefly shows the app's splash screen, then dumps out.
Any ideas?
You may go to xCode -> Preference -> downloads and see in iOS Simulator 7.1 is downloaded or not, if it is not downloaded then download and install it, it might work for you

How to install iOS 4 device platform on XCode 4 (currently only iOS 5 in directory)

I went to developer directory I can find IOS 5 sdk device platform and IOS 4 SIMULATOR platform.
How do I install IOS 4.3 device sdk platform for Xcode 4 ? It seems IOS4.3 SDK is tight to XCode 3 download.
Xcode Preferences >> Downloads
try your organizer > Downloads > Components (check & install) > iOS 5 support

parameter for xcodebuild for using latest sdk.

I using ant exec task to execute xcodebuild to build some iOS projects hudson. I would like to be able to crate script that way that allows not to specify sdk version, because after updating sdk on hudson slave or my iOS projects all my projects failing....
There is is nice option in xcode since sdk 4.2 in target setup Base SDK - Latest iOS
and I don't have to provide -sdk param in xcodebuild command, but then (i think) it's taken from xcode project and it's bad because then some one can change target from simulator to device accidentally during commit.
I need something that is constant. I will prefer not to use env variable because I would like to be able to run this ant task also on dev machines and would like not have to renember about setting it on all machines.
Unfortunately xcodebuild -showsdks gives only:
Mac OS X SDKs:
Mac OS X 10.4 -sdk macosx10.4
Mac OS X 10.5 -sdk macosx10.5
Mac OS X 10.6 -sdk macosx10.6
iOS SDKs:
iOS 4.2 -sdk iphoneos4.2
iOS Simulator SDKs:
Simulator - iOS 3.2 -sdk iphonesimulator3.2
Simulator - iOS 4.0 -sdk iphonesimulator4.0
Simulator - iOS 4.1 -sdk iphonesimulator4.1
Simulator - iOS 4.2 -sdk iphonesimulator4.2
I need something like -sdk iphoneosLatest. My only idea is to pare output of xcodebuild -showsdks with some script, but I don't like this idea.
You can use xcodebuild with the latest SDK using :
xcodebuild -sdk iphoneos, for Device
xcodebuild -sdk iphonesimulator, for Simulator.
We use these options for our automated builds and it's been working since XCode 3.2.5
I believe you can use xcodebuild -sdk iphoneos (no version number) to accomplish this.
I tried #jenningj 's solution and it worked for me. Maciek Sawicki, if this works for you, you should mark it as the right solution.
Also, xcodebuild -showsdk should be xcodebuild -showsdks.
You can try: xcodebuild -showsdks | grep -Eo "iphoneos([0-9]{1,}\.)+[0-9]{1,}"

Resources