 		handle.writeData(data)
 	}
 
-	var buildScheme = xcodebuildTask(project.arguments + configurationArguments + [ "-scheme", scheme, "build" ])
-	buildScheme.workingDirectoryPath = workingDirectoryURL.path!
-
-	return launchTask(buildScheme, standardOutput: stdoutSink)
+	let buildPlatform = { (platform: Platform?) -> ColdSignal<NSData> in
+		var buildScheme = xcodebuildTask(project.arguments + configurationArguments + [ "-scheme", scheme ])
+		if let platform = platform {
+			buildScheme.arguments += platform.arguments
+		}
+
+		buildScheme.arguments.append("build")
+		buildScheme.workingDirectoryPath = workingDirectoryURL.path!
+
+		return launchTask(buildScheme, standardOutput: stdoutSink)
+	}
+
+	return platformForScheme(scheme, inProject: project)
+		.map { (platform: Platform) -> ColdSignal<NSData> in
+			switch platform {
+			case .iPhoneSimulator: fallthrough
+			case .iPhoneOS:
+				return buildPlatform(.iPhoneSimulator)
+					.concat(buildPlatform(.iPhoneOS))
+
+			case .MacOSX:
+				return buildPlatform(nil)
+			}
+		}
+		.merge(identity)
 		.then(.empty())
 }
 


	/// Whether this platform targets iOS.
	public var iOS: Bool {
		switch (self) {
		case .iPhoneOS:
			return true



	let locatorSignal = locateProjectsInDirectory(directoryURL)
	return locatorSignal.filter { (project: ProjectLocator) in
			switch project {
			case .ProjectFile:
				return true

