Xcode doesn't build for iPhone simulator - xcode

I'm working on a iOS project in Xcode 4.5 and I have a workspace with some old libraries that I needed to link as dependancies to my project. I had to go through quite some difficulties before getting it to build and now it finally builds for my device, but not for the simulator. The problem is, I get a bunch of errors like the following (all related to UIKit framework):
- error: 'UIResponder' is unavailable: not available on Mac OS X
and then it just says too many errors emitted, stopping now.
It looks like it's trying to build the project for Mac OS X rather than for iOS, and I have no idea why.
I'm quite new to Xcode 4.5 development and it might just be that I missed something really easy, but I can't seem to find the solution anywhere!
How can I convince Xcode that the iPhone simulator is not Mac OS X?

Make sure that the deployment target is the latest (6.1), the base SDK is iOS 6.1 and targeted device family is iPhone. All these options can be found under the build settings tab for the PROJECT.

Related

React native - cant see podfile in xcode

I created a react native app using react native cli.
When I use finder to navigate into ios folder I can see podfile.....however when I open the project in xcode I cant see it anywhere.
Any idea why?
UPDATE 4/29 - I tried answer below to "Open the xcworkspace file with Xcode not the xcproj one"....and this did not work. Regardless of which file I use to open, I still dont see podfile (or xcworkspace file for that matter)
Im using Xcode 12.5.....and a macbook air with the new M1 chip (I mention this because the M1 chip has been causing me a host of other problems like not being able to download IOS simulator)
Open the xcworkspace file with Xcode not the xcproj one.
I ended up exchanging my macbook air with M1 chip....for an older one with Intel chip. All the issues I was facing before are no longer.
My advice is to not purchase any laptop with M1 chip until Apple have had time to figure out all the bugs that occur for developers (M1 chip was only launched last Nov and theres still SO many issues for devs).

Building for iOS simulator Library issue

I have an app that uses sqlcipher encryption, and with the latest release of Xcode I haven't been able to to run on simulator, I always get the following error.
Building for iOS Simulator, but the linked library 'libsqlcipher.a' was built for iOS.
I have researched that this error may be connected with Apple wishing us that move from .framework to .xcframework.
The open source of this library doesn't offer a .xcframwork. And I'm not sure I can build it locally.
I would like to ask if there is any workaround that can be done without having to purchase sqlcipher.

With XCode 8 How Do I Target My App To Run on macOS also (it already runs on iPhone / iPad)?

Can someone show me what I change in my project in XCode so that my app will also deploy to a Mac?
For example, I'm running a Mac Mini but I cannot seem to run my app on the actual Mac, even though it is a Universal app and runs on both iPhone and iPad platforms. My app is already deployed to the app store ( https://itunes.apple.com/us/app/cyapass/id1183137527?mt=8 ) and I've tried to install it to the Mac that way, but that doesn't work either.
Is this possible through a simple change in the XCode project?
Or, do I have to create a new project that targets the Mac specifically?
If you have screenshots from XCode those would be greatly appreciated if the change is made in the XCode project.
Unfortunately, there are some frameworks which are not applicable for OS X that iOS development depend on, such as the UIKit. You can see the full list here.
Chameleon, once done, can hopefully make the transition from iOS to OS X easier.
Although, you won't necessarily need to create a new XCode Project, as you can share the common frameworks and logic in-between the two platforms.
You could essentially structure your code like so (inspired by another SO post)
- Workspace
- Shared Code
- File1.m Target: iOS and OSX
- iOS
- File2.m Target: iOS
- OSX
- File3.m Target: OSX
It is although important when doing so to set the appropriate targets of each individual file.
Last but not least, Apple has previously, during WWDC13, given a talk about how to bring iOS Apps to OS X. Note that the talk can only be seen using either the WWDC App or Safari. I have previously found this talk helpful myself once I needed to implement an OS X version of an existing iOS app.
Is this possible through a simple change in the XCode project?
No, it isn't. AppKit and UIKit are utterly different from one another. Even common frameworks such as Core Graphics have different APIs. Basically, you just have to rewrite the app. Your core logic (the model) can be in common, but the workings of the iOS app and the macOS app will be completely separate codebases.

XCode 5.0.1 and iOS 5.1 simulator issue

After upgrading XCode to 5.0.1 on Mavericks I can't install iOS 5 simulator, it's removed from Download section... Is it only happening to me or does anyone else has similar issue?
Is it possible to install 5.1 simulator from outside of Xcode Downloads page?
Unfortunately, iOS Simulator 5.0 and 5.1 don't work on Mavericks. The reason for this is best explained by gparker on the developer forums (https://devforums.apple.com/message/911139#911139):
The iOS simulator does not duplicate some of the low-level parts of iOS. For example, it uses the host OS X's kernel instead of trying to virtualize the iOS kernel. The iOS simulator requires that these subsystems look sufficiently similar between the simulated iOS and the host OS X. When a new host OS X changes too much it can break old simulators. At that point somebody makes an engineering and cost decision to either update the old simulator or drop support for it.
Not the answer you and I were hoping to find. You could of course run Mountain Lion in Parallels for testing iOS 5.x.
I face the same thing when I installed the XCode4.5. Then I copied the SDK from my old xcode to the new xcode.
The SDK is located in the following path.
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk
/Applications/Xcode4.5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk
iOS Simulator 5.0/5.1 is available only on Mountain Lion. If you're running on Mavericks, you'll only see iOS 6.0/6.1/7.0.
iOS5 Simulator on XCode5-GM
Additional Simulators can be installed from Xcode -> Preference -> Downloads -> Components
However, in case of Xcode 5.x iOS 5 simulator cannot be installed since Mavericks doesn’t allows it.
Apple document for Xcode 5

Why doesn't iPhone ad hoc distribution in iOS 4 (Xcode 3.2.3) work?

Before iOS 4, I could successfully build my app using the ad hoc distribution profile and send it to my clients for testing.
Now. under Xcode 3.2.3, when I (and my client) drag and drop the .app folder into iTunes, the app does not appear among the list of apps and no message (error, warning, etc) is displayed.
Is there a known problem with ad hoc distribution in Xcode 3.2.3?
Hey, so I just ran into this, and I found that I could fix it by setting the value:
"LSRequiresIPhoneOS" to true (checked) in the application's Info.plist file.
I had a look back at all my old projects, and found that they all had this checked. I'm guessing that what happens is that when you open an old iPhone project in Xcode 3.2.3, it corrupts that parameter for some reason. I also encountered another other weird thing when I opened the project: a build parameter that is iPhone specific ("iPhone OS Deployment Target") was not there, and instead, the parameter "Mac OS Deployment Target" was there. This issue was resolved by saving the project. It all seems to point to Xcode failing to be backwards compatible with iPhone projects, which I've definitely seen other manifestations of in previous SDK upgrades.
Anyhow, hope this helps! If anybody has any deeper insights I'd love to hear them.

Resources