在Xcode 9上使用EarlGrey进行并行UI测试 - PhaseScriptExecution [CP] \ Embed \ Pods错误

时间:2017-10-06 11:23:21

标签: ios xcode cocoapods xcode-ui-testing xcode9

我正在尝试使用EarlGrey框架(作为单元测试目标运行)在此tutorial之后运行并行UI测试。我设法在运行XCTest UI目标和EarlGrey测试目标时取得了成功,但是在添加另一个earlgrey测试目标或同时运行两个earlgrey测试目标时,我得到以下错误。

我使用的苹果脚本如下:

tell application "iTerm"
    set myterm to create window with default profile
    tell myterm
        activate current session
        launch session "Default Session"
        tell the current session
            write text "cd ~/Desktop/tddSplitter/Splitter"
            write text "xcodebuild clean -workspace Splitter.xcworkspace -scheme EarlGreyWelcomeScreenTests -sdk iphonesimulator11.0 -destination 'platform=iOS Simulator,id=476E9E8C-8248-4EF6-8054-67900D603E83'  test | xcpretty" without newline
            tell (split vertically with same profile)
                write text "cd ~/Desktop/tddSplitter/Splitter"
                write text "xcodebuild clean -workspace Splitter.xcworkspace -scheme EarlGreyMyBillsTests -sdk iphonesimulator11.0 -destination 'platform=iOS Simulator,id=F3DEA448-147B-4DDB-AD83-16D18BA1A87F' test | xcpretty" without newline
            end tell
            tell (split vertically with same profile)
                write text "cd ~/Desktop/tddSplitter/Splitter"
                write text "xcodebuild clean -workspace Splitter.xcworkspace -scheme EarlGreyNewBillTests -sdk iphonesimulator11.0 -destination 'platform=iOS Simulator,id=9129B18A-BC9A-452C-BA38-B968ED73B9EC' test | xcpretty" without newline
            end tell
        end tell
        write (sessions of current tab) text linefeed
    end tell
end tell

我在每个测试目标的每个窗口底部得到的错误是相同的,如下所示:

The following build commands failed:
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/waynerumble/Library/Developer/Xcode/DerivedData/Splitter-dujnwkiaikdyiiczdwxhjrusebvf/Build/Intermediates.noindex/Splitter.build/Debug-iphonesimulator/Splitter.build/Script-84DCB13FCAD79943430C6362.sh

但是上面这些错误可能是其他错误,所以上次运行脚本时我遇到了以下错误:

对于EarlGreyWelcomeScreenTests目标:

Testing failed:
/Users/waynerumble/Library/Developer/Xcode/DerivedData/Splitter-dujnwkiaikdyiiczdwxhjrusebvf/Build/Products/Debug-iphonesimulator/Splitter.app/Frameworks/GTMSessionFetcher.framework: No such file or directory

对于EarlGreyMyBillsTests目标:

Testing failed:
/Users/waynerumble/Library/Developer/Xcode/DerivedData/Splitter-dujnwkiaikdyiiczdwxhjrusebvf/Build/Products/Debug-iphonesimulator/Splitter.app/Frameworks/GTMSessionFetcher.framework: No such file or directory
error: couldn't remove '/Users/waynerumble/Library/Developer/Xcode/DerivedData/Splitter-dujnwkiaikdyiiczdwxhjrusebvf/Build/Products/Debug-iphonesimulator/Splitter.app/Frameworks/GTMSessionFetcher.framework' after command failed: No such file or directory

对于EarlGreyNewBillTests目标:

Testing failed:
Command builtin-rm failed with exit code 513
Command /bin/sh failed with exit code 1

我认为可能有用的唯一其他信息是我的Podfile,如下所示:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Splitter' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
    use_frameworks!
    inhibit_all_warnings!

    def allPods
      pod 'Firebase'
      pod 'Firebase/Database'
      pod 'Firebase/Auth'
      pod 'Firebase/Storage'
      pod 'LifetimeTracker'
      pod 'iCarousel'
    end

    def earlGreyUITests
      project 'Splitter'
      use_frameworks!
      inherit! :search_paths
      pod 'EarlGrey'
    end

    # Pods for Splitter

    allPods

    target 'UnitTests' do
      inherit! :search_paths
      allPods
    end

    target 'EarlGreyWelcomeScreenTests' do
      earlGreyUITests
      allPods
    end

    target 'EarlGreyMyBillsTests' do
      earlGreyUITests
      allPods
    end

    target 'EarlGreyNewBillTests' do
      earlGreyUITests
      allPods
    end

    post_install do |installer|
        installer.pods_project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
                config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = "NO"
                config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
                config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
            end
        end
    end
end

任何帮助或见解都会很棒,因为我已经对此进行了一段时间的争论,而且似乎比任何新的或一致的错误更进一步。感谢

0 个答案:

没有答案