Xcode 3.1.3 breaks console output - iphone

Today has been a headache - first my upgrade to xcode 3.1.3 trashed all my certs/provisions. After two attempts, I got them fixed.
Now, I'm dealing with the issue in the subject, no console output.
Absolutlely nothing is getting printed to the console - No startup info, not when I "print" a variable from xcode when stopped on a breakpoint,
not NSLog() either.
Nothing.
I've restarted my Mac, restarted Xcode, etc. I've made it so clears the console and opens it on project build. I had GDB log to a file,
and that works, so the plumbing is cool. Its just the console itself is dead.
Image: (and this is after attempting to print the contents of a variable while the app is running)
http://mr-sk.com/iphone/screen-capture-2.png
It doesn't seem to matter if I'm on the device or the simulator ...

That looks like the split bar is pinned all the way to the right side. Look for the dimple and drag it back toward the right.

I'd also try asking in the iPhone developers portal forum, since you can ask about beta versions of stuff there...

This is an older post, but I just recently ran into this with 3.2.3, so if someone happens upon this the answer by cdespinosa was spot on, however many of us "noobs" may not know exactly where to find those files, so just in case...
Go to Finder, find the folder where you have your .xcodeproject file and right click on it and click on show contents of this package. When the new window appears, move the .perspective, .mode, .pbxuser files to trash. (Make sure XCode is closed when you do this...I happened to do this while the project was open like an idiot and didn't think it worked the first time)
Now reopen xcode and your project. Your console should now be fixed.

Related

Finished running <App> on iPhone 6.1 Simulator

I'm developing a new application for Iphone, using Xcode (Version 4.6 (4H127)) and the iPhone 6.1 simulator (VersiĆ³n 6.0 (369.2)).
At the beginning everything was great: every time I pressed the "run" button, the application was loaded into the simulator and I was able to test it. But sometimes it is not working: when I press the run button, I only get the message "Finished running on iPhone 6.1 Simulator". The code successfully compiles (only minor warnings).
The main problem is that when I get this message, the only way I can use the simulator again (in this project, the rest of the xcode projects seems to work properly) is by starting a new project and adding every file to it.
I've tried to delete de derived data, restart de simulator, restart de computer, etc. Even I made a snapshot when the simulator was working, but when I go back to the snapshot state, the simulator still don't work.
What can I do? Any idea?
1.Manually launch the iOS Simulator.
2.From the "iOS Simulator" menu, click "Reset content and settings",
3.Close and rebuild your app.
This problem may arise when you have problems with your project's plist's target membership. Select your info plist file from project navigator folder structure's Supporting Files, go to interface builder pane(Utilities Section under View in Top Bar), then look for Target Membership in File Inspector pane, if it is checked, uncheck it. Clean & Build, Hope it helps.
Library > Application Support > iPhone Simulator > 6.1 (or whichever you're using) > Applications > Your Application and delete it.
Rebuild your app and relaunch.
I had the same problem, with the same "failed to attach to process ID 0" (I actually didn't notice that error until I saw that you said you had that error). In one of my projects the 6.0 simulator didn't work, but works in my other projects. Also my 5.1 simulator worked.
What worked for me was based off this other answer for a similar question: https://stackoverflow.com/a/12423912/159758
Go to the Product menu and find the Edit Scheme menu there.
While in Edit Scheme window, select the "Run" option on the left hand side of the screen and then on the right hand side, change the debugger from LLDB to GDB.
Run the project, this worked in the simulator.
Then Go back to the Edit Scheme and set back to LLDB.
I noticed you've tried setting the debugger to GDB and not a debugger, but thought I'd mention what helped me, since you're question helped me get to the bottom of my problem (i.e. seeing the "failed to attach to process ID 0" message).
This problem may arise due to presence of more than one info.plist file.
I also faced a similar problem, and eventually found that while adding some resource file from another project I also added its info.plist file.
Once check your Build phases> Copy Bundle Resources, whether another info.plist file exist there or not. If exists then delete it, clean the project and rebuild it.
Hope it helps.....
I ran into the same issue and somehow was able to fix it and almost immediately it went back to being broken. I can tell what broke it though.
I added a couple of folders (folder references) with files in them to the copy bundle resources section. That broke it. If I recall right, I had removed both of those and was messing around with DeploymentTarget. I might have reset the simulator earlier. Regardless, it started working. So,
there is hope for a fix
this thing is caused by folder resources that need to be copied into the bundle
Updated:
I was able to get it working again. Here is what I did..
- Cleared out the derived data folder
- Shut down the simulator app
- Also cleared the deployment in the simulator folders (Users/XXXXXX/Library/Application Support/iPhone simulator/6.1/Applications)
Since last time adding the folders to the bundle caused it to lock up, I tried it step by step adding one folder to the bundle and trying. Turns out one of my folders was named Resources and it dawned on me that particular name could potentially be colliding with something else the app looks for. So I renamed that folder to Res and tried it. It works now.
So there you have it.. Follow the steps above to get out of the problem.
Avoid copying folders called Resources to your bundle.

Xcode 4.2 not debugging properly

I've imported an iPhone app that I have developed for iOS and am now maintaining it. I've came across a couple of bugs when trying to add to the iPhone's calendar, which I'm happy to try and sort out myself with a bit of debugging.
One problem is that when I go to run the application on the iPhone simulator, it seems to run an older version of the app than the one I am running. I've removed and added another button since then and the old button is still showing when I run it in the simulator. However, when I compile and run this on a device, it loads the correct version and displays the correct version number in the 'about' view.
But... my main problem is that it doesn't seem to debug on the device properly. The app actually works fine except for the calendar problems, but if I put a few breakpoints in so I can see exactly where this is going wrong, it just doesn't seem to step through! The app pauses, and Xcode says the app has paused! I can press step over and continue execution etc and it appears to work, but I can't see it stepping over the code, nor can I hover over variables to see their values.
I've tried reinstalling Xcode multiple times (I did have a problem installing an older version, so I had to wait until the next version was available before Xcode would install).
The stress is: Today is my last day at work, and I'd really like to get this app ready for iOS 5 before I leave.
Has anyone seen these symptoms before? Is there a debug setting that I've missed? Or is it a corrupted installation?
I wish I could help people a bit with more information, but I don't even know where to start looking here. Any code I can post? any settings? (not too familiar with this, I'm a .NET guy usually).
Thanks!
Sorry you're going through a tough moment there Connell; as you said you're not too familiar with all this, I'm laying down a few steps which might help you out. Some are pretty basic, yes, but I've resolved to these steps myself several times when I've encountered similar scenarios;
If you're testing on the simulator, do a 'Reset Content and Settings' from the 'iOS Simulator' main menu. This will remove all old data and settings and give you a clean start.
Do a 'Clean All Targets' from the Build menu. Then go to your physical project folder and delete the Build folder from it altogether before starting to build again.
Restart both XCode and the Simulator (and your Mac too if possible)
Make sure the mode is set to Debug and not Release or Distribution
Even on the device, remove the old app before putting the new one in, and restart it for good measure.
Delete all Provisioning Profiles from the device and install just the one you need.
On the code;
I've noted that the app appears to 'pause' like this a couple of times when I had accidentally created an infinite loop in the code. Double check to see whether there's something which may cause this.
Unless you haven't already done so, throw an NSLog or two in there to see if its really not being executed beyond the breakpoint.
I've had the exact same problem with a project that I started on xcode 3 and then switched to xcode 4. What fixed it for me was changing the compiler in the project settings.
The default compiler up to xcode 3 was gcc, while the default compiler on xcode 4 is LLVM gcc.
Now, I don't know exactly what's the issue that gdb could have with LLVM gcc, but switching the compiler back to gcc in my project settings and doing a clean build fixed my debugging issues.
Might be worth a try.
Have you checked which debugger is being used GDB or LLDB? Select Edit Scheme from the Product menu, and see what the Debugger setting is under the Debug scheme. You could try switching between GDB, LLDB, and None and running in between.

Xcode crashes on opening xib files

I have problems with xcode and can't open xib files. Everytime I click on the xib file, xcode crashes. This happens on the xcode3.2 as well as the xcode4.
Is there anything I can do to it? I have un-installed and re-installed but still not working.
Any help would really be appreciable.
If it helps, I am using xcode4 and bought it from the app store.
My problem was custom fonts in XIB file. I had to install missing fonts on my computer and problem was solved.
The solution to this problem was to re-install my operating system. Basically, I had to re-install Lion and after that everything worked fine. I think the problem had something to do with some library files that were missing.
NOTE: If you have this problem then re-installing your OS might not be the only solution as easier solutions may present themselves. Some of the answers on this question could be of help and in other cases, a simple google or stackoverflow search could be of great aid. You could also try the Xcode mailing list. I would advice resorting to re-installing your OS only if you have tried 'everything' and no one is able to help, hence your plan-Z.
I had this same problem in Xcode 4.3 today. It is definitely a bug in Xcode and it has something to do with opening xib files saved with older versions of Xcode. To work around it, I did the following, some of which may not be necessary, but I'll list it all here just in case:
quit Xcode
copied my xib file foo.xib to foo2.xib
svn rm foo.xib
svn commit
svn update (now foo.xib is not on disk)
open my xcode project, foo.xib shows up in red since it can't find the file. delete foo.xib from the project.
drag foo2.xib from the finder into my project
click on foo2.xib -- for me it opened just fine
At this point I'm pretty sure it's either a subversion conflict with xcode or xcode is keeping a stale reference to a filename around. But now that I have the file open, I do the following:
Show the right-hand-side IDE settings pane (where you can set NIB options).
Click the top left icon in the right-pane (tooltip says "Show the File Inspector").
There is a section called "Interface Builder Document" and under there is a "Document Versioning" popup/combo box. My file shows Xcode 4.2.1, so I changed it to Xcode 4.3.
At this point I also fiddled with a few other settings in my nib, for example changing the title of a Window. The point of this was to make sure the nib would be re-saved.
Now in the left-hand pane that lists the project files, I clicked on "foo2.xib" and renamed it to "foo.xib" -- Xcode automatically adds it back to the subversion repository.
And everything just magically worked after that.
I will point out that I went through and changed all of my nib files after that to save as "Xcode 4.3" under the Document Versioning pane.
I sent a crash report and the nib contents to apple in a bug report but if anyone wants to see what actually happened I pasted it here:
http://pastebin.com/sC0pBUfu
I hope this helps someone, it took me about four hours to sort this out. Recreating nib files doesn't work, its a problem with the filename and IDE-version saved into the nib file I suspect.
Just Install one xcode at a time. Means use Xcode 4 or Xcode 3.2 alone. This may solve your problem. Try that.
Edited with new suggestion from http://www.cocoabuilder.com/archive/xcode/305032-xcode-help.html :
If you have entirely uninstalled and then reinstalled XCode, and by
uninstalled I mean running
sudo /Developer/Library/uninstall-devtools -mode=all
and then trashing /Developer and then reinstalled and it's STILL not
working then from the error I have to think you have a corrupted OSX
or a stray library.
I googled and found a couple of people who succeeded by reinstalled
SnowLeopard (and then upgrading it all the way to latest patch level,
then reinstalling XCode), and there were a few people who had found
stray libraries in /usr/local/include and /usr/local/lib, so you might
want to go look for odd files there, or perhaps TEMPORARILY rename
them and try reinstalling XCode, I'm not sure how much of what's in
there you really need. The particular post I found they guy had
installed ImageMagic and he had removed those libraries from
/usr/local/lib and was working again.
At this point I'd be looking beyond XCode itself and assuming my
system was corrupt.
There's more suggestions on Google, just put in CFXMLNodeGetInfoPtr
and there are loads of posts, more asking than answering.
and Don't use the App Store version. Use the one on Apple.com/Developer for iOS SDK's.
Create a new XIB. Click once. If not:
Don't just open the xib, right click Open As : Source. See if you can see anything, if it still crashes:
Does not seem to a Xcode.pbxproject error
Well, one way can be..:
type interface builder in spotlight
open it.
go to your project and drag & drop your xib to the interface builder on the dock.
It will open.
This problem may be because of multiple versions of xcode on different locations on your mac.
Can't open any xib file for iOS? In your crash log,
Details: Interface Builder encountered an error communicating with the iOS Simulator. "Interface Builder Cocoa Touch Tool" (5963) failed to launch and exited with status (null), signal 5. Please check Console.app for crash reports for "Interface Builder Cocoa Touch Tool" for further information.
Have you checked your console log using Console.app? Anyway, it sounds like that your Xcode environment is corrupted.
sudo /Developer/Library/uninstall-devtools -mode=all
If you put any files into /Developer, back it up.
sudo rm -rf /Developer
reboot.
install Xcode.
Its an XCode bug.
Creating a new .storyboard and opening it before opening .xib will fix the crash, at least temporarily.

Xcode 4 not launching application?

Today, after installing Xcode 4 with the 4.3 SDK, I attempted to launch my application. However, the application will build and the iOS Simulator will pop up, but I get a message in the window in Xcode that says "Attaching to YourApp" which stays there indefinitely. How can this problem be fixed?
I had the same problem, that is, when I launched my application in the simulator, Xcode was hung waiting for the simulator to start. The simulator showed a black screen - nothing at all.
Note this is a project that ran fine on Xcode 3 and is the exact set of files used to build the application that is currently for sale at the App Store.
Okay, so here's the underlying problem, and my solution:
My application name was "ultimateTimer.app", as seen in Xcode under the Products folder. However, this was NOT the name in the project file.
Here's how to found out:
Click on your project in Xcode (it's usually at the top, e.g. mine is called ultimateTimer.xcodeproj). Under "Build Settings" tab, look for the "Packaging" area and specifically for the "Product Name" variable. Under Product Name, I had three entries:
Debug
Distribution
Release
Under Debug, it had the value "TalkUltimateTimer" which was an old name of mine. When I changed this to "ultimateTimer" to match the "ultimateTimer.app" as above, I found the Xcode attached to the simulator correctly.
This happened for me for iPhone applications. I opened the simulator myself and switched the device to iPhone Retina Display and from then on it worked. I tried switching back, but it didn't work again, so I have had to keep it on the Retina Display simulator, and if I need to test non-Retina Display I'll use the iPad simulator.
I skimmed the post and these seem to be the two solutions thus far:
I think I figured out the problem:
I went to 'Edit Schemes', and for some reason, the scheme I was using was pointing at BumpDev.app as the executable instead of bumpdev.app. Changing this made things work. Perhaps there is an issue when converting from xc3 proj files?
Anyways, the app now boots in the simulator. Yay!
And the other solution in that post is:
Did your project by any chance have a folder reference with images in it?
For me the problem only happens when I have a folder reference in the project. When I remove the folder reference and instead add the folder as a group, clean the project, and hit launch things work fine. In the "Copy to Bundle" phase each image is then listed individually, whereas when I had a folder reference, the whole folder was listed.
This took me a really long time to figure out. It was quite frustrating, but I'm glad I have a workaround until the bug is fixed.
I had the same problem after swapping the mouse for a new one. restarting my iMac resolved the issue.
I just upgraded to Xcode 4.3.2 and had the same issue with new projects. After poking around and comparing projects, I found out that new projects were set to the LLDB dbugger and the projects that worked were using GDB.
After changing the debugger for the new project to GDB, it worked. I am yet to research what the differences are, but at least I can now run my new projects.
Ensure you are starting a proper scheme.
I. e. when using CocoaPods, running Pods scheme would not start emulator.
It's a known issue. Have a look at this thread in the official forum.
Hey, update Xcode to 4.0.2. Problem solved :)
I had the same problem, I tried every solution here, but no works. Finally, after I rebooted my computer, the problem was gone.
Restarting the simulator worked for me

Xcode Debugger Console doesn't display anything

I've been developing iPhone applications for a while with Xcode. But since this morning, my debugger console doesn't display anything anymore. I've reinstalled Xcode, but it doesn't help.
Has someone had a similar problem? What can I do to repair it?
Thanks for your help.
If the console doesn't even display the welcome message maybe see (in Xcode preferences) if the font you are using somehow became corrupted. Also see what foreground color you have assigned for the font and that it isn't a white color. If you click in the console window is there text that is not visible but that you can select?
If so, try Cmd+C and paste it in TextEdit maybe. Also try switching the debug prompts to another font. You will find the settings for switchings those prompts under Xcode prefs > Debugging in Xcode 3 and under Fonts & Colors, I believe for Xcode 4. Even though you did re-install I can't remember if the preferences plist will get deleted in the re-install. The Xcode preferences plist should be under ~/Library/Preferences/com.apple.Xcode.plist. Try renaming that file temporarily before starting up Xcode.
If the console does display the welcome message but you get no output from your program see if you are using an NSTask and setting stderr to be used for your own output. I had this happen once but I was also using SenTestingKit at the time to do my unit tests and somehow it ended up to where noone was able to print to the console - not my cli program and not the testing kit.
As a last resort, Xcode 3.2.4 is out since a few days.
I had the same problem, after I created a new scheme for testing target according to Apple Unit Test Tutorials. I was seeing only (lldb) message at the top left corner and nothing else. I deleted this scheme and it started working normally. I think, I made something wrong, when followed instructions.
So, try to delete schemas, except the main one.
To anyone wondering why console output isn't shown in tests, ensure the following is selected in Xcode prefs: