見出し画像

Flutter appをiPhone実機を用いてdebugする

備忘録。
所望のアプリをgit clone

git clone <repozitory_name>

本家

https://docs.flutter.dev/get-started/install/macos

フォルダ内に移動し、flutter解凍

cd ~/development
unzip ~/Downloads/flutter_macos_3.7.10-stable.zip

パスを通す

export PATH="$PATH:`pwd`/flutter/bin"

一応、以下を回しておく

flutter doctor

Xcodeでios以下のRunner.xcodeprojを開く
TeamとBundle identifier を設定

pubspec.yamlの見える場所まで行く

flutter run

以下のエラーが発生した。

Could not build the precompiled application for the device.
Error (Xcode): File not found:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a


Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)



Error launching application on Tele Angler-iPhone.

このページを参考にios以下のPodfileに以下を挿入。

post_install do |installer|
----以下挿入----
  installer.generated_projects.each do |project|
    project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
      end
   end
  end
---------------
 installer.pods_project.targets.each do |target|
   flutter_additional_ios_build_settings(target)
 end
end

iPhone繋いで、再度以下を走らせる

flutter run


この記事が気に入ったらサポートをしてみませんか?