facebook twitter hatena line email

Ios/swift/実機確認

提供: 初心者エンジニアの簡易メモ
2018年10月15日 (月) 15:29時点におけるAdmin (トーク | 投稿記録)による版 (usb未接続端末でテスト)

移動: 案内検索

実機検証

  1. 実機をUSBで接続
  2. xcodeの上部にあるiPhone6などと書かれている部分を自分のDeviceに選択しなおす。
  3. ▶︎を押してビルド実行

以下メッセージが出た場合

Verify the Developer App certificate for your account is 
  1. 実機について以下確認
  2. 設定/一般/プロファイルとデバイス管理/デベロッパAPP/信頼するに変更

The run destination is not valid for Running the scheme

xcodeのgeneralから端末をregisterするボタンを押す

  1. 開発端末のxcodeの中身を確認する
$ cd ~/Library/Developer/Xcode/iOS\ DeviceSupport/
$ ls 
10.0.2 (14A456)	10.3.1 (14E304)

もしくは

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
$ ls 
10.0		10.1		10.2
  1. https://github.com/iGhibli/iOS-DeviceSupport/tree/master/DeviceSupport から
  2. 端末のosに相当するverをDLして上記どちか存在するDIRにいれてビルド、もしくはxcode再起動すれば良い。
  3. ios12の場合12.0 (16A5288q)をいれればビルドできた。(12.0 (16A366)だとできなかった)

参考:https://qiita.com/_CHUBURA/items/ffd280e50ed623989045

xcodeのビルドディレクトリ

不要であればざっくり削除する

$ du -sh ~/Library/Developer/Xcode/DerivedData/
14G DerivedData
$ rm -fr ~/Library/Developer/Xcode/DerivedData/*

iphonexsへのビルド

iphonexs doesn’t support any of app’s architectures.
You can add iphonexs’s arm64e architecture to app’s Architectures build setting.

xcode10である必要がある(macosのsierraはhigh sierraにしないとだめ)

参考:https://github.com/apache/cordova-ios/issues/423

usb未接続端末でテスト

iosのdeveloperサイトに端末のUDIDを登録し再度ipaを作成する