iPhone SDK development on multiple computers

Sometimes it’s good to be able to use several computers to develop your iPhone app. In my case my main development machine is the iMac, but summer is coming up and I may not want to stop developing just because I go out of town. Luckily I have a MacBook, on which I have also installed the iPhone SDK.

In order to test on the device when I develop using the MacBook I have to move my certificate, private key and provisioning profile to it. Here’s how I do that.

1. Launch Keychain Access on the iMac (main development computer).

2. Under the Keys category I Ctrl-click the private key that has the certificate for ‘iPhone Developer: ‘ attached to it.

3. In the context menu select ‘Export …’.

4. When saving provide a password, which will be required for importing on the other computer.

5. A .p12 file was saved, transfer it to the target computer.

6. Grab the development provisioning profile (either by downloading from the iPhone Program Portal or by grabbing the right one from ~/Library/MobileDevice/Provisioning Profiles/) and transfer it to the target computer.

7. Double click the .p12 file on the target computer. If you provide the correct password the key and certificate will be installed into the Keychain on the target computer.

8. Drag the provisioning profile onto the Xcode dock icon.

The application can now be installed on the device from the target computer, which in my case is the lovely black MacBook.

Mac OSX Leopard Snow vs Windows 7

AppleInsider has published an in depth look at the competitive origins of Windows 7 and Mac OS X and why the products aren’t really direct competitors.

The operating system most users end up with will depend upon what hardware they choose to buy, not the specific feature details of the software that system happens to run. History reveals that the hardware decision isn’t going to be based primarily upon features.

The following presents a historical overview of the competition between Apple and Microsoft in the operating system market leading up to this year’s face off between Windows 7 and Snow Leopard. While modern Macs can now also run Windows, Apple is the only PC maker to refrain from actually licensing it from Microsoft as an OEM; in contrast, Apple’s Mac OS X only legally runs on the company’s own premium PCs. That has enabled Mac OS X to differentiate Apple’s hardware from other PC vendors using easy to demonstrate software features and tighter hardware integration, winning back some of the ground Apple lost during the decade of the 90s.

Read More

 

MacOSX leopard Snow

MacOSX leopard Snow

 

Windows 7

Windows 7

How to Bounce a Message to the Sender in Leopard’s Mail.app

 

If you receive an email from someone that you really wish didn’t have your email address, you can make them think that they don’t. By using the Bounce functionality that is included in the OS X mail client to fool the pest into thinking that their email did not reach the intended goal. The sender will receive a notification that the email was not delivered because the addresses had permanent fatal errors and the user is unknown.

To Bounce a message from the Inbox:

1. Right-click the desired message.

2. Select Bounce from the menu.

 

 

The message will disappear from the Inbox.

To Bounce a message from the Message Window:

1. If you are viewing the trouble email, go to the Menu and select Message

2. Select Bounce.

Using Preview to Make timed Screenshots in Leopard

By using Preview’s Grab utility, you can easily make screenshots of your Mac desktop and application windows. While you can use various keyboard shortcuts to take screenshots, it is sometimes easier to use mouseclicks instead of the keyboard. Another advantage is that Preview gives you the option of taking timed screenshots that allow you 10 seconds to set up your shot before it snaps the screenshot.

 

1. Open Preview.

2. Go to the menu, click File, mouseover Grab and select one of the three options:

Selection – this option produces a crosshair cursor for you to click and drag around the area to be included in the screenshot.

Window – a camera cursor appears. Move the camera to the window that you want captured and left-click the mouse.

Timed Screen – you will be given 10 seconds before the screenshot is taken. This is helpful when trying to capture menus and submenus.

 

How to put your mac in Hibernation!

Mac OS X has this concept of «Sleep» and «Shutdown».    

By default, «Sleep» will turn the computer off but my MacBook Pro will still have the white light, switching between dim and bright. In this case, you cannot totally switch off your MacBook Pro as you would like to do in Windows.
However, if you «Sleep» using your laptop battery, once the battery runs out, MacBook Pro is smart enough to save all contents in your RAM to hard disk. This is called a «Safe Sleep«.
Wouldn’t it be nice if we could choose to hibernate whenever we want so that if we are not using the laptop for a few hours, instead of putting the laptop to «Sleep», which will still drain the battery, we can «hibernate» the laptop and restore our applications (as it is) when we start it up again.
Macworld has an article that contains comprehensive information about this. Here is the summary.
  • First find out what is the current setting of your sleep mode, using:
> pmset -g 
This will tell you which sleep mode you are currently on. The following displays different sleep mode:
0 – Legacy sleep mode. It will save everything to RAM upon sleeping but does not support «Safe Sleep». Very fast sleep.
1 – Legacy «Safe Sleep». This is the «Safe Sleep». Everything your laptop goes into sleep, it will save everything to harddisk. Slow on Sleep and Startup.
3 – Default. As described above, when sleeping, contents are saved to RAM. When battery runs out, hibernate occurs.
5 – Behaves as 1 but applicable only for modern Mac that uses «Secure virtual memory«.
7 – Behaves as 3 but applicable only for modern Mac that uses «Secure virtual memory«.
  • For me, I am using iMac and I know that I am using «Secure virtual memory» (System Preferences -> Security), so 5 is my choice. I want my Mac to hibernate everything I sleep.
  • Make an alias in your .bash_profile under your home directory:
alias hibernateon=»sudo pmset -a hibernatemode 5″
alias hibernateoff=»sudo pmset -a hibernatemode 0″
  • «Source» your bash_profile file and your are done!
  • Whenever you want to hibernate your computer, if it is not set already, just go to terminal and execute hibernateon. If you want to turn it off, hibernateoff and you are all set.

It was known that if you want to avoid hassle setting up in command line, there is a dashboard widget, called Deep Sleep that will do the trick do. Somehow it does not work on my iMac properly.

Show hidden files and folders in Mac OS X Finder

First, open Terminal.

Type this command, then press enter:

defaults write com.apple.finder AppleShowAllFiles TRUE
To allow the files to be shown, you must restart Finder. You can do this by holding the Option key, click and hold the Finder icon. When the context menu shows, select Relaunch.

Finder will now restart.

Now all hidden files are showing!

To hide files again, type:

defaults write com.apple.finder AppleShowAllFiles FALSE
In the terminal instead, and restart Finder.

You can also restart finder by using the following command from the terminal:

killall Finder