rayh / xcoder

ruby wrapper for Xcode build tools to aid automating builds

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Keychain lock timeout

dlbuckley opened this issue · comments

Problem

I have been moving a number of my projects over to using xcoder recently and it's all been going fine until I tried to move over our main project. Unfortunately we started to have problems with the ipa not being signed because of a 'user interaction problem' with the keychain.

After spending a few hours trying to nail down the problem I realized that the keychain that was being created was locking after 5 mins (which is the default behavior for a new keychain). This causes us problems because the app we are trying to build takes about 7-8 mins to build on our CI machine, so by the time it comes to sign the ipa the keychain is locked and we get the 'user interaction problem'.

Temporary Fix

A quick fix for this was adding these few simple lines to the rake task after creating the temp keychain:

keychain = Xcode::Keychain.temp
# Remove timeout lock for newly created keychain
cmd = Xcode::Shell::Command.new "security"
cmd << "set-keychain-settings"
cmd << "-u"
cmd << "\"#{keychain.path}\""
cmd.execute

This fix removed any timeout locks on the temp keychain and allowed the ipa to be signed with no further problems.

Feature Request

It would be a nice feature to be able to set the timeout on the keychain, or remove it completely for when users have larger projects.

References

keychain CLI documentation: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/security.1.html

This sounds like something that should be applied to any keychains we
create. I think I will add it to the Keychain.create method and then .temp
will inherit this behaviour as well.

On 22 May 2013 20:39, Dale Buckley notifications@github.com wrote:

Problem

I have been moving a number of my projects over to using xcoder recently
and it's all been going fine until I tried to move over our main project.
Unfortunately we started to have problems with the ipa not being signed
because of a 'user interaction problem' with the keychain.

After spending a few hours trying to nail down the problem I realized that
the keychain that was being created was locking after 5 mins (which is the
default behavior for a new keychain). This causes us problems because the
app we are trying to build takes about 7-8 mins to build on our CI machine,
so by the time it comes to sign the ipa the keychain is locked and we get
the 'user interaction problem'.
Temporary Fix

A quick fix for this was adding these few simple lines to the rake task
after creating the temp keychain:

keychain = Xcode::Keychain.temp# Remove timeout lock for newly created keychaincmd = Xcode::Shell::Command.new "security"cmd << "set-keychain-settings"cmd << "-u"cmd << ""#{keychain.path}""cmd.execute

This fix removed any timeout locks on the temp keychain and allowed the
ipa to be signed with no further problems.
Feature Request

It would be a nice feature to be able to set the timeout on the keychain,
or remove it completely for when users have larger projects.
References

keychain CLI documentation:
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/security.1.html


Reply to this email directly or view it on GitHubhttps://github.com//issues/67
.

Ray Hilton

(maker of mobile apps)

13/243 Collins St, Melbourne VIC 3000 | +61 (0) 430 484 708 |
http://ray.sh

Fixed in a11d8c5

On 23 May 2013 09:16, Ray Hilton ray@wirestorm.net wrote:

This sounds like something that should be applied to any keychains we
create. I think I will add it to the Keychain.create method and then .temp
will inherit this behaviour as well.

On 22 May 2013 20:39, Dale Buckley notifications@github.com wrote:

Problem

I have been moving a number of my projects over to using xcoder recently
and it's all been going fine until I tried to move over our main project.
Unfortunately we started to have problems with the ipa not being signed
because of a 'user interaction problem' with the keychain.

After spending a few hours trying to nail down the problem I realized
that the keychain that was being created was locking after 5 mins (which is
the default behavior for a new keychain). This causes us problems because
the app we are trying to build takes about 7-8 mins to build on our CI
machine, so by the time it comes to sign the ipa the keychain is locked and
we get the 'user interaction problem'.
Temporary Fix

A quick fix for this was adding these few simple lines to the rake task
after creating the temp keychain:

keychain = Xcode::Keychain.temp# Remove timeout lock for newly created keychaincmd = Xcode::Shell::Command.new "security"cmd << "set-keychain-settings"cmd << "-u"cmd << ""#{keychain.path}""cmd.execute

This fix removed any timeout locks on the temp keychain and allowed the
ipa to be signed with no further problems.
Feature Request

It would be a nice feature to be able to set the timeout on the keychain,
or remove it completely for when users have larger projects.
References

keychain CLI documentation:
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/security.1.html


Reply to this email directly or view it on GitHubhttps://github.com//issues/67
.

Ray Hilton

(maker of mobile apps)

13/243 Collins St, Melbourne VIC 3000 | +61 (0) 430 484 708 |
http://ray.sh

Ray Hilton

(maker of mobile apps)

13/243 Collins St, Melbourne VIC 3000 | +61 (0) 430 484 708 |
http://ray.sh

Great news, thanks!