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).
Related
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"
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!
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.
So I just installed Xcode 6.4 to start some development on my new Mac, and after creating an empty iOS project, I see the message "No OS X or iOS Targets Found". I also see a message under my project folder: "base SDK missing. But I was under the impression a normal install of Xcode also installs all basic SDKs required for Mac and iOS development?
It seems there is absolutely no information on this message on the web. I think it is not an error per-se, more like I need to create or import some build targets, but can anyone explain what I need to do to get my project built and running?
I also need to use XCode with Cordova (or PhoneGap), but there does not seem to be any clear information on how to get XCode properly set up for that. Any pointers for this would be appreciated.
I haven't created an empty project in a long time so can't really comment on the empty project. But to make your life MUCH simpler, I would use one of the default templates and go from there. The simplest is probably the "Single View application".
Admittedly, this does not solve the issue, but it will get you going (which I assume is really what you want to do).
Go to the Project menu, then Edit Project Settings. Select the Build tab, and near the top, there is a Base SDK setting.
Choose the latest iOS.
You might need to clean the project or restart Xcode.
I have found many tutorials (such as this one) that mention being able to set the base SDK for a project's build settings to use, say, the iPhone Simulator. I am running the latest version of Xcode but the only SDKs that seem to be available are MacOS and iOS. Even after downloading some of the older simulators from Preferences>Downloads, I don't see any additional SDKs available.
I don't know if I broke something, or if I'm not even supposed to be able to select any of the simulator SDKs as the base SDK. I'm still too new to Xcode to really know. From questions such as this, I'd assume that I should be seeing at least an "iOS Simulator" as an option.
I previously was trying to experiment with compiling via makefiles and so was installing various command line tools, so I'm not sure if something just messed up my environment. I tried uninstalling xcode and developer tools entirely and reinstalling from the latest version on the app store, but it doesn't seem like it changed anything. I can't even seem to get an existing project to build for the simulator, when a while back it used to be able to, so it doesn't even seem to matter which project I have open.
Did I break something, or am I just missing something obvious?
You are missing something obvious. :)
The Base SDK has nothing to do with running on a device or the simulator. Leave the Base SDK as "Latest".
To run your app in the simulator, notice the dropdown menu in the toolbar just to the right of the Play and Stop icons. In the dropdown, choose the target to build and then the device or simulator you want to run with. Once chosen, go to the Product menu and choose Run (Cmd-R).