LoginSignup
11

More than 5 years have passed since last update.

Xcode 6.1のiOSシミュレータ上で、日本語環境でアプリを起動する

Last updated at Posted at 2014-12-26

Xcode 5.xのときはシミュレータの「Settings」アプリで「General」->「Language & Region」を日本語に設定すると [NSLocale preferredLanguages]とかで日本語環境向けの処理ができたのが、Xcode 6.1からどうやらそれが無視されるようです。

以下のように日本語環境を指定して起動すると、Xcode 6.1でも日本語環境が適用されるみたい。

$ rake args="-AppleLanguages '(ja)'"
  • Before
    141226-0001.png

  • After
    141226-0002.png

Rakefileで以下のように環境変数を設定してあげると、iOSシミュレータ上でアプリを起動するときは、毎回日本語環境が適用されるようになります。

ENV['args'] ||= "-AppleLanguages '(ja)'"  

Motion::Project::App.setup do |app|
  # Use `rake config' to see complete project settings.
  ...
end

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11