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

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -