Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
254 views
in Technique[技术] by (71.8m points)

swift - How can I specify in the podfile to automatically enable the UITests target

I automatically create a target with tests in xcode, but it is disabled by default, as I can specify via the podfile to automatically enable the target

PODFILE

if IS_UITESTING_ENABLED
      target.build_configurations.each do |config|
if target.name == "iOSAutoTests-UI-Tests"
      config.build_settings['TEST_TARGET_NAME'] = "APP"
end
end
end
end

PODSPEC

s.ios.deployment_target = '10.3'

  s.source_files = 'iOSAutoTests/Classes/**/*'

  s.test_spec "Tests" do |ts|
    ts.source_files = "iOSAutoTests/Tests/**/*.swift"
    ts.test_type = :ui
    ts.requires_app_host = true
  end

enter image description here

I don't need a solution like "Turn it on with your hands in Xcode". I need a solution within podfile or podspec

question from:https://stackoverflow.com/questions/65922385/how-can-i-specify-in-the-podfile-to-automatically-enable-the-uitests-target

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...