MacBook Pro,Apple M1,Sonoma 14.3
Xcode15.0
背景:
flutter3.7.7开发的App,iOS端选择语言Swift,Deployment Target 12.0
需要开发配套Apple Watch App ->
File -> New -> Target -> watchOS -> Application -> App
添加Target后运行iOS App、Watch App均没问题,但是Archive时均失败;
解决:
选择Watch App Target -> Build Settings -> Architectures -> Supported Platforms -> 修改为watchOS
Watch App Target -> General -> Deployment Info -> Supports Running Without iOS App Installation
勾选代表没有iOS App可运行Watch App,未勾选时,当运行Watch App到真机时:
Xcode15.0运行: Watch 配对的手机会安装iOS App;
Xcode15.2运行: Watch配对的手机并不会安装iOS App;
=> Xcode15.4运行: Watch 配对的手机会安装iOS App;
使用Xcode直接新建iOS App依然如此 => Xcode15.2对于此场景有bug
另外:
不勾选Supports Running Without iOS App Installation时:
删除iOS App,对应Apple Watch App也会被删除,但删除Apple Watch App,iOS App并不会被删除