LoginSignup
2
2

More than 5 years have passed since last update.

titanium build -p ios で iOS Simulator の選択画面が毎回でてきてこまったときのこと

Posted at

現象

いつの日からか,iOS build すると次のようにSimulatorの選択画面がでるようになっていました.
毎回選択がめんどくさくてたまりません.

$ ti build -p ios
Titanium Command-Line Interface, CLI version 3.3.0-rc2, Titanium SDK version 3.2.3.GA
Copyright (c) 2012-2014, Appcelerator, Inc.  All Rights Reserved.

Please report bugs to http://jira.appcelerator.org/

Which simulator do you want to launch your app in?
   1)  iPhone Retina (3.5 inch)
   2)  iPhone Retina (4 inch)
   3)  iPhone Retina (4 inch 64-bit)
   4)  iPad
   5)  iPad Retina
   6)  iPad Retina (64-bit)
Select an simulator by number or name [1]:

原因

Titanium CLI Options によると,

ios.autoSelectDevice という設定項目がありまして,もし true ならば自動で simulator を選択して起動しますよーみたいなこと書いてました.

ios.autoSelectDevice
If set to true, the CLI picks the emulator or device to launch your application on. If set to false, the CLI presents you with a list of emulator or device options for you to choose to launch the application on.

自分の設定を確認してみると...

$ ti config  | grep ios
ios.autoSelectDevice   = false

falseになってる!というわけで,これを true にすると直るはずです.

対処法

$ ti config ios.autoSelectDevice true
ios.autoSelectDevice saved
$ ti config  | grep ios
ios.autoSelectDevice   = true

直りました!

おまけ

ちなみに help によるとSimulator を指定して起動するときは

$ ti build -h
(中略)
Build iOS Options:
   -C, --device-id <name>           the name of the iOS simulator or the device udid to install the
                                    application to; for simulator builds [iPhone Retina (3.5 inch),
                                    iPhone Retina (4 inch), iPhone Retina (4 inch 64-bit), iPad,
                                    iPad Retina, iPad Retina (64-bit)]; for device builds [itunes,
                                    <udid>, all]

ということで,-C (もしくは --device-id )オプションで,指定するとよいらしいです.

# 4inch Retina 64bit で起動
$ ti build -p ios -C "iPhone Retina (4 inch 64-bit)"

ちょっと -C の選択肢が覚えにくいので,もう少し短いAliasがあるといいなーと思った今日この頃でした.

2
2
2

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
2
2