Xcode Tips – Keyboard shortcuts to make your life a bit easier

Xcode

What follows is a list of keyboard shortcuts for Xcode that will hopefully make your life a little bit easier while coding. It is not meant to be an exhaustive list of every Xcode keyboard shortcut, rather a list that helps me during day to day development, and hopefully others will find it useful. I will be adding to the list as and when I find something else useful.

Switch between open windows: CMD + ` 

Switch between open tabs: CMD + SHIFT + } or CMD + SHIFT + {

Go to a line of code: CMD + L

Indent/outdent a section of code: CMD + ] or CMD + [

Show/hide the debug area (bottom pane): CMD + SHIFT + Y

Show/hide utilities (right hand pane): CMD + OPT + 0

Show/hide the navigator (left hand pane): CMD + 0

Show the Assistant: CMD + OPT + ENTER

Hide the Assistant: CMD + ENTER

Open Quickly Dialog: CMD + SHIFT + o

Search in the file: CMD + F

Search and Replace in the file: CMD + OPT + F

Search in the project: CMD + SHIFT + F

Search and Replace in the project: CMD + OPT + SHIFT + F

Switch between header/implementation files: CTRL + CMD + up/down

Comment/Uncomment a section of code: CMD + /

OPT + click on a symbol to see info about that symbol

OPT + double click on a symbol to go to the documentation

CMD + click on a symbol to go to that symbol’s declaration

That’s it for now. Check back as I will be adding to this list.

Share Button

OSX Tips – Turn off / Disable IMAgent from the Command Line

FaceTime

IMAgent is an OSX daemon which runs as part of FaceTime. You can disable it with the following command:

launchctl unload -w /System/Library/LaunchAgents/com.apple.imagent.plist

You can re-enable it with the following:

launchctl load -w /System/Library/LaunchAgents/com.apple.imagent.plist

You can test to see if it’s running with the following command:

sudo launchctl list | grep imagent
Share Button

OSX Tips – Turn off / Disable CalendarAgent from the Command Line

 iCal

OSX’s CalendarAgent can cause issues with processor/memory hogging from time to time. If you want to disable it yo can do so from the command line:

launchctl unload -w /System/Library/LaunchAgents/com.apple.CalendarAgent.plist

You can re-enable it with the following:

launchctl load -w /System/Library/LaunchAgents/com.apple.CalendarAgent.plist

You can test to see if it’s running with the following command:

sudo launchctl list | grep CalendarAgent
Share Button

Flickr Search Problems

flickr

If you’re using View Seeker and aren’t getting any results when searching using the Flickr service, the problem appears to be with Flickr’s search. The search is executing in the app correctly and not returning an error, however no results are returned, and hence the reason the app is showing a blank page rather than an error.

You can find a bit more info at this link.

Unfortunately we just have to wait for Flickr to fix the problem. Will keep you posted.

Share Button

OSX Tips – Turn off / Disable CUPS from the Command Line

CUPS

 

 

CUPS – the Common Unix Printing System is a modular printing system for unix-like operating systems, and is built in to Mac OSX. You may want to disable it to free up resources if you are optimising your system, and you can do so in the following way from the command line:

sudo launchctl unload -w /System/Library/LaunchDaemons/org.cups.cupsd.plist

You can re-enable it with the following:

sudo launchctl load -w /System/Library/LaunchDaemons/org.cups.cupsd.plist

You can test to see if it’s running with the following command:

sudo launchctl list | grep cupsd
Share Button

OSX Tips – Turn off / Disable Apple Push Notifications from the Command Line

Push Notifications

You can disable or turn off Apple Push notifications from the command line with the following command:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.apsd.plist

And you can turn it back on again with the following:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.apsd.plist

You could then test to see if it is on or off with either:

ps aux | grep apsd

or:

sudo launchctl list | grep apsd
Share Button

OSX Tips – Turn off / Disable Bonjour from the Command Line

 

Bonjour

If you are trying to optimise your OSX system and want to shut down services that you are not using, Bonjour might be one to target.

You can disable Bonjour with the following commands:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponderHelper.plist

You can then re-enable it with the following:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponderHelper.plist

You could test to see if the services are running using ps:

ps aux | grep mDNS

Or you could use launchctl:

sudo launchctl list | grep mDNS
Share Button

OSX Tips – Turn off Notification Center

Notification-Center

Does OSX’s Notification Center ever get on your nerves? You can disable it temporarily by holding down the option key and clicking on the Notification Center icon in the top right of your screen.

Or, you can turn it off using the command line:

sudo defaults write /System/Library/LaunchAgents/com.apple.notificationcenterui KeepAlive -bool false
killall NotificationCenter

The killall NotificationCenter command saves you having to reboot.

You can turn it back on again with the following commands:

sudo defaults write /System/Library/LaunchAgents/com.apple.notificationcenterui KeepAlive -bool true
killall NotificationCenter

If the icon does not reappear on your screen you can either launch the NotificationCenter.app application from within:

/System/Library/CoreServices/

or you can launch it from the command line:

/System/Library/CoreServices/NotificationCenter.app/Contents/MacOS/NotificationCenter
Share Button

OSX Tips – Disable Spotlight from the Command Line

Spotlight

If you want to disable OSX’s Spotlight in order to free up resources you can do so from the command line by disabling the daemon:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

And to turn it back on again:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Share Button

OSX Tips – Fix Audio Issues – Reset CoreAudio

Volume

Sometimes OSX audio gets its knickers in a twist and needs to be reset. One example of this is it you have a set of USB speakers plugged in and suddenly they are not picked up by the OS when previously they have been working fine. You can usually fix this issue with the following command from the terminal:

sudo killall coreaudiod

Of course a reboot would also work but this option just saves the hassle.

Share Button