【发布时间】:2016-10-14 03:45:45
【问题描述】:
我有一个 ios 项目,我在其中编写了我的 ios ui 测试用例。
现在我已经创建了另一个 osx(swift) 命令行工具,我想从主文件中运行我的 ios 项目 ui 测试。
为此,我使用以下命令:
xcodebuild test -project /Users/usernamer/Desktop/Xocde/ios-ui-automation-demo-master/ios-ui-automation-demo.xcodeproj -scheme ios-ui-automation-demo -destination 'platform=iOS Simulator,name=iPad Air'
如果我从终端运行此命令,则 ios 项目 ui 测试运行正常。
但是,如果我从我的 osx 命令行工具 swift 文件(在新的 OSX 项目中)运行命令,则会显示错误。代码是
import Foundation
func shell(args: String...) -> Int32 {
let task = NSTask()
task.launchPath = "/usr/bin/xcodebuild"
task.arguments = args
task.currentDirectoryPath = "/Users/username/Desktop/Xocde/ios-ui-automation-demo-master/"
task.launch()
task.waitUntilExit()
return task.terminationStatus
}
print("This is test version edit")
shell("xcodebuild test -project /Users/username/Desktop/Xocde/ios-ui-automation-demo-master/ios-ui-automation-demo.xcodeproj -scheme ios-ui-automation-demo -destination 'platform=iOS Simulator,name=iPad Air'")
此代码显示以下错误:
Build settings from command line:
xcodebuild test -project ios-ui-automation-demo.xcodeproj -scheme ios-ui-automation-demo -destination 'platform = iOS Simulator,name=iPad Air'
=== BUILD TARGET ios-ui-automation-demo OF PROJECT ios-ui-automation-demo WITH THE DEFAULT CONFIGURATION (Release) ===
Check dependencies
Code Sign error: No provisioning profiles found: No non–expired provisioning profiles were found.
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
Program ended with exit code: 9
我已经通过这个Xcode 7.2 no matching provisioning profiles found
但没办法,请帮我看看我的错误是什么。
我正在使用 swift 2.2 xcode 7.3
【问题讨论】:
标签: xcode swift macos osx-elcapitan xcode7.3