Xcode build successfully but iOS Simulator didn't run - ios

I've developed a camera app with the swift language. Build processing succeeded in Xcode and iOS Simulator was done.
But app list in iOS Simulator didn't include my app.
And an error occurred.What's wrong?
Two screenshots of my project are added below:

Like Joel said, try changing the scheme that you are running. Right next to the simulator selector, there is the scheme selector; select it, then the project instead of the framework.

You can try this, it worked for me.
Go to Product on top xcode. Follow this flow.
-> Product -> Scheme -> Edit Scheme -> Select "Run" in the sidebar -> Info on tab -> Change the drop down box labeled Executable , changed it with your app. -> Close -> Run again.
Hope it will help you.

From your screenshot it looks like you have the wrong scheme selected. Make sure you select the scheme for your iOS app, not the framework. The little dropdown to the right of the stop button in the upper-left corner.

Using any 3rd party libraries?
Simulator relies on x86/x64 builds, but 3rd party libraries occasional don't have a matching binary for the simulator.
Result: Sim runs in to an error during compile while the app runs on a device. You should get an error in this case.

Related

Xcode 9.1 cant start the Iphone simulator

I just installed Xcode 9.1,before Xcode 9.1,when I click the "Play" button on top,the Iphone simulator start automatically.But after install Xcode 9.1,the iPhone simulator didnt start,no error,no phone appear on screen,only Xcode show build success.
Can somebody tell me how to solve this?So I can test the project on Iphone simulator.
Edit
After looking for a question in So,I able to start the simulator,by doing
Click on Target next to Play Button -> Edit Scheme -> Run -> Change
the Executable to "My Project"
The iphone simulator can start,but it give me this error
Any idea?
There seems to be a issue with iPhone simulator.You can see this issue in fastlane's git hub page as well. Happens more often when you are using command line tools.
Solution : Simply tap command + space opens hot search, type simulator and hit enter,
your simulator might not load and show an error thats fine. Now go to actions select simulator and say Reset Content and Settings.
Now go back to your Xcode and re run the code. Hope this resolves the issue

A gear icon appeared in my Xcode app icon project and I cannot run it anymore

I've added a framework and a library (spring) to perform animations with buttons, etc.
Now instead of one app icon to launch, in x-code, I got three, and can launch them all except the main one. The main app icon it's now a gear, and I cannot run it because x-code don't let me select any device to launch it. I can only select my mac, as you can see in image...
There is also another thing. The yu.app in product folder turns to red only when I'm in the main app. When I choose spring it turns black again. Anybody know how to fix this issue?
Do following
1 - Navigate to manage scheme
2 - Remove older scheme
3 - Create new scheme
For removing files of older scheme you need to remove derived data.
From XCode Window > Projects > Select Your Project > delete derived data
All the answers here suggest a way which may work but not the proper solution.
Just select your scheme, go to Edit Scheme. Go to Run. In Executable dropdown select the correct app and it will start working. No need to create new scheme or delete any scheme.
Navigate to Manage Schemes add a new scheme for your app target yuApp and remove any outdated schemes.

Xcode-Instruments cannot run app on simulator with the app target I choose

I am trying to run an automation on an iOS App using UIAutomation with Instruments.
It had worked well when I had tried it out a few weeks back. However, I tried out another automation testing framework (KIF from Square) in the meantime, and now when I try and run Automation with Instruments, it refuses to work.
When it had worked, I had carried out the following steps:
Open my app in Xcode
Run the app
Quit the iOS simulator
Open Instruments (not necessarily through Xcode, but just by searching for Instruments in Spotlight), choose Automation
Instruments opens, and when I click on Choose target, I do not need to browse for the target. I can see the name of my app in the list (description: the app name is without the .app extension and has an icon before the name like the icon which appears at the top of the output window in Xcode - a black and white icon with a gradient) even though I haven’t opened it before i.e even when I had opened Instruments for the first time.
I choose this target from the list, choose a javascript file for the automation to run, and then click ‘Record’. The automation used to run and I could see it run in the simulator which used to open up.
However, opening Instruments no longer shows me the target in the list of targets anymore.
I have tried choosing a target from my filesystem (from the Derived Data folder) as well as from the iPhone Simulator applications folder; but no luck. The target does not appear as it used to before (in the description above), but appears with a .app extension and with the typical application icon. The automation does start and open up the simulator, but gives the following message: (although the page or the script haven't changed at all)
Cannot perform action on invalid element: UIAElementNil from target.frontMostApp().mainWindow().elements()[2]
(Would have liked to post images, but can't, since I am a new user and do not have the required permissions yet - hope the description makes up for it)
Have been stuck on this issue for long and any help would be appreciated! Thanks so much!
I just profiled the app using Product -> Profile in Xcode, and that opened up Instruments with the target. The target was the Unix executable under Derived Data -> MyApp -> Build Products -> Release-iphonesimulator -> MyApp.app -> MyApp unix executable.
Also, while using KIF, I had enabled accessibility labels for some views in the storyboard. While running the automation tests in Instruments, the app seemed to somehow consider the views which had the accessibility labels set as one single element and could not access sub-elements on this view. In order to run with Instruments, I just disabled the accessibility labels for the views and it worked like a charm again!

Base SDK Missing xcode 4.3.3

I used OSX 10.7.4 , Xcode 4.3.3 and iPad iOS 5.1.1 . I already run my app to iPad but the app cannot be open. i find out that my Xcode is base sdk missing. i also don't have the folder that can select to simulator. there's only folder for MacOSX10.4u.sdk MacOSX10.5u.sdk MacOSX10.6u.sdk only. How can i run my app perfectly.
Update:
this is the problem
and there's no iOS sdk
Head to your Project Settings, and under 'Summary' change 'Deployment Target' to whatever you like (say, '5.0'). If that doesn't work, select 'Manage Schemes' via the 'Product' menu and then 'Autocreate Schemes Now'.
Is this either one of your old projects or even some project you got from somewhere else (including even the sample projects that Apple provides)? You can fix this "Missing Base SDK" by selecting the project on the top of the panel on the left (in this example, it's one of Apple's samples, "Recipes", and then click on the "Validate Settings" button:
After doing that, you'll probably get a message about updating your project. Go ahead and you should be good:
If you just created the project, then it's something else. But this is the most common scenario for "missing base SDK".
I came here looking for a solution for XCode 3.2.6 but other answers did not seem to apply. Further experimentation found that Project -> Edit Active Target and then setting Base SDK on that page was just what I needed. Hope this helps the next guy that stumbles through.

Xcode can build a project but can't run it on simulator

When I download a project from the web, sometimes it can be built but doesn't run (XCode -> Product -> Run is disabled, in grey). This never happens when I create projects myself. What could be the problem? Is it somehow connected with version?
I'm new to iOS development and download projects from the web for studying purposes. It's a pity not to be able to test them on the simulator.
Generally, if you can't Run a project, either:
It doesn't have a build scheme that knows how to "run". Check at the top next to the Run/Stop buttons that there's a profile name and target device shown. If the box says No Scheme then click on it and create a New Scheme. If there IS a scheme, click on the drop-down menu (left divider in Xcode 4.2+, anywhere on the box otherwise) and go to Edit Scheme to make sure the scheme was set up correctly for Running
It doesn't have a build configuration set. You should see this in the Run section of your build scheme. Check there's one selected. If the list is empty, go to the Project icon at the top of the leftmost pane, select the Project, go into the Info section, and create a build configuration, although there should already be at least one if you can build the project
It doesn't have a runnable target at all, which might mean you've got a project which compiles to a static library or framework for use in OTHER projects. If this is the case, you should see the icon for your build Target as a yellow toolbox (framework), or a little white building (a "library", although to me it looks more like the United States Supreme Court Building).
The target isn't valid for the Simulator, which means you might need to add i386 to the list of Architectures and Valid Architectures on the Target before you can run it
The target isn't valid for the currently connected device. For this one, check the Deployment Target number is set back enough to be valid for the device's version of iOS
Xcode can't see the connected device. Try unplugging and plugging it back in. If it still doesn't recognize it, you may have not added it to Xcode (Window -> Devices -> Select the device -> Use for Development)
Make sure that in your Edit Scheme (click on your project name next to stop button -> Edit Scheme), in the Info tab of the Run menu selection, that your .app is selected as the Executable. I had this issue and "None" was selected, happened after refactoring the project's name and reconfiguring the build targets.
you may download a project that the deployment setting (the ios version) is higher than the one your xcode support. if this is your situation, you has two options to sovle the problem.
try run the project in a older deployment option. follow these instructions (
if the project just setting to a higher version but not using any feature of the higher version. this approach should work):
select project file in xcode > select the target you are going to run > select summary tab > in section 'iOS Application Target' > in the combo box about 'Deployment Target' select the version that your Xcode support.
and then you could select and run the project in the simulator.
if the project dose use features in the higher version, then you should update your Xcode in order to run the project.
Hope this helps!
In my case the issue was really simple, I needed to check "Launch: Automatically" check in "Product > Scheme > Edit scheme > Run" menu.
When this setting wasn't checked I cannot find App icon in simulator to launch application.
In My Case Sole by Go->Project->Architectures->Architecture=select standard architectures(armv7,arm64)...
same as
Go->Target->Architectures->Architecture=select standard architectures(armv7,arm64)...

Resources