xcodebuild: error: 'APP.xcworkspace' does not exist

纵然是瞬间 提交于 2019-12-11 01:24:38

问题


I am trying to set up CI with gitlab. When I try to build locally, I get this error : xcodebuild: error: 'APP.xcworkspace' does not exist. "APP" not being the real name. I am also using CocoaPods.

This happens after I run this command in terminal: gitlab-ci-multi-runner exec shell build_project

I have checked and the file does exist in the same folder I call the command.

This is my .gitlab-ci.yml file:

stages:
  - build

build_project:
  stage: build
  script:
    - xcodebuild clean -workspace APP.xcworkspace -scheme APP | xcpretty
    - xcodebuild test -workspace APP.xcworkspace -scheme APP -destination 'platform=iOS Simulator,name=iPhone 7,OS=10.2' | xcpretty -s
  tags:
    - v0.0.1

Xcode version: 8.2.1

Cocoapods version: 1.2.0

Gitlab-runner version : 1.11.0

Alex


回答1:


To share a scheme in Xcode:

  1. Choose Product > Scheme > Manage Schemes.

  2. Share your scheme:

  3. Click on the Close button.




回答2:


I have solved this now!!

I just had to update the cocoapods repo, se this link: https://github.com/CocoaPods/CocoaPods/issues/5077

Looks like your specs repo was edited at some point, and now git can't update it. I'd recommend deleting and re-creating your Specs repo: pod repo remove master and running pod setup




回答3:


In my case i had project with same folder name("Project") ending with 1 , 2 ,3 ,4 (total 5 folders). when i was trying to install cocoapods in "Project 4" Directory it was getting installed in "Project" instead it should be for "Project 4".

I could find Xcworkspace in the folder "Project"

Hence i need to delete other folders with same name and then install pods in "Project" folder



来源:https://stackoverflow.com/questions/42426358/xcodebuild-error-app-xcworkspace-does-not-exist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!