ios - How can I include the git commit hash in Xcode? -
ios - How can I include the git commit hash in Xcode? -
i have application, people can study bugs straight it, i'd user able submit git hash application built on. xcode expose #define include info or have include in custom build script?
i've written implementation based on reply cited gagarwal. added build script build phases before compilation phase:
/usr/libexec/plistbuddy -c "set :git_commit_hash `git rev-parse head`" "${target_build_dir}"/"${infoplist_path}" in code reference calling:
[[nsbundle mainbundle] infodictionary][@"git_commit_hash"]; and voila, lastly commit hash value available @ run-time!
ios xcode
Comments
Post a Comment