Different Settings for Development and Adhoc Builds in RubyMotion
May 06, 2013
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:
Motion::Project::App.setup do |app|
env = if ENV['dev'] == '1'
'dev'
elsif ENV['adhoc'] == '1'
'adhoc'
else
'dev' #default
end
#...
if env == 'dev'
#...
elsif env == 'adhoc'
#...
end
end
task :set_adhoc do
ENV['adhoc'] = '1'
end
task :tf => [
:set_adhoc,
:testflight
]
Use the :tf task instead of :testflight and everything will work as expected:
rake retina=4 #This will default to dev=1, but it doesn't matter
rake device debug #This will default to dev=1
rake tf notes="//" #This will run testflight with adhoc=1
Note: Updated based on feedback from Ben Sheldon.
.
Previous
Mar 11, 2013
Stuck at OS X Startup, loginwindow Keeps CrashingDec 05, 2012
Write Synchronously to Campfire Room for DebuggingOct 12, 2012
iOS Development Tips Weekly NewsletterJul 31, 2012
Latency Between Heroku (AWS us-east) and LinodeJun 13, 2012
A Craftsman and His ToolsApr 26, 2012
How a Developer Spent a Weekend With His Developer WifeMar 29, 2012
How does Square know my name in their app's registration process?Aug 27, 2011
I don't use Interface BuilderAug 01, 2011
Comments about Straits Times iOS appJul 11, 2011
Trying out Safari againJul 11, 2011
Migrated from Posterous to BlogofileMay 17, 2011
In-app Purchase Patent and What iOS developers Should Know About ItJan 12, 2011
Using ctags with MacVim for Objective C on OS XJul 06, 2010
Glass Buttons in iPhone Apps Without Using Image FilesJun 03, 2010
My SimplyTweet Punch CardJun 01, 2010
How to Report a Bug in a Software to the DeveloperMay 18, 2010
You can copy and paste from/to the iPhone simulatorApr 12, 2010
Can't Download Xcode Because Session Keeps ExpiringJan 24, 2010
Disable Callouts for Links with Custom Schemes in UIWebViewJan 15, 2010
Script to Remove Core Data's SQLite Database File During Development CyclesDec 17, 2009
Registered http://settingsapp.com/ a Few Days AgoDec 06, 2009
Automating Internet Sharing on OS X Snow LeopardSep 07, 2009
Speeding up iTunes-iPhone SynchronizationSep 03, 2009
The Wonderful Review ProcessAug 31, 2009
The Power of 48 MinutesAug 05, 2009
Book about Search User interfaces, full text available free onlineAug 04, 2009
Detailed, well-written, informative iPhone app reviews by Stephen IngrahamJul 22, 2009
CEO Letter to Zappos employees over the Amazon acquisitionJul 20, 2009
Interesting blog by startup letting customers make their own newspapers.Jul 19, 2009
SimplyTweet 2.0, iPhone Twitter App with PushJul 18, 2009
A Color Picker for Developers on the MacMay 26, 2009
How to act when you are 25 and Over (Tomato Nation)May 18, 2009
The best introduction to Git which I have read so far - The Git ParableMay 14, 2009
Preparation for SimplyTweet to handle Twitter's new milestone of 2^16 status IDsMay 08, 2009
How to be a good developer