我用Xcode编写了一个运行脚本,它是我用Swift编写的。在构建设置中,我有一个运行脚本,其外壳设置为/bin/sh,内容是单行./my-script.swift。该文件只包含以下几行:
#!/usr/bin/xcrun swift
import Foundation
如果我为模拟器构建,一切都很好。如果我为设备构建了大量的错误,大致如下:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Framework
我正在编写一个shell脚本,用于构建xcodeproj并将其直接安装到第一个找到并连接的iDevice。这就是脚本
#!/bin/bash
cd ../../cordova/platforms/ios
deviceName=$(ideviceinfo | grep -i DeviceName)
deviceName=${deviceName//DeviceName: /} #This is the device name you set in Settings->General->Info->Name on your iDevice
deviceUdid=$(syste
我正在按照教程将我的静态库包装在一个框架中。问题出现在最后一个阶段--在"Aggregate“目标中运行脚本。我收到一个错误:
libtool: can't locate file for: -lPods-MyLib
脚本如下所示:
set -e
# If we're already inside this script then die
if [ -n "$RW_MULTIPLATFORM_BUILD_IN_PROGRESS" ]; then
exit 0
fi
export RW_MULTIPLATFORM_BUILD_IN_PROGRESS=1
我的目标是尝试像脚本一样运行我的Swift程序。如果整个程序是独立的,您可以像这样运行它:
% xcrun swift hello.swift
hello.swift在哪里
import Cocoa
println("hello")
然而,我想更进一步,包括快速模块,在其中我可以导入其他类、函数等。
因此,假设我们有一个非常好的类,我们想在GoodClass.swift中使用
public class GoodClass {
public init() {}
public func sayHello() {
println("hello&