cocoapods-generate icon indicating copy to clipboard operation
cocoapods-generate copied to clipboard

watchOS support for Pod gen

Open charlotteliang opened this issue 5 years ago • 4 comments

Hi! I'm trying to add unit tests for a watchOS host app. I'm not able to import a watchOS app's resource files using 'Pod gen', so I wonder if there is such a support that I'm not aware of.

charlotteliang avatar Nov 22 '19 20:11 charlotteliang

Likely will need a podspec that demonstrates the problem to investigate.

paulb777 avatar Nov 22 '19 21:11 paulb777

More specifically is to able able to add watchOS host app in a unit test spec: https://guides.cocoapods.org/syntax/podspec.html#test_spec

Currently it automatically adds a main.m file which doesn't work for watch app.

charlotteliang avatar Nov 26 '19 00:11 charlotteliang

pod lib lint has a similar issue.

A workaround for pod gen is to fill in the empty main.m from the App build target in the Target Membership pane after creation:

Screen Shot 2019-12-07 at 2 41 25 PM

but then you run into the issue that XCTests are not supported for watchOS:

Screen Shot 2019-12-07 at 2 31 15 PM

Given that XCTest is not supported for watchOS, would this feature still be useful?

paulb777 avatar Dec 07 '19 21:12 paulb777

A workaround for using pod gen with a podspec that includes watchOS so that it is usable for the other platforms is to specify a specific platform. Otherwise pod gen will fail with

[!] The platform of the target `App-watchOS` (watchOS 6.0) is not compatible with `FirebaseCore/unit (6.4.0)`, which does not support `watchOS`.

Avoid with something like:

pod gen FirebaseCore.podspec --auto-open --local-sources=./ --platforms=ios

paulb777 avatar Dec 18 '19 15:12 paulb777