Adaloのカスタムコンポーネント開発時iOSテスト環境を構築する
環境
- Windows 11
- OSX Monterey version 12.6.1
- 以降の検証は、WSL上にdocker-osxをインストール
手順の詳細:Windows(WSL2)でMacOSXを動かす
- コンテナの立ち上げコマンドは下記
docker run -it \--device /dev/kvm \-p 50922:10022 \-v /tmp/.X11-unix:/tmp/.X11-unix \-e "DISPLAY=${DISPLAY:-:0.0}" \-e RAM=6 \-e GENERATE_UNIQUE=true \-e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \sickcodes/docker-osx:monterey- Xcodeのインストールのため、OSXのバージョンはMontereyを選択
- iOSエミュレータ起動のため、RAMを4以上に設定
(WSL2のRAM量を増やす方法はこちらを参照:WSL2で利用できるRAM量を増やす)
- 以降の検証は、WSL上にdocker-osxをインストール
手順
準備
- Xcodeをインストール
- Apple Storeからインストール
- Homebrewをインストール
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" - リポジトリをアップデート
$ brew update - Watchmanをインストール
$ brew install watchman - Cocoapodsをインストール
$ brew install cocoapods - Node.jsをインストールしてリンク
$ brew install node$ brew install node@14$ brew unlink node$ brew link --force node@14- versionを14にする理由はこちらを参照:Adaloカスタムコンポーネントテスト環境用mobile-previewerのインストール時のエラー1
- yarnをインストール
$ brew install yarn - テキスト正規化の設定を更新
$ export LANG=en_US.UTF-8
mobile-previewerをインストール
- mobile-previewerをcloneしてくる
$ git clone https://github.com/AdaloHQ/mobile-previewer.git - cloneしたディレクトリに移動
$ cd mobile-previewer - 依存ライブラリをインストール
$ yarn install iosディレクトリに移動$ cd ios- Xcodeワークスペースの依存ライブラリをインストール
$ pod install- 途中で
configure: error: C compiler cannot create executablesというようなエラーが出たらこちらを参照:pod install実行時のエラー [configure: error: C compiler cannot create executables]
- 途中で
- 2.と同じライブラリに移動
$ ../ - サービスを実行
$ yarn start
$ node node_modules/react-native/local-cli/cli.js start --reset-cache
###### ######
### #### #### ###
## ### ### ##
## #### ##
## #### ##
## ## ## ##
## ### ### ##
## ######################## ##
###### ### ### ######
### ## ## ## ## ###
### ## ### #### ### ## ###
## #### ######## #### ##
## ### ########## ### ##
## #### ######## #### ##
### ## ### #### ### ## ###
### ## ## ## ## ###
###### ### ### ######
## ######################## ##
## ### ### ##
## ## ## ##
## #### ##
## #### ##
## ### ### ##
### #### #### ###
###### ######
warning: the transform cache was reset.
Welcome to React Native!
Learn once, write anywhere
To reload the app press "r"
To open developer menu press "d"
Xcodeでエミュレータを起動
- Xcodeを開き、Command Line Toolsを設定
- Preference > Location > Command Line Toolsを設定
参考:https://qiita.com/eytyet/items/59c5bad1c167d5addc68
- Preference > Location > Command Line Toolsを設定
- 前節4. のディレクトリのAdaloApp.xcworkspaceを開く
- 左上の実行ボタン「▶」をクリックし、エミュレータが立ち上がることを確認
- 前節 7.で実行しているサービスと連携する
- エミュレータ上で「Reload」を実行する
- 上記で連携されなければ、前節7. のサービスをで
rを入力する
カスタムコンポーネントの作成とimport方法に関してはこちら:Adaloカスタムコンポーネントのシミュレーション環境でカスタムコンポーネントをimportする

ディスカッション
コメント一覧
まだ、コメントがありません