Xcode builds successfully but doesn't run - ios

I tried both Xcode 4 and Xcode 5 to build and run my projects. Previously they work fine but suddenly they just stop running/updating the simulator and device despite showing build success. I tried searching for solutions over here but none of them worked for me.
I've checked at the Edit Scheme page, at the Build tab on the left panel, among Analyze, Test, Run, Profile and Archive, Run and Profile were greyed out. Is this the cause of it?

I would try what Nitin said above, and also clear the derived data. You can do this by:
Opening the organizer (in the window menu)
Going to the projects tab
Clicking delete by derived data on your project

Related

Archived app wont appear on organizer after a few updates

I was compiling my app and archiving it correctly with no problem whatsoever. I added a charts library to the app, did some stuff with it, archived it fine but Apple didnt let me upload it because the library wasnt correctly referenced in the app.
So I fixed that problem and tried to archive it again, but it just wont appear on the organizer.
Skip install is set to NO
Archive in the scheme is checked
Reveal archive in organizer is also checked
How can I fix this?
Simply try this steps:
Reopen your project
Clean Xcode & Remove derived data
Change build number & version number
Make archive now
Note:
You are able make archive earlier, so it could work perfect after this steps. Unless you have changed any settings in Xcode.
Edit:
Go to targets - build settings & find "Installation Directory". Make sure there is "$(LOCAL_APPS_DIR)" added.
Go to Edit Scheme -> Build tab, Make sure you have archive check box selected. Check image below:
Go to Edit Scheme -> Archive tab & make sure the check box "Reveal in organizer selected"
See below image:
Hope it will help you.
I know this is an old item... However, I encountered the same issue today and tried all the above suggestions and still no luck.
Was able to work around it by using Finder and going to the build > iOS > archive folder of the application. Then right click on the .xcarchive file and open with Xcode.

xcode 6.3 hangs when opening organizer

I archived my project for adhoc deployment and it got stuck after it said archive completed.
Now whenever I click Window->Organizer Xcode freezes up. I need to save my archive for adhoc deployment but it just won't let me. I've tried restarting xcode and my macbook.
Any thoughts?
I don't know what was causing my xCode (6.3.1) organiser to freeze, but I manually cleared out the Archives folder and organiser returned.
rm -rfd ~/Library/Developer/Xcode/Archives/*
If, like me, you have archives you want to keep, remove individual archive folders by date order as needed and then try open organiser.
rm -rfd ~/Library/Developer/Xcode/Archives/2015-xx-xx
I removed all of the archives in Archives directory but the Organizer kept on hanging.
If you have too many different products (mine are over 200), Organizer shows up, then the colored wheel appears and keeps spinning forever. Move most of the directories in the ~/Library/Developer/Xcode/Products directory somewhere else, and leave the needed ones only. That fixed the hang for me.
I had this too and filed bug 22455581 on it.
Xcode 6.4 and 7b5 (I didn't try 6.3) do something with the archives when the organizer window is first opened after each launch. This something takes a bit over a half second for each archive during which time all you see is the spinning beachball of death and Force Quit declaring Xcode is unresponsive. So in my case with 7+GB of archives, had I waited a thousand or so seconds, the organizer window would have eventually popped up.
As answered above, the workaround is fairly simple: quit Xcode and reduce the number of archives in ~/Library/Developer/Xcode/Archives. Move them out to somewhere else so you can move them back in as needed.
Someone at apple forget to do stuff on the background thread,... They look into all your account that xcode has access to and than scans all the folders for files. Also it makes a lot of webcalls for each related project to get crash logs. During this process the entire main thread stalls until it is all finished.... You cannot really do anything yourself for it except complain to apple or try to keep the apps/accounts you use at the same time to a minimum (not a real solution...)

XCode won't run my application on a device/simulator anymore

I am kind of stuck with my XCode problem. First of all: I have a project that contains 5 different targets. Now something went wrong (I can't remember changing anything related to project settings).
If I want to run any target on device or simulator the build succeeds but then nothing happens. Neither the app is started in simulator nor on a device. So I checked the Scheme (-> "Edit scheme") and I could not select my app in the Executable menu. I think I can remember that the .app file was selected there before (as it is if i create any new project). Does anyone know why I can't select anything there?
What I am curious about, is the fact that choosing "Other" in the Executable menu brings me to my DerivedData directory that indeed contains the *.app file resulting from the build. That leads me to my next problem.
If I select this *.app file explicitly and try to run the app XCode gives me the error " does not have an architecture that can execute." But I checked my settings many times and I am definitly using $(ARCHS_STANDARD) in every target.
I am a little bit lost here ... does anyone has a hint, what could have messed up my project and how to fix it?
Might not work, but I've found a lot of bugs in xcode which simply require quitting it, and reopening.
You could also try clearing out the DerivedData directory. Do a full clean build (hold down option key when selecting clean build).
And lastly, reset the simulator via the menu iOS Simulator > Reset Content and Settings.
I got this when I changed the name of my App on one development machine and then tried to work on it a few months later on another machine. I fixed it by deleting the old scheme and Autocreating the new scheme. The settings are under Product - Scheme - Manage Schemes.
OK I solved the problem by myself. I was on the right track before. I did compare the project.pbxproj file again using FileMerge. I merged all lines related to an *.app file from the working version into my corrupt project file. After that my project was fixed. The *.app files showed up under the "Product" group in XCode and I could run the application on simulator/devices again. It seems that I forgot something while I was merging the files via copy & paste. ;)
Rather than cleaning out the DerivedData directory from Xcode, have you tried the "old fashioned" way from Finder? Try quitting Xcode, nuking ~/Library/Developer/Xcode/DerivedData/ModuleCache from Finder, and restarting Xcode.

Spark Inspector

I am interested in Spark Inspector, but i cant use it in trial mode.
I installed latest version. Then i used framework setup assistant, but it not helps.
Building settings are correct - i checked it step by step with this instructions: http://www.sparkinspector.com/framework_setup.html
I also tried to clean project and delete app from iOS simulator.
The app is for iPad, i don't know is it matter.
The error i getting is: "Setup did not complete successfully. The Spark Inspector timed out waiting for the console to settle."
I love this tool - It actually includes a wizard that lets you choose a xcode project and sets it up for inspection. try using the built in wizard.
EDIT: With version 1.3.3 of Spark Inspector, it seems it sometimes takes a while for SI to connect to the process. After you get the error, try clicking the OK button and wait for about 30 seconds. It should eventually connect. Otherwise, try some of the other tips below.
Deleting the Xcode Derived Data sometimes fixes this for me:
launch Xcode
from menubar: Xcode > preferences
click the 'Locations' tab
beneath "Derived Data" you'll see a path with a small arrow icon, click on the arrow
from the Finder window that appears, drag the 'DerivedData' folder (should be automatically selected) into the trash
quit Xcode
restart Xcode and try launching Spark Inspector again
Another thing to check is to make sure your command line tools are setup to run the same version as your current version of Xcode (happens sometimes if you have multiple copies installed at the same time like a beta):
launch Xcode
from menubar: Xcode > preferences
click the 'Locations' tab
Check the current value for 'Command Line Tools'. If it's not the same version as the Xcode version you're trying to run Spark from, then:
Select correct version
Delete the Derived Data
Quit Xcode
Restart Xcode
Clean your project (cmd-K)
Try re-running with Spark
I had the same problem. Make sure you have the dylib in the following path:
Applications/Spark Inspector.app/Contents/Resources/Frameworks/SparkInspector.dylib
I re-installed the application, force xcode to quit, re-opened xcode and the project. I've clean the project as you did and then use Product-Inspect with spark.
It takes few secondes to start after the simulator is launch. It also breaks on a line on the debugger until the inspector app is launched.
Hope this will help

Xcode Build and Archive for Enterprise Distribution builds old archive

I'm working on creating an app for in house distribution enterprise level. I've created the app and tested hosting it on my own server and even getting the click to install working. Now though I have some updates to the app, I make the edits and I even see them in the simulator. When I build and archive the app things seem fine, then I go to the archived project in the organizer window, click the share button and distribute for enterprise, I enter details such as the ipa final url and the app title and then ok & save. Then I upload the app to my server and update any links to point to this new app. The click to install still works properly, but it installs the old version of the app. I've even tried this on a new device. Is there some step I'm mission that tells Xcode some version to build? If so, I don't get is how the simulator shows the update fine, but the archive that is built is not showing the latest code. The app I can find in the simulator dirs is 9.4MB in file size, but the one that is saved after build and archive is only 1.4MB (the update involves a lot of added images), so is the build for archive is not even getting the new files?
if a clean won't work, try completely removing the derived data folder.
the default location is in /Users/you/Library/Developer/Xcode/DerivedData . if you haven't played with the DerivedData location in preferences, this is likely where you'll find the sub-folder containing the cache.
when i encounter a situation similar to the original question (retaining items i've deleted, or similarly missing items i've added or holding onto project icons i've changed), i perform a clean on my project, close it, hit Deleteā€¦ in the organizer, possibly even remove it from the organizer, possibly even remove from disk and then re-checkout from git if you have it under version control in this way, then re-open the project from scratch.
I figured it out and thought I should post it in case it helped someone else.
I cleaned the project.
Build > Clean - not 100% on what "Clean" is supposed to mean/do, but it allowed the project to build from the current files rather than the old files somehow.

Resources