Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrading existing watchOS 1 project to watchOS 2

I don't want to keep and support watchOS 1, instead, I want to upgrade my existing watchOS 1 project to watchOS 2 without recreating an Interface.Storyboard and etc.

Apple Doc isn't very specific to resolve this case:

watchOS 2 Transition Guide

This post below implies I should keep two separate targets, watchOS 1 and watchOS 2 (redo the storyboard and etc), respectively.

Xcode 7 supporting watch OS1 and OS2

Tried to adjusting watchOS 1 build settings to follow the patterns of watchOS 2, but encountered numerous errors, such as

"Deployment target equal to iOS 8.2 (was 9.0)", 

Setting the deployment target to iOS 8.2 will enable the program to run on the Watch running watchOS 2, but it keeps and supports the code features of watchOS 1 instead watchOS 2. If a brand new watchOS 2 target created in Xcode 7, the deployment target for the WatchKit Extension and WatchKit App is iOS 9.0 and the base SDK is watchOS 2 as oppose to deployment target iOS 8.2 and base SDK watchOS 1 in the build settings.

The setup can't support WKExtension and other new libraries in watchOS 2. Commentor suggests to create a new watchOS 2 project to resolve this.

Running Environment: Xcode 7.0 beta, watchOS 2. Installed watchOS 2 on my Apple Watch and iOS 9 on my iPhone.

... Is this the expected patterns for this migration/transition/upgrade process?

Version 1 Update: Duplicate Storyboard and reuse the files from watchOS 1 for a new watchOS 2 project isn't hard. You need to create at least one provisional profile and App ID for the watchOS 2 App, works on the simulator. The app is installed properly on the Apple Watch, but failed to boot up by running the debug device scheme in Xcode. The Watch App can be booted up manually (without debugging messages). This finding is consistent with Sample Code watchOS 2 project on Github.

like image 655
Kevin Avatar asked Jul 05 '15 04:07

Kevin


People also ask

What is WatchKit extension?

A WatchKit Extension process that executes the watch app's application logic. This is bundled with your Watch app and runs on the Apple Watch. A Watch app that displays user interface elements and handles navigation.

Where does the Watch app extension code run in watchOS 2?

In watchOS 2, not only does the WatchKit extension run on the user's Apple Watch, it is delivered inside the user's Watch app.

How do you code an Apple Watch app?

To build a watch-only app, start a new project in Xcode, select the Watch App template, and click Next. Provide a name, and choose the interface, life cycle, and language for your watch app. Select the options to include a notification scene template or unit and user interface tests, and click Next.


1 Answers

Here is what I did:

  1. Save your WatchOS1 files in a backup folder
  2. Remove all WatchOS1 targets and files
  3. Add new WatchOS2 targets (make sure it compiles)
  4. Copy the backup files to the new targets
like image 189
david72 Avatar answered Oct 05 '22 05:10

david72