It's possible to build against more than one Xcode version from terminal.
First step is to install Xcode versions alongside each other instead of as an Update. When you download the latest Xcode from Apple, just choose to install to a directory that's parallel to your current Xcode install. In this case we had Xcode 3.2.2 installed in the /Developer directory, so I installed Xcode 3.2.3 in a directory named /Developer323.
One of the tricky things I ran into after the 3.2.3 install was that it defaulted to this for all builds. I found this out when I tried to build existing iPhoneOS 3.1.3 builds and got the error:
=== BUILD NATIVE TARGET Mobile OF PROJECT Mobile WITH CONFIGURATION Release ===Check dependencies
No architectures to compile for (ARCHS=, VALID_ARCHS=i386 ppc ppc64 ppc7400 ppc970 x86_64).
[BEROR]No architectures to compile for (ARCHS=, VALID_ARCHS=i386 ppc ppc64 ppc7400 ppc970 x86_64).
Since we actually wanted to use 3.2.2 as the default I needed to know how to set this from terminal.
Apple gives several options for calling Xcode version from terminal:
http://developer.apple.com/mac/library/documentation/Xcode/Conceptual/XcodeCoexistence/Contents/Resources/en.lproj/Details/Details.html
Since the installs are sitting in parallel it became as easy as adding this line before the xcodebuild section in the build:
export DEVELOPER_DIR="/Developer"
and when we're ready to build iPhoneOS4 against 3.2.3 this line will become:
export DEVELOPER_DIR="/Developer323"
Thursday, July 8, 2010
Android dx.bat causing out of memory errors
The Android SDK contains a file name dx.bat whose purpose is to convert class files to dex files. Embedded in the file is a JAVA_OPTS setting that is commented out by default.
When you build Android you may see an error like this:
-dex: [echo] Converting compiled files and external libraries into D:\Androidproject\bin\classes.dex...
[apply]
[apply] UNEXPECTED TOP-LEVEL ERROR:
[apply] java.lang.OutOfMemoryError: Java heap space....
First determine which SDK you are building against since all may be installed in the Android SDK location by default. In this case I see the failure:
BUILD FAILED
D:\ProgramFiles\Java\android-sdk-windows\platforms\android-1.6...
You need to edit the dx.bat file that sits in the tools directory for the SDK you're using (ex. D:\ProgramFiles\Java\android-sdk-windows\platforms\android-1.6\tools). There's a 'set javaOpts=' setting that has no value by default, and below in the file a commented section with the value set to -Xmx256M. Either remove the comment from the commented one, or add the value to the empty one.
When you build Android you may see an error like this:
-dex: [echo] Converting compiled files and external libraries into D:\Androidproject\bin\classes.dex...
[apply]
[apply] UNEXPECTED TOP-LEVEL ERROR:
[apply] java.lang.OutOfMemoryError: Java heap space....
First determine which SDK you are building against since all may be installed in the Android SDK location by default. In this case I see the failure:
BUILD FAILED
D:\ProgramFiles\Java\android-sdk-windows\platforms\android-1.6...
You need to edit the dx.bat file that sits in the tools directory for the SDK you're using (ex. D:\ProgramFiles\Java\android-sdk-windows\platforms\android-1.6\tools). There's a 'set javaOpts=' setting that has no value by default, and below in the file a commented section with the value set to -Xmx256M. Either remove the comment from the commented one, or add the value to the empty one.
Friday, July 2, 2010
Hudson connectivity issues with security enabled
We ran into issues with Hudson dropping off connections to slaves once security was enabled on the Hudson server.
We took the following steps to reconnect the servers as a Windows service and they have remained connected with no issues so far:
Verify that the node has Hudson Slave installed as a service. If not, or if the validity of the installed one is in question, follow these steps. Otherwise skip to step g:
a. Configure the node as jnlp on the main Hudson server.
b. Login to the slave machine and open a browser
c. Paste the URL from the jnlp configuration into a browser in the node (ex. http://servername/hudson/computer/slavename/slave-agent.jnlp )
d. If the 'Connected' page doesn't come up, you may need to add the URL to the 'Trusted Sites' in IE security configuration
e.The 'Connected' browser window will have a 'File' - 'Install as a Windows Service' option. Choose this.
f. After installed, stop the Hudson Slave service. Change the login to an account with rights to run the slave service
g. Open the hudson-slave.xml in the Hudson home directory on the slave machine, usually someplace like D:\Hudson
h. In the line with the jnlp URL, add the following after the URL: -jnlpCredentials hudsonusername:password (an account they you have configured in your Hudson security setup)
i. In the Hudson UI, change the slave configuration to use Windows service to connect. Enter user with password as the account to connect.
j. Start the Hudson Slave service on the slave and make sure it's set to 'Automatic' for startup
We took the following steps to reconnect the servers as a Windows service and they have remained connected with no issues so far:
Verify that the node has Hudson Slave installed as a service. If not, or if the validity of the installed one is in question, follow these steps. Otherwise skip to step g:
a. Configure the node as jnlp on the main Hudson server.
b. Login to the slave machine and open a browser
c. Paste the URL from the jnlp configuration into a browser in the node (ex. http://servername
d. If the 'Connected' page doesn't come up, you may need to add the URL to the 'Trusted Sites' in IE security configuration
e.The 'Connected' browser window will have a 'File' - 'Install as a Windows Service' option. Choose this.
f. After installed, stop the Hudson Slave service. Change the login to an account with rights to run the slave service
g. Open the hudson-slave.xml in the Hudson home directory on the slave machine, usually someplace like D:\Hudson
h. In the line with the jnlp URL, add the following after the URL: -jnlpCredentials hudsonusername
i. In the Hudson UI, change the slave configuration to use Windows service to connect. Enter user with password as the account to connect.
j. Start the Hudson Slave service on the slave and make sure it's set to 'Automatic' for startup
Subscribe to:
Posts (Atom)