{
"$type": "site.standard.document",
"description": "How I set up RubyMotion build settings for simulator, development device builds, and adhoc release builds using one environment flag.",
"path": "/different-settings-development-adhoc-builds-rubymotion/",
"publishedAt": "2013-05-06T00:37:00.000Z",
"site": "at://did:plc:bryys25pc2fnagnyxqgsglhd/site.standard.publication/3mn26bjkkmh23",
"tags": [
"RubyMotion",
"iOS Development",
"Techniques"
],
"textContent": "In our RubyMotion Rakefile, we'll want to be able to have different settings — especially for codesigning — when building for the simulator, device for development testing or device for adhoc/release testing. Based on this nice tip from Ben Sheldon, I've derived something simple for myself. Here's the relevant parts:\n\nMotion::Project::App.setup do |app|\n env = if ENV['dev'] == '1'\n 'dev'\n elsif ENV['adhoc'] == '1'\n 'adhoc'\n else\n 'dev' #default\n end\n\n #...\n\n if env == 'dev'\n #...\n elsif env == 'adhoc'\n #...\n end\nend\n\ntask :set_adhoc do\n ENV['adhoc'] = '1'\nend \n\ntask :tf => [\n :set_adhoc,\n :testflight\n]\n\nUse the :tf task instead of :testflight and everything will work as expected:\n\nrake retina=4\t#This will default to dev=1, but it doesn't matter\nrake device debug\t#This will default to dev=1\nrake tf notes=\"//\"\t#This will run testflight with adhoc=1\n\nNote: Updated based on feedback from Ben Sheldon.",
"title": "Different Settings for Development and Adhoc Builds in RubyMotion"
}