1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Xcode BotsでUIテストのテキスト入力が正しく行われない時の対応方法

Posted at

Xcode BotsでKIFを利用したUIテストを実行した時に、英字での入力を期待しているが日本語での入力になってしまいテストが失敗した。

これはハードウェアキーボードが利用されてMacのIMの影響を受けている為だった。よってSimulatorがハードウェアキーボードに接続しないように設定するとソフトウェアキーボードで正しく文字入力が行えるようになった。

Build PhasesでRun Script Phaseを作成して以下のコマンドを実行するとSimulatorの設定が変更され、ソフトウェアキーボードを利用するようになる。

defaults write com.apple.iphonesimulator ConnectHardwareKeyboard 0

また、この設定を読み込ませる為に以下のコマンドでSimulatorを終了させておくと良い。

osascript -e 'quit app "Simulator"'
1
1
0

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?