我们目前使用的 CI 服务适用于 iOS 8.1(如果我错了,请纠正我)不支持 Apple Watch / WatchKit。我已经在 Xcode 上进行了一些搜索和探索,但无济于事。
我正在寻找一种方法来从构建中排除我的 Apple Watch 扩展 - 通过Run Build Script
在 Xcode 中,或者更好的是直接通过 xcodebuild 命令执行此操作的方法。
有人有任何提示吗?
我们目前使用的 CI 服务适用于 iOS 8.1(如果我错了,请纠正我)不支持 Apple Watch / WatchKit。我已经在 Xcode 上进行了一些搜索和探索,但无济于事。
我正在寻找一种方法来从构建中排除我的 Apple Watch 扩展 - 通过Run Build Script
在 Xcode 中,或者更好的是直接通过 xcodebuild 命令执行此操作的方法。
有人有任何提示吗?
查看您的[Main Target] > Build Phases > Target Dependencies
and[Main Target] > Build Phases > Embed App Extensions
并从两者中删除 WatchKit 信息。
我正在使用 PHP 脚本从项目运行时中删除扩展的 appex 文件。
<?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);
?>
如有问题,请告诉我以供进一步讨论。
如果您正在寻找脚本,您可以使用configure_extensions gem。
句法:configure_extensions <mode> <project> <app_target> <extensions...>
例子:configure_extensions add MyApp.xcodeproj MyApp NotificationsUI