Help us understand the problem. What is going on with this article?

CordovaでiOS simulatorを指定する

More than 5 years have passed since last update.

困っていること

# cordovaの場合
cordova emulate iOS

# ionicの場合
ionic emulate iOS

シミュレータを起動した場合にデフォルトのiOS Simulatorが起動する(筆者の場合iPhone6)。テスト目的で違うデバイスでも起動させたいときが出てきますが「ハードウェア」からデバイスを切り替えてもうまくいかない。

解決法

以下のコマンドで使用可能なiOSデバイスがリストアップされます

# iOS platformが追加済みであることが前提
./platforms/ios/cordova/lib/list-emulator-images
# ↓出力結果
# iPhone-4s
# iPhone-5
# iPhone-5s
# iPhone-6-Plus
# iPhone-6
# iPad-2
# iPad-Retina
# iPad-Air
# Resizable-iPhone
# Resizable-iPad

上記で出てきたデバイス名を使って以下のようにコマンドを叩けば意図したシミュレータでアプリの起動が可能です。(他にやり方があれば教えてほしいです)

# cordovaの場合
cordova emulate --target=iPad-2 ios

# ionicの場合
ionic emulate --target=iPad-2 iOS
kenfdev
レガシーよりはエッジな技術好き。でも基本的になんでもやります。
https://kenfdev.hateblo.jp
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした