Post: How to use CocoaPods with Xcode CI Bots #21

Open
kylef opened this Issue Nov 4, 2013 · 131 comments

Comments

Projects
None yet
@kylef
Contributor

kylef commented Nov 4, 2013

No description provided.

@kylef

This comment has been minimized.

Show comment
Hide comment
@mtitolo

This comment has been minimized.

Show comment
Hide comment
@Dimillian

This comment has been minimized.

Show comment
Hide comment
@Dimillian

Dimillian Nov 5, 2013

So now we have at least 2 technique that works (and I have 1 complicated one). What is the best way to do this ? Should we write a blog post with all these techniques or prepare the gem we have discussed on the community chat?

So now we have at least 2 technique that works (and I have 1 complicated one). What is the best way to do this ? Should we write a blog post with all these techniques or prepare the gem we have discussed on the community chat?

@alloy

This comment has been minimized.

Show comment
Hide comment
@alloy

alloy Nov 5, 2013

Member

@kylef That tweet is unavailable :/

Member

alloy commented Nov 5, 2013

@kylef That tweet is unavailable :/

@mtitolo

This comment has been minimized.

Show comment
Hide comment
@mtitolo

mtitolo Nov 7, 2013

Member

Looks like tweets were removed, but here's a screenshot from Tweetbot.
http://cl.ly/image/1y091n2l3n10

Member

mtitolo commented Nov 7, 2013

Looks like tweets were removed, but here's a screenshot from Tweetbot.
http://cl.ly/image/1y091n2l3n10

@amccarri

This comment has been minimized.

Show comment
Hide comment
@amccarri

amccarri Nov 7, 2013

I just finished setting up builds using Xcode bots this morning for our app which uses cocoa pods, however I will say that we are going to stick with Jenkins. So far my impression of bots is that they are meant for people who have never done CI before. They are EXTREMELY limited in capability (can’t monitor a build as it’s happening, build env can’t pass parameters to the build such as build numbers, can’t run scripts pre/post build etc, can’t administer a list of people allowed to download your test app, Xcode build list not auto-refreshed when new build is run, etc).

Looks like the only thing you can do is what you can add to your build scheme, and the only feature benefit is Xcode integration (which sucks so far, was not even able to create a bot in Xcode, had to use web page) so you can link from automated test runs to source code. Neither of these warrant moving from Jenkinsish/Testflight solutions.

All that is why we are NOT converting to bots, but if you want to use cocoa pods with bots here’s what I had to do:

1 - .go through the voodoo of setting up os x server and Xcode automation
- create home folder /var/teamsserver for _teamsserver user if it doesn’t already exist
- make sure to set proper ownerships on /var/teamsserver to _teamsserver account

2 - add .ssh with keys that can access your local pod repo to /var/teamsserver

3 - Set up new schemes specifically for Xcode bots
- edit scheme / build / pre-action add a bash script (or other script, your choice) that does something like
if ~/.cocoapods/repos/localrepo does not exist, pod repo add your local repo
if Pods folder does not exist pod install, else pod update
- share and check in the scheme

4 - Go http://yourserver/xcode and create the bot.
- create bots via xcode server web page… Xcode never let’s you get past authentication settings even when it shows them correct
(this may be because we don’t allow HTTP urls on our github server, only ssh, so our url looks like git@ourserver.com:Team/App)

Fairly short list of steps, but OS X server docs were no help at all.

I’m really hoping this is just the starting point for bots, and that they will get a lot better in the future. Currently, even though jenkins is a much more complex CI server, I found myself pulling my hair out less setting up Jenkins than I did Xcode bots. Jenkins also supports something called a config matrix so you can run multiple build configs on a single checkout.

On Nov 7, 2013, at 5:05 PM, Michele notifications@github.com wrote:

Looks like tweets were removed, but here's a screenshot from Tweetbot.
http://cl.ly/image/1y091n2l3n10


Reply to this email directly or view it on GitHub.

amccarri commented Nov 7, 2013

I just finished setting up builds using Xcode bots this morning for our app which uses cocoa pods, however I will say that we are going to stick with Jenkins. So far my impression of bots is that they are meant for people who have never done CI before. They are EXTREMELY limited in capability (can’t monitor a build as it’s happening, build env can’t pass parameters to the build such as build numbers, can’t run scripts pre/post build etc, can’t administer a list of people allowed to download your test app, Xcode build list not auto-refreshed when new build is run, etc).

Looks like the only thing you can do is what you can add to your build scheme, and the only feature benefit is Xcode integration (which sucks so far, was not even able to create a bot in Xcode, had to use web page) so you can link from automated test runs to source code. Neither of these warrant moving from Jenkinsish/Testflight solutions.

All that is why we are NOT converting to bots, but if you want to use cocoa pods with bots here’s what I had to do:

1 - .go through the voodoo of setting up os x server and Xcode automation
- create home folder /var/teamsserver for _teamsserver user if it doesn’t already exist
- make sure to set proper ownerships on /var/teamsserver to _teamsserver account

2 - add .ssh with keys that can access your local pod repo to /var/teamsserver

3 - Set up new schemes specifically for Xcode bots
- edit scheme / build / pre-action add a bash script (or other script, your choice) that does something like
if ~/.cocoapods/repos/localrepo does not exist, pod repo add your local repo
if Pods folder does not exist pod install, else pod update
- share and check in the scheme

4 - Go http://yourserver/xcode and create the bot.
- create bots via xcode server web page… Xcode never let’s you get past authentication settings even when it shows them correct
(this may be because we don’t allow HTTP urls on our github server, only ssh, so our url looks like git@ourserver.com:Team/App)

Fairly short list of steps, but OS X server docs were no help at all.

I’m really hoping this is just the starting point for bots, and that they will get a lot better in the future. Currently, even though jenkins is a much more complex CI server, I found myself pulling my hair out less setting up Jenkins than I did Xcode bots. Jenkins also supports something called a config matrix so you can run multiple build configs on a single checkout.

On Nov 7, 2013, at 5:05 PM, Michele notifications@github.com wrote:

Looks like tweets were removed, but here's a screenshot from Tweetbot.
http://cl.ly/image/1y091n2l3n10


Reply to this email directly or view it on GitHub.

@qnoid

This comment has been minimized.

Show comment
Hide comment
@qnoid

qnoid Nov 10, 2013

Thanks @amccarri for the detailed report! Much appreciated.
What about server's ability to run your tests on multiple devices? Isn't that enough to justify it over Jenkins?

qnoid commented Nov 10, 2013

Thanks @amccarri for the detailed report! Much appreciated.
What about server's ability to run your tests on multiple devices? Isn't that enough to justify it over Jenkins?

@blakewatters

This comment has been minimized.

Show comment
Hide comment
@blakewatters

blakewatters Nov 11, 2013

I also took the Xcode bots for a test spin. I went a slightly different direction than @amccarri in my setup:

Rather than creating a home directory at /var/teamsserver, I overrode the CP_HOME_DIR and CP_REPOS_DIR environment variables to point to a location inside the build path based off of PROJECT_ROOT (there are a bunch of environment variables configured by the build so there are options about where to put things).

If your project contains private pods (I have a private pod repository), then you wind up needing to do double configuration of your SSH access. This is because the Xcode bots walk you through setting up an RSA key to clone your code, but that configuration is never exposed to the build once it begins. So you have to configure secured Git access separately from secured Pod access. This also applies for public Pods if you pull from Github via SSH instead of via HTTPS.

Another irritating wrinkle is that you need to use a globally accessible Ruby installation for CocoaPods. If you are working off of the system Ruby and have done sudo installations of CocoaPods then it will work. But it’s pretty common (and often advisable) to see RVM or rbenv used to install parallel copies of Ruby. If you have these installed into your home directory and expect to use the same bits, then you are SOL. I went with an rbenv installation of Ruby into /usr/local/var/rbenv

I also have Bundler managing some additional dependencies necessary for my build, so I wound up having to install the bundler dependencies into a path under the build directory.

All of this required setting up pre build scripts on a Shared scheme, then pushing it remotely and testing, which was extremely slow and painful to work through.

The build output also did not update until the build had failed, so there’s a lot of dead time waiting. Then once it was all set up, the feedback mechanisms were limited and it felt very much like a bunch of trouble for very little payoff when compared to Travis CI Pro or Jenkins.

As to the ability to run tests on multiple devices:

I am not convinced that there's actually any benefit in this over running your test suite across multiple versions of the Simulator. I've done tons of automated testing and CI on iOS over the last couple of years and the types of issues that we uncover on manual on-device testing are problems that are related to concurrency, unexpected user behaviors, and performance. The concurrency and user behavior problems won't become visible just because you run your suite on a device instead of the simulator and performance issues are typically perceputal -- a view "feels sluggish" or laggy. These kinds of conditions aren't testable in an automated way. There is also a major performance penalty to running your tests on real hardware. They are going to run much slower as you have slower processors, less memory, and less I/O throughput. The slower they are to execute, the lower your iteration throughput and the less you can lean on CI. So what's the benefit over the simulator?

After giving CI bots a thorough tire-kicking, I ultimately went back to Jenkins and haven't looked back. My Jenkins setup is simpler and much more powerful/flexible. Hope this saves someone some wasted hours.

I also took the Xcode bots for a test spin. I went a slightly different direction than @amccarri in my setup:

Rather than creating a home directory at /var/teamsserver, I overrode the CP_HOME_DIR and CP_REPOS_DIR environment variables to point to a location inside the build path based off of PROJECT_ROOT (there are a bunch of environment variables configured by the build so there are options about where to put things).

If your project contains private pods (I have a private pod repository), then you wind up needing to do double configuration of your SSH access. This is because the Xcode bots walk you through setting up an RSA key to clone your code, but that configuration is never exposed to the build once it begins. So you have to configure secured Git access separately from secured Pod access. This also applies for public Pods if you pull from Github via SSH instead of via HTTPS.

Another irritating wrinkle is that you need to use a globally accessible Ruby installation for CocoaPods. If you are working off of the system Ruby and have done sudo installations of CocoaPods then it will work. But it’s pretty common (and often advisable) to see RVM or rbenv used to install parallel copies of Ruby. If you have these installed into your home directory and expect to use the same bits, then you are SOL. I went with an rbenv installation of Ruby into /usr/local/var/rbenv

I also have Bundler managing some additional dependencies necessary for my build, so I wound up having to install the bundler dependencies into a path under the build directory.

All of this required setting up pre build scripts on a Shared scheme, then pushing it remotely and testing, which was extremely slow and painful to work through.

The build output also did not update until the build had failed, so there’s a lot of dead time waiting. Then once it was all set up, the feedback mechanisms were limited and it felt very much like a bunch of trouble for very little payoff when compared to Travis CI Pro or Jenkins.

As to the ability to run tests on multiple devices:

I am not convinced that there's actually any benefit in this over running your test suite across multiple versions of the Simulator. I've done tons of automated testing and CI on iOS over the last couple of years and the types of issues that we uncover on manual on-device testing are problems that are related to concurrency, unexpected user behaviors, and performance. The concurrency and user behavior problems won't become visible just because you run your suite on a device instead of the simulator and performance issues are typically perceputal -- a view "feels sluggish" or laggy. These kinds of conditions aren't testable in an automated way. There is also a major performance penalty to running your tests on real hardware. They are going to run much slower as you have slower processors, less memory, and less I/O throughput. The slower they are to execute, the lower your iteration throughput and the less you can lean on CI. So what's the benefit over the simulator?

After giving CI bots a thorough tire-kicking, I ultimately went back to Jenkins and haven't looked back. My Jenkins setup is simpler and much more powerful/flexible. Hope this saves someone some wasted hours.

@amccarri

This comment has been minimized.

Show comment
Hide comment
@amccarri

amccarri Nov 11, 2013

Not unique to bots, you can do this with jenkins or any other CI tool that can run a command line build. From the xcodebuild man page:

xcodebuild -workspace MyWorkspace.xcworkspace -scheme MyScheme -destination 'platform=iOS Simulator,name=iPhone' -destination
'platform=iOS,name=My iPad' test

I created a blog post out of my original email that includes a sample script for my bots config, can find it here:

http://alexlikescode.blogspot.com

On Nov 10, 2013, at 4:14 AM, Markos Charatzas notifications@github.com wrote:

Thanks @amccarri for the detailed report! Much appreciated.
What about server's ability to run your tests on multiple devices? Isn't that enough to justify it over Jenkins?


Reply to this email directly or view it on GitHub.

Not unique to bots, you can do this with jenkins or any other CI tool that can run a command line build. From the xcodebuild man page:

xcodebuild -workspace MyWorkspace.xcworkspace -scheme MyScheme -destination 'platform=iOS Simulator,name=iPhone' -destination
'platform=iOS,name=My iPad' test

I created a blog post out of my original email that includes a sample script for my bots config, can find it here:

http://alexlikescode.blogspot.com

On Nov 10, 2013, at 4:14 AM, Markos Charatzas notifications@github.com wrote:

Thanks @amccarri for the detailed report! Much appreciated.
What about server's ability to run your tests on multiple devices? Isn't that enough to justify it over Jenkins?


Reply to this email directly or view it on GitHub.

@mtitolo

This comment has been minimized.

Show comment
Hide comment
@mtitolo

mtitolo Nov 11, 2013

Member

@blakewatters thanks for the info! What kind of advantage do you see with the environment variables instead of the folder in /var/teamsserver? Do you think this approach would be more robust and possibly future-proof for updates?

@amccarri We already have instructions for other CI systems. This post will be specifically on Bots because so many people have asked about them. This isn't saying we recommend using Bots, but we should provide instructions on how to use cocoapods with them since Apple will likely push people to use them.

Member

mtitolo commented Nov 11, 2013

@blakewatters thanks for the info! What kind of advantage do you see with the environment variables instead of the folder in /var/teamsserver? Do you think this approach would be more robust and possibly future-proof for updates?

@amccarri We already have instructions for other CI systems. This post will be specifically on Bots because so many people have asked about them. This isn't saying we recommend using Bots, but we should provide instructions on how to use cocoapods with them since Apple will likely push people to use them.

@amccarri

This comment has been minimized.

Show comment
Hide comment
@amccarri

amccarri Nov 11, 2013

@mtitolo sorry should have directed my comment, @qnoid was asking about bots' ability to run tests on multiple devices as an advantage over other solutions. I was just pointing out that running tests on multiple devices is not necessarily a feature of bots, but rather a feature of xcodebuild which can be used anywhere.

@mtitolo sorry should have directed my comment, @qnoid was asking about bots' ability to run tests on multiple devices as an advantage over other solutions. I was just pointing out that running tests on multiple devices is not necessarily a feature of bots, but rather a feature of xcodebuild which can be used anywhere.

@amccarri

This comment has been minimized.

Show comment
Hide comment
@amccarri

amccarri Nov 11, 2013

Oh btw, here's my build pre-action script for using cocoa pods with bots:

cd $SRCROOT

if [ ! -e "$HOME/.cocoapods/repos/OurRepo" ]
then
    pod repo add OurRepo git@ourgithub:OurApps/CocoaPodSpecs.git
fi

if [ -e "Pods" ]
then
    pod update
else
    pod install
fi

Oh btw, here's my build pre-action script for using cocoa pods with bots:

cd $SRCROOT

if [ ! -e "$HOME/.cocoapods/repos/OurRepo" ]
then
    pod repo add OurRepo git@ourgithub:OurApps/CocoaPodSpecs.git
fi

if [ -e "Pods" ]
then
    pod update
else
    pod install
fi
@orta

This comment has been minimized.

Show comment
Hide comment
@orta

orta Dec 3, 2013

Member

So is this nixed for the minute?

Member

orta commented Dec 3, 2013

So is this nixed for the minute?

@mtitolo

This comment has been minimized.

Show comment
Hide comment
@mtitolo

mtitolo Dec 3, 2013

Member

It still needs to happen. I haven't had the time to actually write the post and double check all of the solutions.

Member

mtitolo commented Dec 3, 2013

It still needs to happen. I haven't had the time to actually write the post and double check all of the solutions.

@mtitolo mtitolo referenced this issue in CocoaPods/CocoaPods Dec 6, 2013

Closed

Cocoa Pods + Xcode Continuous Integration #1492

@swizzlr

This comment has been minimized.

Show comment
Hide comment

swizzlr commented Feb 25, 2014

BUMP.

@mtitolo

This comment has been minimized.

Show comment
Hide comment
@mtitolo

mtitolo Feb 25, 2014

Member

@swizzlr if you want to be useful, you could try one of the solutions listed above.

Member

mtitolo commented Feb 25, 2014

@swizzlr if you want to be useful, you could try one of the solutions listed above.

@swizzlr

This comment has been minimized.

Show comment
Hide comment
@swizzlr

swizzlr Feb 25, 2014

Thanks, I will!

swizzlr commented Feb 25, 2014

Thanks, I will!

@xanderdunn

This comment has been minimized.

Show comment
Hide comment
@xanderdunn

xanderdunn Feb 27, 2014

Thanks @amccarri, your experience really helped me.

Mac OS X 10.9.2, Xcode 5.1b5, CocoaPods 0.29.0

I created /var/teamsserver and set it's owner to _teamsserver.

I created a scheme pre-action script:

export PATH=/usr/local/opt/ruby/bin:/usr/local/bin:$PATH
brew update
brew upgrade
gem update --system
gem update cocoa pods
cd ${SRCROOT}
if [ -e "Pods" ]
then
pod update
else
pod install
fi

It's working flawlessly. As a two-step set-up procedure, I'd say this is really not a problem.

Thanks @amccarri, your experience really helped me.

Mac OS X 10.9.2, Xcode 5.1b5, CocoaPods 0.29.0

I created /var/teamsserver and set it's owner to _teamsserver.

I created a scheme pre-action script:

export PATH=/usr/local/opt/ruby/bin:/usr/local/bin:$PATH
brew update
brew upgrade
gem update --system
gem update cocoa pods
cd ${SRCROOT}
if [ -e "Pods" ]
then
pod update
else
pod install
fi

It's working flawlessly. As a two-step set-up procedure, I'd say this is really not a problem.

@swizzlr

This comment has been minimized.

Show comment
Hide comment
@swizzlr

swizzlr Mar 2, 2014

Alex, thank you for summarizing that. I'll see if I can try wrapping it into a cp plugin.

swizzlr commented Mar 2, 2014

Alex, thank you for summarizing that. I'll see if I can try wrapping it into a cp plugin.

@mtitolo

This comment has been minimized.

Show comment
Hide comment
@mtitolo

mtitolo Mar 3, 2014

Member

Starting to work on the blog post for this. Comments welcome - https://github.com/CocoaPods/blog.cocoapods.org/blob/master/_drafts/CocoaPods-Bots.markdown

This won't use any of the plugins (which may or may not work with Server anyway).

Member

mtitolo commented Mar 3, 2014

Starting to work on the blog post for this. Comments welcome - https://github.com/CocoaPods/blog.cocoapods.org/blob/master/_drafts/CocoaPods-Bots.markdown

This won't use any of the plugins (which may or may not work with Server anyway).

@egueiros

This comment has been minimized.

Show comment
Hide comment
@egueiros

egueiros Mar 8, 2014

That's great work everyone. I have all my builds compiling and my tests passing. I have, however, one error in my 'Analyze' phase.
=== ANALYZE TARGET CI_TestProject OF PROJECT CI_TestProject WITH CONFIGURATION Debug ===
ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Everything else is great. Pre-script is run, pods are installed and linked. But Analyze seems to be the very first thing that runs, and I get that error. Any pointers? Thanks in advance!

egueiros commented Mar 8, 2014

That's great work everyone. I have all my builds compiling and my tests passing. I have, however, one error in my 'Analyze' phase.
=== ANALYZE TARGET CI_TestProject OF PROJECT CI_TestProject WITH CONFIGURATION Debug ===
ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Everything else is great. Pre-script is run, pods are installed and linked. But Analyze seems to be the very first thing that runs, and I get that error. Any pointers? Thanks in advance!

@moayes

This comment has been minimized.

Show comment
Hide comment
@moayes

moayes Mar 8, 2014

@egueiros not sure if this applies to your case. Check Build Active Architecture Only. In my case Pods project had Build Active Architecture Only set to YES for Debug builds, but in the main project it was set to NO. Changing Pods project flag to NO fixed the problem.

moayes commented Mar 8, 2014

@egueiros not sure if this applies to your case. Check Build Active Architecture Only. In my case Pods project had Build Active Architecture Only set to YES for Debug builds, but in the main project it was set to NO. Changing Pods project flag to NO fixed the problem.

@mtitolo

This comment has been minimized.

Show comment
Hide comment
@mtitolo

mtitolo Mar 14, 2014

Member

And another blog post for reference: http://chris.cm/setting-up-xcode-bots-with-cocoapods/

Member

mtitolo commented Mar 14, 2014

And another blog post for reference: http://chris.cm/setting-up-xcode-bots-with-cocoapods/

@m1entus

This comment has been minimized.

Show comment
Hide comment
@m1entus

m1entus Mar 17, 2014

@egueiros I have the same issue, ld: library not found for -lPods

m1entus commented Mar 17, 2014

@egueiros I have the same issue, ld: library not found for -lPods

@alloy

This comment has been minimized.

Show comment
Hide comment
@alloy

alloy Mar 17, 2014

Member

@moayes You should normally change it on your project to YES, not set it to NO on the Pods project.

Member

alloy commented Mar 17, 2014

@moayes You should normally change it on your project to YES, not set it to NO on the Pods project.

@alloy alloy closed this Mar 17, 2014

@alloy alloy reopened this Mar 17, 2014

@m1entus

This comment has been minimized.

Show comment
Hide comment
@m1entus

m1entus Mar 17, 2014

I hacked something but right now i'm getting error when building some of static lib, locally everything is working fine :/:

   The following build commands failed:
CompileC /Library/Server/Xcode/Data/BotRuns/Cache/2ab22af0-2cb0-4b18-ac23-4e5edb40d808/DerivedData/Build/Intermediates/Pods.build/Debug-iphonesimulator/Pods-SDWebImage.build/Objects-normal/i386/NSData+ImageContentType.o SDWebImage/SDWebImage/NSData+ImageContentType.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Additionaly if i uncheck find implicit dependencies on shared target i'm getting

ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Update #1:
Everything working on Debug (XCode), but when i changed target to release, it says that: ld: library not found for -lPods

m1entus commented Mar 17, 2014

I hacked something but right now i'm getting error when building some of static lib, locally everything is working fine :/:

   The following build commands failed:
CompileC /Library/Server/Xcode/Data/BotRuns/Cache/2ab22af0-2cb0-4b18-ac23-4e5edb40d808/DerivedData/Build/Intermediates/Pods.build/Debug-iphonesimulator/Pods-SDWebImage.build/Objects-normal/i386/NSData+ImageContentType.o SDWebImage/SDWebImage/NSData+ImageContentType.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Additionaly if i uncheck find implicit dependencies on shared target i'm getting

ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Update #1:
Everything working on Debug (XCode), but when i changed target to release, it says that: ld: library not found for -lPods

@MatejBalantic

This comment has been minimized.

Show comment
Hide comment
@MatejBalantic

MatejBalantic Mar 18, 2014

@egueiros & @m1entus: I have the same problem:
ld: library not found for -lPods

Did you find any solution?

@egueiros & @m1entus: I have the same problem:
ld: library not found for -lPods

Did you find any solution?

@m1entus

This comment has been minimized.

Show comment
Hide comment

m1entus commented Mar 18, 2014

Nope :/

@m1entus

This comment has been minimized.

Show comment
Hide comment
@m1entus

m1entus Mar 20, 2014

@MatejBalantic Ok solved, problem was that i was using pre-build script which was propably called for every tharget in cocoapods, i debug it in Jenkins (lol) :) I solved it by adding additional static library target, my solution here: https://gist.github.com/m1entus/9660734

m1entus commented Mar 20, 2014

@MatejBalantic Ok solved, problem was that i was using pre-build script which was propably called for every tharget in cocoapods, i debug it in Jenkins (lol) :) I solved it by adding additional static library target, my solution here: https://gist.github.com/m1entus/9660734

@obernal

This comment has been minimized.

Show comment
Hide comment
@obernal

obernal Mar 31, 2014

@m1entus sorry but your solution is unclear to me. I just recently started getting the same issue as @egueiros and @MatejBalantic. Could you maybe describe the steps in more detail? Thanks!

obernal commented Mar 31, 2014

@m1entus sorry but your solution is unclear to me. I just recently started getting the same issue as @egueiros and @MatejBalantic. Could you maybe describe the steps in more detail? Thanks!

@m1entus

This comment has been minimized.

Show comment
Hide comment
@thiagoperes

This comment has been minimized.

Show comment
Hide comment
@thiagoperes

thiagoperes Sep 4, 2014

Does XCode 6 solves this problem?

Does XCode 6 solves this problem?

@mtitolo

This comment has been minimized.

Show comment
Hide comment
@mtitolo

mtitolo Sep 4, 2014

Member

@thiagoperes no one has given a 👍 or 👎 to them yet.

Member

mtitolo commented Sep 4, 2014

@thiagoperes no one has given a 👍 or 👎 to them yet.

@swizzlr

This comment has been minimized.

Show comment
Hide comment
@swizzlr

swizzlr Sep 5, 2014

Somewhat yes, haven't done it yet. I'm all in with Jenkins now because I hate myself, and I check in my pods to improve build times.

swizzlr commented Sep 5, 2014

Somewhat yes, haven't done it yet. I'm all in with Jenkins now because I hate myself, and I check in my pods to improve build times.

@Pintouch

This comment has been minimized.

Show comment
Hide comment
@Pintouch

Pintouch Sep 11, 2014

I tried with xCode6 pre-release and OS X Server 4.0, I still have the problem...
I tried all workarounds existing for previous version but those don't work anymore, so I'm working on it cause I don't want to be constraint to have my pods folder and my workspace under Version Control.
I let you know if I find a workaround.

EDIT

My BAD!! It's very easy on xCode 6, just adding this in the prescript of the bot (I'm using rvm) :

export PATH=/Users/username/.rvm/rubies/default/bin:$PATH
cd ./App_Folder

if [ -e "Pods" ]
then
pod update
else
pod install
fi

cd ..

Working like a charm.

I tried with xCode6 pre-release and OS X Server 4.0, I still have the problem...
I tried all workarounds existing for previous version but those don't work anymore, so I'm working on it cause I don't want to be constraint to have my pods folder and my workspace under Version Control.
I let you know if I find a workaround.

EDIT

My BAD!! It's very easy on xCode 6, just adding this in the prescript of the bot (I'm using rvm) :

export PATH=/Users/username/.rvm/rubies/default/bin:$PATH
cd ./App_Folder

if [ -e "Pods" ]
then
pod update
else
pod install
fi

cd ..

Working like a charm.

@orta

This comment has been minimized.

Show comment
Hide comment
@orta

orta Sep 11, 2014

Member

Yeah, I also expect it to be trivial in Xcode 6, been having issues with submodules on setting it up for one of my projects but don't think it should be too much effort. Would be nice to have a gem for CocoaPods caching though.

Member

orta commented Sep 11, 2014

Yeah, I also expect it to be trivial in Xcode 6, been having issues with submodules on setting it up for one of my projects but don't think it should be too much effort. Would be nice to have a gem for CocoaPods caching though.

@clooth

This comment has been minimized.

Show comment
Hide comment
@clooth

clooth Oct 3, 2014

Any updates on this?

clooth commented Oct 3, 2014

Any updates on this?

@peterjenkins

This comment has been minimized.

Show comment
Hide comment
@peterjenkins

peterjenkins Aug 19, 2015

Apologies if this is not the right place to ask, but is it possible to use Xcode bots when you don't check in your generated xcworkspace?

Normally our steps are to clone the repo, run pod install, open the generated xcworkspace file, then finally try to run the app.

Apologies if this is not the right place to ask, but is it possible to use Xcode bots when you don't check in your generated xcworkspace?

Normally our steps are to clone the repo, run pod install, open the generated xcworkspace file, then finally try to run the app.

@czechboy0

This comment has been minimized.

Show comment
Hide comment
@czechboy0

czechboy0 Aug 19, 2015

@pjenkins-cc I don't think so, because a valid shared xcscheme needs to be checked in for Xcode Server (or any CI for that matter) to know how to build the code. And those schemes can also be stored in the workspace (or the project).

I think the issue would be that Xcode Server would try to build the project (not the workspace) and not build the needed pods, thus fail. But I haven't actually tried it.

If I were you, I'd check in the workspace file, it's a tiny folder with one file pointing to the included project files, that's pretty much it (and that's what I do for all my projects).

@pjenkins-cc I don't think so, because a valid shared xcscheme needs to be checked in for Xcode Server (or any CI for that matter) to know how to build the code. And those schemes can also be stored in the workspace (or the project).

I think the issue would be that Xcode Server would try to build the project (not the workspace) and not build the needed pods, thus fail. But I haven't actually tried it.

If I were you, I'd check in the workspace file, it's a tiny folder with one file pointing to the included project files, that's pretty much it (and that's what I do for all my projects).

@peterjenkins

This comment has been minimized.

Show comment
Hide comment
@peterjenkins

peterjenkins Aug 20, 2015

@czechboy0 Thanks for the response! We're currently using jenkins, but if we do decide to make the switch to bots, I will try just checking in the xcworkspace file.

@czechboy0 Thanks for the response! We're currently using jenkins, but if we do decide to make the switch to bots, I will try just checking in the xcworkspace file.

@startupthekid

This comment has been minimized.

Show comment
Hide comment
@startupthekid

startupthekid Oct 1, 2015

@czechboy0 I followed your guide pretty closely and while it was awesome, I can't get the integration to build when my project depends on a private cocoapod.

I've done everything: created new ssh keys for _xcsbuildd and add them to github, verified _xcsbuildd can access github via ssh -T git@github.com, and all that jazz.

I have a pre-install script that looks like:

export LANG=en_US.UTF-8
export PATH="/usr/local/bin:$PATH"
cd "$XCS_SOURCE_DIR/myproject"

if [ -e "Pods" ]
then
pod update
else
pod install
fi

No matter what I do, I consistently get the output:

Update all pods
Updating local specs repositories
Cloning spec repo `myproject` from `https://github.com/myproject/CocoapodsPrivateSpecs.git`
[!] Unable to add a source with url `https://github.com/myproject/CocoapodsPrivateSpecs.git` named `myproject`.
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.

Can anyone help me out?

@czechboy0 I followed your guide pretty closely and while it was awesome, I can't get the integration to build when my project depends on a private cocoapod.

I've done everything: created new ssh keys for _xcsbuildd and add them to github, verified _xcsbuildd can access github via ssh -T git@github.com, and all that jazz.

I have a pre-install script that looks like:

export LANG=en_US.UTF-8
export PATH="/usr/local/bin:$PATH"
cd "$XCS_SOURCE_DIR/myproject"

if [ -e "Pods" ]
then
pod update
else
pod install
fi

No matter what I do, I consistently get the output:

Update all pods
Updating local specs repositories
Cloning spec repo `myproject` from `https://github.com/myproject/CocoapodsPrivateSpecs.git`
[!] Unable to add a source with url `https://github.com/myproject/CocoapodsPrivateSpecs.git` named `myproject`.
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.

Can anyone help me out?

@peterjenkins

This comment has been minimized.

Show comment
Hide comment
@peterjenkins

peterjenkins Oct 1, 2015

@startupthekid Try referencing the specs repo using ssh instead of https.
(e.g. git@github.com:myproject/CocoapodsPrivateSpecs.git)

@startupthekid Try referencing the specs repo using ssh instead of https.
(e.g. git@github.com:myproject/CocoapodsPrivateSpecs.git)

@czechboy0

This comment has been minimized.

Show comment
Hide comment
@czechboy0

czechboy0 Oct 1, 2015

Good point! 👍
On Thu, Oct 1, 2015 at 3:59 PM pjenkins-cc notifications@github.com wrote:

@startupthekid https://github.com/startupthekid Try referencing the
specs repo using git instead of https.
(e.g. git@github.com:myproject/CocoapodsPrivateSpecs.git)


Reply to this email directly or view it on GitHub
#21 (comment)
.

Good point! 👍
On Thu, Oct 1, 2015 at 3:59 PM pjenkins-cc notifications@github.com wrote:

@startupthekid https://github.com/startupthekid Try referencing the
specs repo using git instead of https.
(e.g. git@github.com:myproject/CocoapodsPrivateSpecs.git)


Reply to this email directly or view it on GitHub
#21 (comment)
.

@startupthekid

This comment has been minimized.

Show comment
Hide comment
@startupthekid

startupthekid Oct 1, 2015

For ssh, would it not be ssh://git@github.com:myproject/CocoapodsPrivateSpecs.git?

Also in my script I ran pod install --verbose and got this:

Update all pods
  Preparing

Cloning spec repo `myproject` from `https://github.com/myproject/CocoapodsPrivateSpecs.git`
  $ /usr/local/bin/git clone https://github.com/busycm/CocoapodsPrivateSpecs.git myproject
[!] Unable to add a source with url `https://github.com/myproject/CocoapodsPrivateSpecs.git` named `myproject`.
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/sources_manager.rb:48:in `rescue in find_or_create_source_with_url'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/sources_manager.rb:53:in `find_or_create_source_with_url'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer/analyzer.rb:623:in `block in sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer/analyzer.rb:622:in `map'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer/analyzer.rb:622:in `sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer.rb:129:in `resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer.rb:105:in `install!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/command/project.rb:71:in `run_install_with_update'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/command/project.rb:156:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-0.9.1/lib/claide/command.rb:312:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/command.rb:48:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/bin/pod:44:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
  Cloning into 'myproject'...
  fatal: could not read Username for 'https://github.com': Device not configured

It might also be worth nothing that 1) I'm a contributor on this particular project, myproject is actually an organization and 2) None of the pods in my main Xcode project are private but rather I have a pod A that I made that relies on another pod B that I made and pod B is the only one sitting in a private spec repo.

For ssh, would it not be ssh://git@github.com:myproject/CocoapodsPrivateSpecs.git?

Also in my script I ran pod install --verbose and got this:

Update all pods
  Preparing

Cloning spec repo `myproject` from `https://github.com/myproject/CocoapodsPrivateSpecs.git`
  $ /usr/local/bin/git clone https://github.com/busycm/CocoapodsPrivateSpecs.git myproject
[!] Unable to add a source with url `https://github.com/myproject/CocoapodsPrivateSpecs.git` named `myproject`.
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/sources_manager.rb:48:in `rescue in find_or_create_source_with_url'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/sources_manager.rb:53:in `find_or_create_source_with_url'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer/analyzer.rb:623:in `block in sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer/analyzer.rb:622:in `map'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer/analyzer.rb:622:in `sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer.rb:129:in `resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer.rb:105:in `install!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/command/project.rb:71:in `run_install_with_update'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/command/project.rb:156:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-0.9.1/lib/claide/command.rb:312:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/command.rb:48:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/bin/pod:44:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
  Cloning into 'myproject'...
  fatal: could not read Username for 'https://github.com': Device not configured

It might also be worth nothing that 1) I'm a contributor on this particular project, myproject is actually an organization and 2) None of the pods in my main Xcode project are private but rather I have a pod A that I made that relies on another pod B that I made and pod B is the only one sitting in a private spec repo.

@czechboy0

This comment has been minimized.

Show comment
Hide comment
@czechboy0

czechboy0 Oct 1, 2015

I think the URL is just git@github.com:myproject/CocoapodsPrivateSpecs.git.
Without the ssh. Try that maybe? (Also in the log it still seems to be
adding the https URL)
On Thu, Oct 1, 2015 at 7:07 PM Brendan Conron notifications@github.com
wrote:

For ssh, would it not be ssh://git@github.com:
myproject/CocoapodsPrivateSpecs.git?

Also in my script I ran pod install --verbose and got this:

Update all pods
Preparing

Cloning spec repo myproject from https://github.com/myproject/CocoapodsPrivateSpecs.git https://github.com/myproject/CocoapodsPrivateSpecs.git
$ /usr/local/bin/git clone https://github.com/busycm/CocoapodsPrivateSpecs.git myproject
[!] Unable to add a source with url https://github.com/myproject/CocoapodsPrivateSpecs.git https://github.com/myproject/CocoapodsPrivateSpecs.git named myproject.
You can try adding it manually in ~/.cocoapods/repos or via pod repo add.

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/sources_manager.rb:48:in rescue in find_or_create_source_with_url' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/sources_manager.rb:53:infind_or_create_source_with_url'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer/analyzer.rb:623:in block in sources' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer/analyzer.rb:622:inmap'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer/analyzer.rb:622:in sources' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer.rb:129:inresolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer.rb:105:in install!' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/command/project.rb:71:inrun_install_with_update'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/command/project.rb:156:in run' /Library/Ruby/Gems/2.0.0/gems/claide-0.9.1/lib/claide/command.rb:312:inrun'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/command.rb:48:in run' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/bin/pod:44:in<top (required)>'
/usr/local/bin/pod:23:in load' /usr/local/bin/pod:23:in

'
Cloning into 'myproject'...
fatal: could not read Username for 'https://github.com': Device not configured

It might also be worth nothing that 1) I'm a contributor on this
particular project, myproject is actually an organization and 2) None of
the pods in my main Xcode project are private but rather I have a pod A
that I made that relies on another pod B that I made and pod B is the only
one sitting in a private spec repo.


Reply to this email directly or view it on GitHub
#21 (comment)
.

I think the URL is just git@github.com:myproject/CocoapodsPrivateSpecs.git.
Without the ssh. Try that maybe? (Also in the log it still seems to be
adding the https URL)
On Thu, Oct 1, 2015 at 7:07 PM Brendan Conron notifications@github.com
wrote:

For ssh, would it not be ssh://git@github.com:
myproject/CocoapodsPrivateSpecs.git?

Also in my script I ran pod install --verbose and got this:

Update all pods
Preparing

Cloning spec repo myproject from https://github.com/myproject/CocoapodsPrivateSpecs.git https://github.com/myproject/CocoapodsPrivateSpecs.git
$ /usr/local/bin/git clone https://github.com/busycm/CocoapodsPrivateSpecs.git myproject
[!] Unable to add a source with url https://github.com/myproject/CocoapodsPrivateSpecs.git https://github.com/myproject/CocoapodsPrivateSpecs.git named myproject.
You can try adding it manually in ~/.cocoapods/repos or via pod repo add.

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/sources_manager.rb:48:in rescue in find_or_create_source_with_url' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/sources_manager.rb:53:infind_or_create_source_with_url'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer/analyzer.rb:623:in block in sources' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer/analyzer.rb:622:inmap'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer/analyzer.rb:622:in sources' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer.rb:129:inresolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/installer.rb:105:in install!' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/command/project.rb:71:inrun_install_with_update'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/command/project.rb:156:in run' /Library/Ruby/Gems/2.0.0/gems/claide-0.9.1/lib/claide/command.rb:312:inrun'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/lib/cocoapods/command.rb:48:in run' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.4/bin/pod:44:in<top (required)>'
/usr/local/bin/pod:23:in load' /usr/local/bin/pod:23:in

'
Cloning into 'myproject'...
fatal: could not read Username for 'https://github.com': Device not configured

It might also be worth nothing that 1) I'm a contributor on this
particular project, myproject is actually an organization and 2) None of
the pods in my main Xcode project are private but rather I have a pod A
that I made that relies on another pod B that I made and pod B is the only
one sitting in a private spec repo.


Reply to this email directly or view it on GitHub
#21 (comment)
.

@startupthekid

This comment has been minimized.

Show comment
Hide comment
@startupthekid

startupthekid Oct 1, 2015

I think that's just the result of not cleaning the project because now, thankfully (?) I'm getting a different error, an SSH authentication error for my repo:

startupthekid/busycm/ios is not a valid repository name
Email support@github.com for help (-1)

startupthekid is my username, busyios is the organization, ios is the project

I think that's just the result of not cleaning the project because now, thankfully (?) I'm getting a different error, an SSH authentication error for my repo:

startupthekid/busycm/ios is not a valid repository name
Email support@github.com for help (-1)

startupthekid is my username, busyios is the organization, ios is the project

@czechboy0

This comment has been minimized.

Show comment
Hide comment
@czechboy0

czechboy0 Oct 1, 2015

It should just be owner/project, so depends on who owns it. Open it in a
browser and you'll see which it's supposed to be in the URL bar.
On Thu, Oct 1, 2015 at 7:20 PM Brendan Conron notifications@github.com
wrote:

I think that's just the result of not cleaning the project because now,
thankfully (?) I'm getting a different error, an SSH authentication error
for my repo:

startupthekid/busycm/ios is not a valid repository name
Email support@github.com for help (-1)

startupthekid is my username, busyios is the organization, ios is the
project


Reply to this email directly or view it on GitHub
#21 (comment)
.

It should just be owner/project, so depends on who owns it. Open it in a
browser and you'll see which it's supposed to be in the URL bar.
On Thu, Oct 1, 2015 at 7:20 PM Brendan Conron notifications@github.com
wrote:

I think that's just the result of not cleaning the project because now,
thankfully (?) I'm getting a different error, an SSH authentication error
for my repo:

startupthekid/busycm/ios is not a valid repository name
Email support@github.com for help (-1)

startupthekid is my username, busyios is the organization, ios is the
project


Reply to this email directly or view it on GitHub
#21 (comment)
.

@startupthekid

This comment has been minimized.

Show comment
Hide comment
@startupthekid

startupthekid Oct 1, 2015

Ah I was so close, I set the git remote to incorrectly and now having set it back correctly, I'm back at this error:

Cloning into 'myproject'...
  fatal: could not read Username for 'https://github.com': Device not configured

Oh well, it figures apple would make this such a laborious process.

Ah I was so close, I set the git remote to incorrectly and now having set it back correctly, I'm back at this error:

Cloning into 'myproject'...
  fatal: could not read Username for 'https://github.com': Device not configured

Oh well, it figures apple would make this such a laborious process.

@joeblau

This comment has been minimized.

Show comment
Hide comment
@joeblau

joeblau Oct 1, 2015

What is the URI of your remote?

joeblau commented Oct 1, 2015

What is the URI of your remote?

@startupthekid

This comment has been minimized.

Show comment
Hide comment
@startupthekid

startupthekid Oct 1, 2015

https://github.com/busycm/ios and there's three private repos, one is the private specs repo and the other two are just pods/

https://github.com/busycm/ios and there's three private repos, one is the private specs repo and the other two are just pods/

@joeblau

This comment has been minimized.

Show comment
Hide comment
@joeblau

joeblau Oct 1, 2015

When I setup private repos, I use the ssh URI (git@github.com:busycm/ios) and then add the public and private keys to the _xcsbuildd user. You shouldn't use https unless you have a really good reason to put your username/password in the clear.

joeblau commented Oct 1, 2015

When I setup private repos, I use the ssh URI (git@github.com:busycm/ios) and then add the public and private keys to the _xcsbuildd user. You shouldn't use https unless you have a really good reason to put your username/password in the clear.

@startupthekid

This comment has been minimized.

Show comment
Hide comment
@startupthekid

startupthekid Oct 1, 2015

Do you mean you set the git remote to be git@github.com/busycm/ios by doing git remote add origin git@github.com/busy/ios? And not git@github.com:busycm/ios?

Do you mean you set the git remote to be git@github.com/busycm/ios by doing git remote add origin git@github.com/busy/ios? And not git@github.com:busycm/ios?

@joeblau

This comment has been minimized.

Show comment
Hide comment
@joeblau

joeblau Oct 1, 2015

The version with the semicolon before your project/username.

joeblau commented Oct 1, 2015

The version with the semicolon before your project/username.

@startupthekid

This comment has been minimized.

Show comment
Hide comment
@startupthekid

startupthekid Oct 1, 2015

Yeah not a clue. I went through and changed the remote of all my cocoapods to use ssh and re-added those into xcode using my public key authentication but it seems to be a lost cause.

Yeah not a clue. I went through and changed the remote of all my cocoapods to use ssh and re-added those into xcode using my public key authentication but it seems to be a lost cause.

@czechboy0

This comment has been minimized.

Show comment
Hide comment
@czechboy0

czechboy0 Oct 1, 2015

Also there needs to be .git at the end, like
http://git@github.com/busycm/ios.git
On Thu, Oct 1, 2015 at 8:27 PM Brendan Conron notifications@github.com
wrote:

Yeah not a clue. I went through and changed the remote of all my cocoapods
to use ssh and re-added those into xcode using my public key authentication
but it seems to be a lost cause.


Reply to this email directly or view it on GitHub
#21 (comment)
.

Also there needs to be .git at the end, like
http://git@github.com/busycm/ios.git
On Thu, Oct 1, 2015 at 8:27 PM Brendan Conron notifications@github.com
wrote:

Yeah not a clue. I went through and changed the remote of all my cocoapods
to use ssh and re-added those into xcode using my public key authentication
but it seems to be a lost cause.


Reply to this email directly or view it on GitHub
#21 (comment)
.

@startupthekid

This comment has been minimized.

Show comment
Hide comment
@startupthekid

startupthekid Oct 1, 2015

Not http:// though, doesn't that defeat the whole purpose of using ssh?

Not http:// though, doesn't that defeat the whole purpose of using ssh?

@joeblau

This comment has been minimized.

Show comment
Hide comment
@joeblau

joeblau Oct 1, 2015

@startupthekid You can copy the correct URL directly from GitHub's web UI.

clonessh

You also need to add the public/private key to _xcsbuildd user so that you can do the post setup clone via Cocoapods.

joeblau commented Oct 1, 2015

@startupthekid You can copy the correct URL directly from GitHub's web UI.

clonessh

You also need to add the public/private key to _xcsbuildd user so that you can do the post setup clone via Cocoapods.

@startupthekid

This comment has been minimized.

Show comment
Hide comment
@startupthekid

startupthekid Oct 1, 2015

I have a public/private key for the _xcsbuildd user but does that key pair have to be the same as my regular user for github?

I have a public/private key for the _xcsbuildd user but does that key pair have to be the same as my regular user for github?

@czechboy0

This comment has been minimized.

Show comment
Hide comment
@czechboy0

czechboy0 Oct 1, 2015

No, as long as you copied that public key to GitHub.

And yes, the http was not supposed to be there, rather it should be
git@github.com/busycm/ios.git
On Thu, Oct 1, 2015 at 8:57 PM Brendan Conron notifications@github.com
wrote:

I have a public/private key for the _xcsbuildd user but does that key
pair have to be the same as my regular user for github?


Reply to this email directly or view it on GitHub
#21 (comment)
.

No, as long as you copied that public key to GitHub.

And yes, the http was not supposed to be there, rather it should be
git@github.com/busycm/ios.git
On Thu, Oct 1, 2015 at 8:57 PM Brendan Conron notifications@github.com
wrote:

I have a public/private key for the _xcsbuildd user but does that key
pair have to be the same as my regular user for github?


Reply to this email directly or view it on GitHub
#21 (comment)
.

@startupthekid

This comment has been minimized.

Show comment
Hide comment
@startupthekid

startupthekid Oct 1, 2015

Ok cool. I ended up doing a complete clean of all my repos and set everything back the way it was and now I'm getting this:

[!] Error installing BZYBinders
[!] /usr/local/bin/git clone https://github.com/busycm/BZYBinders.git /var/folders/82/xnzs001n09dccsqt27tn7lsw000087/T/d20151001-59388-kvmypg --single-branch --depth 1 --branch 0.5.4

Cloning into '/var/folders/82/xnzs001n09dccsqt27tn7lsw000087/T/d20151001-59388-kvmypg'...
fatal: could not read Username for 'https://github.com': Device not configured

(BZYBinders is one of my private pods)

I think the solution here is to make all my private pods public and see if that works.

Ok cool. I ended up doing a complete clean of all my repos and set everything back the way it was and now I'm getting this:

[!] Error installing BZYBinders
[!] /usr/local/bin/git clone https://github.com/busycm/BZYBinders.git /var/folders/82/xnzs001n09dccsqt27tn7lsw000087/T/d20151001-59388-kvmypg --single-branch --depth 1 --branch 0.5.4

Cloning into '/var/folders/82/xnzs001n09dccsqt27tn7lsw000087/T/d20151001-59388-kvmypg'...
fatal: could not read Username for 'https://github.com': Device not configured

(BZYBinders is one of my private pods)

I think the solution here is to make all my private pods public and see if that works.

@czechboy0

This comment has been minimized.

Show comment
Hide comment
@czechboy0

czechboy0 Oct 1, 2015

Before you do that, can you log in as _xcsbuildd and just try git clone git@github.com/busycm/ios.git? If that works, then the issue is not the SSH keys. If it doesn't, please make sure to go through the tutorial again to make sure that you got it all setup. Should hopefully make it easier to spot the issue.

Making Pods public is really just a workaround, but I've been using private pods for years without a problem, so I know it's possible :)

Before you do that, can you log in as _xcsbuildd and just try git clone git@github.com/busycm/ios.git? If that works, then the issue is not the SSH keys. If it doesn't, please make sure to go through the tutorial again to make sure that you got it all setup. Should hopefully make it easier to spot the issue.

Making Pods public is really just a workaround, but I've been using private pods for years without a problem, so I know it's possible :)

@startupthekid

This comment has been minimized.

Show comment
Hide comment
@startupthekid

startupthekid Oct 1, 2015

Cloning works super super duper!

Do you think that possibly it's because my project has a private pod that uses another private pod as a dependency? I don't know how that would affect it but it seems to be unique from what most people are trying.

And yeah! I'd love to be able to use private pods and Xcode bots. I've tried jenkins but that was a pain because you can only run in on a mac server and whatnot.

Cloning works super super duper!

Do you think that possibly it's because my project has a private pod that uses another private pod as a dependency? I don't know how that would affect it but it seems to be unique from what most people are trying.

And yeah! I'd love to be able to use private pods and Xcode bots. I've tried jenkins but that was a pain because you can only run in on a mac server and whatnot.

@czechboy0

This comment has been minimized.

Show comment
Hide comment
@czechboy0

czechboy0 Oct 1, 2015

Then your SSH keys are setup correctly! So it must be something with CocoaPods. Did you specify both private spec-repos with the source command in your Podfile? I'm sure other people here can advice you better on how to debug this - but when it comes to Xcode Server & SSH keys, you're all set.

Then your SSH keys are setup correctly! So it must be something with CocoaPods. Did you specify both private spec-repos with the source command in your Podfile? I'm sure other people here can advice you better on how to debug this - but when it comes to Xcode Server & SSH keys, you're all set.

@startupthekid

This comment has been minimized.

Show comment
Hide comment
@startupthekid

startupthekid Oct 1, 2015

Yup I put

source 'git@github.com:CocoaPods/Specs.git'
source 'git@github.com:busycm/CocoapodsPrivateSpecs.git'

at the top of all my Podfiles, not just my project but all my private pods as well to be on the safe side.

Yup I put

source 'git@github.com:CocoaPods/Specs.git'
source 'git@github.com:busycm/CocoapodsPrivateSpecs.git'

at the top of all my Podfiles, not just my project but all my private pods as well to be on the safe side.

@czechboy0

This comment has been minimized.

Show comment
Hide comment
@czechboy0

czechboy0 Oct 1, 2015

my project has a private pod that uses another private pod as a dependency

AFAIK that shouldn't be a problem as long as both pods have their specs in one of the specified repositories.

Anyway - I actually think you should create a new ticket with your specific setup, I'm sure you'll get help there quicker (this thread is otherwise getting off-topic).

my project has a private pod that uses another private pod as a dependency

AFAIK that shouldn't be a problem as long as both pods have their specs in one of the specified repositories.

Anyway - I actually think you should create a new ticket with your specific setup, I'm sure you'll get help there quicker (this thread is otherwise getting off-topic).

@startupthekid

This comment has been minimized.

Show comment
Hide comment

👍

@kaosdg

This comment has been minimized.

Show comment
Hide comment
@kaosdg

kaosdg Oct 31, 2015

If @startupthekid is still having issues with this, I had a similar problem:

My private Pods also brought in other private Pods. Part of the problem is how the sources for the .podspecs are configured. Based on your error message, your podspec's s.source is https://, so it won't use the SSH Keys here.

What's going to happen is the process is going to prompt for the username and password to be used.
On a normal user, you would type that in, then be asked if you want to add it to your keychain (so you're not prompted again)
Since _xcsbuildd is headless, you get the "device not configured" issue. (fatal: could not read Username for 'https://github.com': Device not configured)

The way I worked around it was to copy my internet password from the login Keychain into the System keychain (making sure the ACL's were set correctly). Kind of a hack workaround, until I can figure out how to add internet and app passwords to _xcsbuildd's login keychain.
(PSA: DON'T CHANGE _xcsbuildd's password.)

kaosdg commented Oct 31, 2015

If @startupthekid is still having issues with this, I had a similar problem:

My private Pods also brought in other private Pods. Part of the problem is how the sources for the .podspecs are configured. Based on your error message, your podspec's s.source is https://, so it won't use the SSH Keys here.

What's going to happen is the process is going to prompt for the username and password to be used.
On a normal user, you would type that in, then be asked if you want to add it to your keychain (so you're not prompted again)
Since _xcsbuildd is headless, you get the "device not configured" issue. (fatal: could not read Username for 'https://github.com': Device not configured)

The way I worked around it was to copy my internet password from the login Keychain into the System keychain (making sure the ACL's were set correctly). Kind of a hack workaround, until I can figure out how to add internet and app passwords to _xcsbuildd's login keychain.
(PSA: DON'T CHANGE _xcsbuildd's password.)

@startupthekid

This comment has been minimized.

Show comment
Hide comment
@startupthekid

startupthekid Oct 31, 2015

@kaosdg Yeah the issue for me was that my private pod included other private pods of mine as dependencies so including them via https was throwing the error. Using git@ worked just fine.

@kaosdg Yeah the issue for me was that my private pod included other private pods of mine as dependencies so including them via https was throwing the error. Using git@ worked just fine.

@joeblau

This comment has been minimized.

Show comment
Hide comment
@joeblau

joeblau Jun 23, 2016

The new version of Xcode Server fixes this build issue with an actual user:

https://developer.apple.com/videos/play/wwdc2016/409/

joeblau commented Jun 23, 2016

The new version of Xcode Server fixes this build issue with an actual user:

https://developer.apple.com/videos/play/wwdc2016/409/

@Vadimkomis

This comment has been minimized.

Show comment
Hide comment
@Vadimkomis

Vadimkomis Mar 29, 2017

Something that worked for me:
Software: MacOS Sierra, Server 5.2, Xcode 8
export PATH=$PATH:/usr/local/bin
cd
pod install

Something that worked for me:
Software: MacOS Sierra, Server 5.2, Xcode 8
export PATH=$PATH:/usr/local/bin
cd
pod install

@JessieHu

This comment has been minimized.

Show comment
Hide comment
@JessieHu

JessieHu Sep 28, 2017

I used Sever & Bots in Xcode 9, but It showed an error when integrating.
The error was "Trigger Error Trigger exited with non-zero status 134."

Below was my Pre-Integration Scripts:

export LANG=en_US.UTF-8
export PATH=/usr/local/bin:$PATH
cd /Users/jessie/proj_bsoft/hcn-ios-master-pub/hcn-ios-public-dev
pod update --verbose

Below was part of the Log:

Generating Pods project
  - Creating Pods project
  - Adding source files to Pods project
  - Adding frameworks to Pods project
  - Adding libraries to Pods project
  - Adding resources to Pods project
  - Linking headers
  - Installing targets
    - Installing target `AFNetworking` iOS 7.0
    - Installing target `AJKBusiness` iOS 7.0
    - Installing target `AJKCommon` iOS 7.0
    - Installing target `AJKFrame` iOS 7.0
    - Installing target `FMDB` iOS 4.3
    - Installing target `FMDBMigrationManager` iOS 7.0
    - Installing target `FSCalendar` iOS 7.0
    - Installing target `HealthMonitor` iOS 7.0
    - Installing target `IQKeyboardManager` iOS 8.0
    - Installing target `MBProgressHUD` iOS 6.0
    - Installing target `MJExtension` iOS 6.0
    - Installing target `MJRefresh` iOS 6.0
    - Installing target `Masonry` iOS 6.0
    - Installing target `SDCycleScrollView` iOS 7.0
    - Installing target `SDWebImage` iOS 7.0
    - Installing target `TZImagePickerController` iOS 6.0
    - Installing target `YTKNetwork` iOS 7.0
/var/folders/nw/jbl3gsns345gpj2h9ykksdzw0000gn/T/14AD2EE0-8562-4F39-AAD4-B2E2826B9FDA-489-000018E09C80D691: line 6: 90050 Abort trap: 6           pod update --verbose

I don't know why it abort? How can I fix this error?

I used Sever & Bots in Xcode 9, but It showed an error when integrating.
The error was "Trigger Error Trigger exited with non-zero status 134."

Below was my Pre-Integration Scripts:

export LANG=en_US.UTF-8
export PATH=/usr/local/bin:$PATH
cd /Users/jessie/proj_bsoft/hcn-ios-master-pub/hcn-ios-public-dev
pod update --verbose

Below was part of the Log:

Generating Pods project
  - Creating Pods project
  - Adding source files to Pods project
  - Adding frameworks to Pods project
  - Adding libraries to Pods project
  - Adding resources to Pods project
  - Linking headers
  - Installing targets
    - Installing target `AFNetworking` iOS 7.0
    - Installing target `AJKBusiness` iOS 7.0
    - Installing target `AJKCommon` iOS 7.0
    - Installing target `AJKFrame` iOS 7.0
    - Installing target `FMDB` iOS 4.3
    - Installing target `FMDBMigrationManager` iOS 7.0
    - Installing target `FSCalendar` iOS 7.0
    - Installing target `HealthMonitor` iOS 7.0
    - Installing target `IQKeyboardManager` iOS 8.0
    - Installing target `MBProgressHUD` iOS 6.0
    - Installing target `MJExtension` iOS 6.0
    - Installing target `MJRefresh` iOS 6.0
    - Installing target `Masonry` iOS 6.0
    - Installing target `SDCycleScrollView` iOS 7.0
    - Installing target `SDWebImage` iOS 7.0
    - Installing target `TZImagePickerController` iOS 6.0
    - Installing target `YTKNetwork` iOS 7.0
/var/folders/nw/jbl3gsns345gpj2h9ykksdzw0000gn/T/14AD2EE0-8562-4F39-AAD4-B2E2826B9FDA-489-000018E09C80D691: line 6: 90050 Abort trap: 6           pod update --verbose

I don't know why it abort? How can I fix this error?

@lolgear

This comment has been minimized.

Show comment
Hide comment
@lolgear

lolgear Oct 23, 2017

Any updates?

I would like to know complete steps to setup bot with cocoa pods dependencies.
It would be nice if parts of these steps are compiled into Wiki page.

lolgear commented Oct 23, 2017

Any updates?

I would like to know complete steps to setup bot with cocoa pods dependencies.
It would be nice if parts of these steps are compiled into Wiki page.

@nick3389

This comment has been minimized.

Show comment
Hide comment
@nick3389

nick3389 Jan 24, 2018

@lolgear I agree. I still get the error for podfile.lock not found and the sandbox is not in sync....
Is there any complete guide?

@lolgear I agree. I still get the error for podfile.lock not found and the sandbox is not in sync....
Is there any complete guide?

@Apocryphon

This comment has been minimized.

Show comment
Hide comment
@Apocryphon

Apocryphon Apr 16, 2018

@nick3389 I think that issue is happening in Build Phase [CP] Check Pods Manifest.lock:

diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
if [ $? != 0 ] ; then
    # print error to STDERR
    echo "error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation." >&2
    exit 1
fi
# This output is used by Xcode 'outputs' to avoid re-running this script phase.
echo "SUCCESS" > "${SCRIPT_OUTPUT_FILE_0}"

Don't know how to resolve this, did you get past it?

Apocryphon commented Apr 16, 2018

@nick3389 I think that issue is happening in Build Phase [CP] Check Pods Manifest.lock:

diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
if [ $? != 0 ] ; then
    # print error to STDERR
    echo "error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation." >&2
    exit 1
fi
# This output is used by Xcode 'outputs' to avoid re-running this script phase.
echo "SUCCESS" > "${SCRIPT_OUTPUT_FILE_0}"

Don't know how to resolve this, did you get past it?

@nick3389

This comment has been minimized.

Show comment
Hide comment
@nick3389

nick3389 Apr 17, 2018

@Apocryphon Yes everything is ok now!. Thanx!

@Apocryphon Yes everything is ok now!. Thanx!

@PrimeHelix

This comment has been minimized.

Show comment
Hide comment
@PrimeHelix

PrimeHelix Jun 16, 2018

image

I use Xcode 9.4.1, I found a solution:
1- a different account (like xcodeserver above) need to log in, then
2- the account need to install cocoapods, then
3- run pod setup

log in as who create Bot if needed,
3. edit Bot, add a Pre-Integration Script:

#!/bin/sh
# use env to print all environment var
cd $(basename "${XCS_PRIMARY_REPO_DIR}")
# the cocoapods exec's path, I use rbenv, you should change to your own
~/.rbenv/shims/pod install

image

I use Xcode 9.4.1, I found a solution:
1- a different account (like xcodeserver above) need to log in, then
2- the account need to install cocoapods, then
3- run pod setup

log in as who create Bot if needed,
3. edit Bot, add a Pre-Integration Script:

#!/bin/sh
# use env to print all environment var
cd $(basename "${XCS_PRIMARY_REPO_DIR}")
# the cocoapods exec's path, I use rbenv, you should change to your own
~/.rbenv/shims/pod install

@pmvcaqr

This comment has been minimized.

Show comment
Hide comment
@pmvcaqr

pmvcaqr Jun 21, 2018

@nick3389
I have the same issue with Build Phase [CP] Check Pods Manifest.lock
How do you get it pass?

pmvcaqr commented Jun 21, 2018

@nick3389
I have the same issue with Build Phase [CP] Check Pods Manifest.lock
How do you get it pass?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment