1.0 KiB
watchOS sample
This example shows how to write watchOS UI applications in Kotlin, and run them on iWatch or simulator.
To build and run the sample do the following:
-
Open
watchosSample.xcodeprojset development team to your own and make bundle ID unique in project setting. or 1a. Similarly modifybundleIdPrefix,DEVELOPMENT_TEAMandWKAppBundleIdentifierinproject.ymland generate Xcode project withxcodegen(https://github.com/yonaskolb/XcodeGen/). Open generatedwatchosSample.xcodeprojwith Xcode. -
Update property
WKAppBundleIdentifierinplists/Ext/Info.plistwith new ID of the watch application, if not regenerating project. -
Now build and run the application on a connected iPhone with paired iWatch or simulator.
Note that in this example we do not use storyboards, and instead create user interface components programmatically.
First run of application on the physical watch could be blocked, so run it from watch menu and explicitly confirm that developer is trusted.