I'm building an iPhone app with Jenkins so at some point it needs to use /usr/bin/security
. Unfortunately Jenkins can't find that command.
Here's the console log excerpt:
[workspace] $ /usr/bin/security find-identity -p codesigning -v FATAL: Cannot run program "/usr/bin/security" (in directory "/Users/jenkins/.jenkins/jobs/Obfuscated iOS/workspace"): error=2, No such file or directory java.io.IOException: Cannot run program "/usr/bin/security" (in directory "/Users/jenkins/.jenkins/jobs/Obfuscated iOS/workspace"): error=2, No such file or directory
Something like this typically means there is a permissions issue, so I have tried sudo chmod 777 /usr/bin/security
but the build yields the same result.
Furthermore, when I try /usr/bin/security find-identity -p codesigning -v
from terminal it works just fine.
How do I get Jenkins to be able to use this tool and any other iOS tools it might need?
The odd part is that other iOS related tools like /usr/bin/xcodebuild
and /usr/bin/agvtool
work fine as seen below:
[workspace] $ /usr/bin/xcodebuild -version
Xcode 6.4
Build version 6E35b
Fetching marketing version number (CFBundleShortVersionString) from project.
[workspace] $ /usr/bin/agvtool mvers -terse1
Found marketing version (CFBundleShortVersionString): 4.0.0.
Marketing version (CFBundleShortVersionString) found in project configuration: 4.0.0.
Fetching technical version number (CFBundleVersion) from project.
[workspace] $ /usr/bin/agvtool vers -terse
ls -le
yields
-rwxr-xr-x 1 root wheel 224032 Aug 1 20:43 security
This looks normal to me when compared to other tools in the same directory like xcodebuild.
I checked the Jenkins System Configuration page and it lists this for PATH:/usr/bin:/bin:/usr/sbin:/sbin
If I create a new job with only a build step with the command, /usr/bin/security find-identity -p codesigning -v
, then it runs fine.
This suggests that internally the command is being run by another process.
The problem was occurring because of the value used in "Build output directory":
Removing ${WORKSPACE}
resolved the issue with calling /usr/bin/security.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With