配置了环境变量,在mac 机器上:
bogon:~ suning$ which xctool
/Users/suning/brew-1.2.0/bin/xctool
bogon:~ suning$ which xcodebuild
/usr/bin/xcodebuild
bogon:~ suning$ vim /etc/profile
bogon:~ suning$ which xctool
/Users/suning/brew-1.2.0/bin/xctool
bogon:~ suning$ cd
bogon:~ suning$ pwd
/Users/suning
bogon:~ suning$ cd /root
-bash: cd: /root: No such file or directory
bogon:~ suning$ cd ..
bogon:Users suning$ ls
Shared suning
bogon:Users suning$ sh
sh-3.2$ env
SHELL=/bin/bash
TERM=xterm
SSH_CLIENT=10.24.40.152 54318 22
TMPDIR=/var/folders/jf/w67jw_5n2kn888pd0b1pd6400000gn/T/
SSH_TTY=/dev/ttys000
USER=suning
PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin::/Users/suning/brew-1.2.0/bin
MAIL=/var/mail/suning
_=/usr/bin/env
PWD=/Users
JAVA_HOME=/usr
HOME=/Users/suning
SHLVL=2
LOGNAME=suning
SSH_CONNECTION=10.24.40.152 54318 10.24.41.159 22
sh-3.2$ xctool
ERROR: Unable to find projects (.xcodeproj) in directory /Users. Please specify with -workspace, -project, or -find-target.
sh-3.2$ MAC slave 机器上都能找到,但是在jenkins上却是:
+ xctool -project PPSports.xcodeproj -scheme PPSports -sdk iphonesimulator -reporter junit:report/test-report.xml run-tests /var/folders/jf/w67jw_5n2kn888pd0b1pd6400000gn/T/hudson236566281277158657.sh: line 6: xctool: command not found Build step 'Execute shell' marked build as failure
在slave jenkins机器上添加环境变量:
还是不行!!!!!!!!!
调整PATH 值顺序:
/Users/suning/brew-1.2.0/bin:/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin 居然可以了!!!!!
本文详细记录了在Mac系统中配置环境变量的过程,并解决了xctool在Jenkins上因路径问题无法正常运行的难题。通过调整PATH变量的顺序实现了xctool的成功调用。
1496

被折叠的 条评论
为什么被折叠?



