Exclude application extension (WatchKit) from Xcode script / xcodebuild build

The CI service that we are currently using works with iOS 8.1, which (correct me if I'm wrong) does not support Apple Watch / WatchKit. I did a few searches and poked around Xcode, but to no avail.

I'm looking for a way to exclude the Apple Watch extension from the build — either through Run Build Script in Xcode, or what would be even better — is a way to do this directly through the xcodebuild command.

Does anyone have any clues?

+7
source share
2 answers

Look at [Main Target] > Build Phases > Target Dependencies and [Main Target] > Build Phases > Embed App Extensions and remove the WatchKit information from both.

+7
source

I am using a PHP script to remove the apppace extension file from the project runtime.

 <?php $file = file_get_contents("./PROJECT_Name.xcodeproj/project.pbxproj"); $emKeyPosition = strpos($file, "/* EXTENSION NAME */ = { isa = PBXNativeTarget;"); $bPhPosition = strpos($file, "buildPhases = (", $emKeyPosition); $endPosition = strpos($file, ");", $emKeyPosition); $emString = "Embed Pods Frameworks */,"; $emFramePosition = strpos($file, $emString, $bPhPosition); $filelen = strlen($file); $previousComma = strrpos($file, ",", -($filelen-$emFramePosition)); $finalFmString = substr($file, $previousComma+1, $emFramePosition+strlen($emString)-$previousComma); $file = str_replace($finalFmString, "", $file); file_put_contents("./PROJECT_Name.xcodeproj/project.pbxproj", $file); ?> 

Let me know in case of questions for further discussion.

0
source

Source: https://habr.com/ru/post/985208/


All Articles