create-capacitor-plugin icon indicating copy to clipboard operation
create-capacitor-plugin copied to clipboard

chore: run clean, build and test with verify:ios

Open pwespi opened this issue 4 years ago • 3 comments

Currently unit tests are not run with verify:ios.

verify:android runs clean build test, so verify:ios should probably do the same.

pwespi avatar Jan 26 '21 21:01 pwespi

LGTM

I guess my only concern would be how to keep the "preferred simulator" up to date if it's hard-coded in each plugin's package.json.

imhoffd avatar Jan 27 '21 02:01 imhoffd

Thanks for your feedback. I also don't like the hard-coded iPhone version, but didn't find another way.

Without the -destination ... flag, I was getting:

Testing failed:
        Signing for "PluginTests" requires a development team. Select a development team in the Signing & Capabilities editor.
        Testing cancelled because the build failed.

I also tried -sdk iphonesimulator instead of the -destination ..., but then I was getting:

xcodebuild: error: Failed to build workspace Plugin with scheme Plugin.
        Reason: Cannot test target “PluginTests” on “Any iOS Simulator Device”: A build only device cannot be used to run this target. No supported devices are available running a compatible version of iOS Simulator. Connect a device with a newer version of iOS Simulator in order to run your application (or choose a simulated device as the destination).

If anyone has another idea, I'm happy to try it.

pwespi avatar Jan 27 '21 07:01 pwespi

Seems that adding -destination \"platform=iOS Simulator,name=iPhone 12\" can also help with some pod dependency problems, see https://getcapacitor.slack.com/archives/C8AGVAMPZ/p1615813430012300

pwespi avatar Mar 16 '21 20:03 pwespi