Monday, November 28, 2011

Installing more simulators for xcode 4.2 without re-downloading everytime

If you are like me, who use more than one machine to develop iOS app and wants to install 4.x and 3.x simulator without re-downloading it on every machine? then I've got a solution.

This is how I setup my installation - a 2 step process.

1. Find the .dmg files which is downloaded by XCode 4.2 and download it seperately.
2. Spoof your hosts file of the machine to point the files you have downloaded already.

Direct download link for 4.3
Direct download link for 3.x

Step 1:

By inspecting the console.app I was able to figure out the URL of .dmg xcode trying to download.

Eg. The path for 4x simulator is

http://adcdownload.apple.com/Developer_Tools/ios_simulator/ iphone_4.3_iphonesimulatorsdk4_3.dmg


which resolves into

https://developer.apple.com/downloads/download.action? path=Developer_Tools/ios_simulator/iphone_4.3_iphonesimulatorsdk4_3.dmg


Now, Open the xcode and select more simulators from the menu.

click install on any of the available option to keep the session validated against your developer acccount.

Once it started to download the file after authentication, just stop it.






Step 2:

Place your downloaded .dmg in
 <yourhomedir>/Developer_Tools/ios_simulator/iphone_4.3_iphonesimulatorsdk4_3.dmg

Start apache on port 80 and update /private/etc/hosts to have

#xcode4.2 legacy simulators dmg proxy
127.0.0.1 adcdownload.apple.com

Switch to xcode and click install again to install the simulator from your local machine without re-downloading.

Note:
Installing .dmg individually doesn't seem to install properly atleast in my case (While installing xcode, I've used different directory instead of typical /Developer)

Saturday, November 19, 2011

BTServer CPU Usage

I recently uninstalled all previous versions of xcode (I had all xcode from ios 3.2.x) to install 4.2 on my MBP. Although I freed around 30 GB, noticed an issue shortly. A process named BTServer is utilizing high CPU usage.



As quick search found that BTserver is a bluetooth service, I don't switch ON bluetooth service and the process seems to steal complete CPU cycles whenever the system is waking up from sleep.

Initially I was not able to correlate this with xcode as neither xcode nor simulator was running.
Closer studies on process hints as it is part of xcode framework. And here is the solution to fix this issue.

Find com.apple.BTServer.plist in your xcode installation path typically /Platforms/iPhoneSimulator.platform/Developer/SDKs /iPhoneSimulator5.0.sdk/System/Library/LaunchDaemons/ and change the value for key Disabled to TRUE from FALSE



It seems to solve the problem for me now. But I have not tested with Apple bluetooth keyboard and mouse.

Sunday, November 6, 2011

mclock - Additional clock application for mac menu bar


Update (2016-01-20): The app is now available on Mac App store.

-----

Additional menu clock for your Mac. A minimalist clock to display time of different timezone of your choice.

The app stays in menu bar all the time and you can customize the display format and timezone.





I was recently working on a calendar based iPad app project. The events are fetched from users salesforce.com data, since users data are in different timezone and requirement is that I should only display events between 8am-8pm.

I set my macmini and device timezone to user timezone to test and develop.  I also liked to have another clock for my localtime. As I don't use writst watch and broken home button on my iPhone is driving me crazy to check my local time.

I did search for free utilities and I didn't find one as I like to use. I hate to bring dashboard everytime and free apps available as floating windows sucks.


Source: https://github.com/palaniraja/mclock

Download: Get it from Mac App Store  |  mclock.app