Search code examples
macosrubymotion

How to add an app icon to a RubyMotion OS X app?


I am creating an OS X app with RubyMotion. I want to add an app icon. I copied my stopwatch.png file to the resources directory and specified the filename in the Rakefile:

# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/osx'

begin
  require 'bundler'
  Bundler.require
rescue LoadError
end

Motion::Project::App.setup do |app|
  app.name = 'Timetracker'
  app.icon = 'stopwatch.png'
end

When I run rake it does not apply my icon. I even ran rake build and the .app created does not use my icon. What am I doing wrong?


Solution

  • You can't specify a direct image it needs to be in the format of a .icns file.

    SOURCE: https://groups.google.com/forum/#!topic/rubymotion/TxkA9IjRRM4

    Convert here: http://iconverticons.com/online/

    You may need to run rake clean for your icon change to take effect.