Xcode automatically builds test target as a part of iOS project - ios

I'm developing a React Native mobile app for iOS. I had an error that was caused by the Tests target, but I spent 2 days trying to "fix" my main target before I discovered the problem in the Tests target.
To solve this, I would like to be able to build, debug, and deploy my app without bundling it with the "Tests" target. In other words I want to deal with them separately so I don't have to fix bugs in the Tests target before I can run my app on a device, or deploy it.
How do I do that?

In your build scheme, make sure that the test target is checked only for "Test" in the "Build tab"

Related

(iOS)Project crashing after archiving but working fine in Release build

I am working on a ios project which uses third party framework(widevine DRM framework). It is working fine in debug/release modes when it is tested but after archiving it is crashing. Inorder to make the framework work in debug/Release modes I had to set "dead code stripping" to NO and "symbols hidden by default" to NO.
Should I have to change something in the Build Settings for it to run properly after archive? What is the difference between running in Release mode and archive build?

XCode UI Automation no longer working on Simulators

I Hope someone can help me here.
I'm using XCode for UI Automation testing. For some reason, I can't run my tests on any emulators anymore. If I set the device to Generic iOS Device my tests appear, but once I change this to an emulator, my tests are no longer available.
I hope someone can help me. I have also tried deleting my current schemes and creating new ones, but then again, when I try to add my test folder to it, nothing is inside of it unless I select Genetic iOS Device first, and then the same issue occurs when I try to run my tests.
Make sure your test target has the appropriate platform and architectures. Select your project, then select the test target. Under Build Settings, make sure Architectures is set to Standard and Supported Platforms to iOS (which should be iphonesimulator and iphoneos).

App builds for Simulator, but not for 'Generic iOS Device'

I am experimenting with pulling data from the internet for my app, and everything works as it should when the app is run in the iOS Simulator or on my own device.
The frameworks I'm using are Alamofire, SwiftyJSON and GzipSwift; I cloned the Github repo of the Gzip framework, build it myself, dragged the .framework into my project navigator and linked it up (added the framework to Link Binary with Libraries under Build Phases).
Now, when I build the code for any specific device, it compiles and runs just fine, but when I select 'Generic iOS Device' as the target, the build process fails and tells me that it couldn't find the methods I used from the Gzip framework.
I am quite certain I missed some setting or didn't import the framework correctly, but I have no clue on how to fix this.
Any ideas?
I guess you build the framework only with the simulator architecture instead of building it for all architectures (arm64).

Xcode Generic iOS Device but no Emulators

I generated a build on an app for the App Store awhile back. Now I am making some changes but when I try to Run the app in Xcode v7.3.1 I see an alert saying "A build only device cannot be used to run this target. No supported iOS devices are available. Connect a device to run your application or choose a simulated device as the destination."
I can build the app and run it on my iPhone but my emulators have disappeared from the dropdown list of run targets.
I tried cleaning the build and setting Build Settings > iOS Deployment Target to 7.1 as suggested by others but to no avail.
How can I can get my emulators back in the list of run targets?
Xcode has been buggy lately, try to close out Xcode and re-run the project, If that doesn't work make sure your root folder which holds your project contains your project name an make sure the project names are exactly the same, this happened to me yesterday!

Xcode 7.1: Failed to build project <Project Name> for scheme

Has anyone faced this issue?
Been stuck trying to do a simple Xcode Bot integration with my simple project. Keeps coming back with this error that the bot wasn't able to build the project. From what I see, the scheme is just a normal scheme with the Unit Tests and UI Unit Tests. Bot is enabled Periodically and the Devices currently I've only set it to All Simulators (tried with others but it didn't work too). One thing I notice was when remove the Tests from the Scheme the Integration worked fine.
Thanks!
Was finally able to find the issue for this! Removing UI Tests initially showed that the integration was working fine. It seems that as Xcode UI Testing is only available on iOS9, the automated building would fail (without telling you the true reason) when testing on older simulators/devices. To overcome this I configured two separate bots:
Test for Unit Test Cases
Test for UI Test Cases (specifically on iOS 9 simulators / devices)
Hope this solves the issue for anyone else facing it!
It turns out, that in automatically updating Xcode it uninstalls the iOS 9.0 simulator and replaces it with the iOS 9.1 simulator. It doesn't think to update the build settings on the Xcode server.
So to fix the problem, you have to manually open Xcode on your server, it then prompts you to install several items which you need to do. Then go to xcode preferences > Downloads and you can reinstall the iOS 9.0 simulator.

Resources