Search Unity

Apple Watch

Discussion in 'iOS and tvOS' started by fmarkus, Sep 9, 2014.

  1. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,038
    You can do exactly that right now. Just use WatchKit to send the interface to the watch. You've had the option for months :)
     
    TylerPerry likes this.
  2. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    You can do nothing but simple notification or interactive views and most of the logic is always running on iPhone. This was already known months ago when they first revealed the SDK.

    https://developer.apple.com/watchkit/

    Sarcasm or ignorance? :)
     
  3. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    Ignorance.
     
  4. CoCoNutti

    CoCoNutti

    Joined:
    Nov 30, 2009
    Posts:
    513
    Well, an ignorant statement thinking that Unity is for games. Unity is NOT just for games. Many businesses and industries that have NOTHING to do with games use Unity for other purposes. Don't be ignorant.
     
    SaltwaterAssembly and TylerPerry like this.
  5. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    I think it's because Unity wouldn't "export" for the Apple Watch rather it's functionality added to a IOS build.
     
    Ostwind likes this.
  6. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    Thanks for the info.
    I hoped it'll work like this.
     
  7. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    I hope that no one will buy it only thinking they can do cool stuff with the watch and Unity. Before investing, make sure you know exactly what it can do and if its the thing you want at least if you plan to publish to appstore :)

    From gaming and Unity perspective you can't stream your game view to it or really use the sensors to make it a controlling device other than simple gestures or apps like quiz/trivia with a delay.
     
  8. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    Just had a quick look at the docs and indeed I hoped it works more like a remote display+input. o_O
    Well, also without creating an app for Apple Watch, I won't run out of projects. ;)
     
  9. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    How would you go about creating new watch faces for it? I couldn't find a mention of that in the docs. The 3 categories don't seem to fit if you want to create new style faces.
     
  10. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,038
    You can't. Maybe it'll be an option in a later version, but right now it seems Apple want people to make anything but new faces. WatchKit apps are extensions to iOS apps, with both running on a different device, and the interfaces are just sent over when the watch is being…watched. You could probably fake up your own thing if you really wanted to, but would have to make a full clock app then. I suspect that they'll reject those sort of apps, at least at first. Make something with HealthKit or ResearchKit, and you're almost guaranteed to be promoted ;)

    The portion of a WatchKit app that displays on the watch is just an extension bundle of storyboards, with controllers written in Cocoa (so ObjC or Swift). It should be easy to set it up and call like any other external code in Unity on iOS. Nothing needs to change in Unity to use it as normal, but sending graphics from Unity over may not be straight-forward.
     
  11. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    Anything about developing for the Watch so far has met with this thought from me:

     
  12. brianasu

    brianasu

    Joined:
    Mar 9, 2010
    Posts:
    369
    Watching... this thread for updates. Could make a fun game that tracks your hand motions:)
     
  13. kscho

    kscho

    Joined:
    Jun 17, 2014
    Posts:
    59
    is paid app/game the only way to monetize on the Watch? Does iAd or Admob interstitial work on it, I wonder?
     
  14. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    nope... not rising to that one.
     
  15. schchang1

    schchang1

    Joined:
    Sep 12, 2012
    Posts:
    8
    Has anyone ever successfully made a watch app based on a Unity generated xcode project?
    I tried to make a watch app based on Unity's xcode project but failed when code-signing the app.
    Here are the steps I went throught:
    - Create an Unity iOS project, set the build option to Simulator SDK and build the xcode project.
    - Following Apple's instructions, add the WatchKit extension and WatchKit app build targets to the xcode project.
    - Change the Unity target's build location to build/Debug-iphones instead of build/Debug-iphonesimulator to fix a file copy failed error.
    - The build process still failed with this error message
    (null): error: Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target's code sign settings match the parent app's.

    One thing very strange is, in the xcode project's, the Unity-iPhone build target's project information view is missing the General menu tab.( only Capabilities, Build Setings, Build Phases, Build Rules show up)
    If I create the xcode project from Unity Editor without the Simulator SDK flag, then the General menu tab appears.

    Any help or directions for fixing the code signing issue will be very appreciated.
     
  16. schchang1

    schchang1

    Joined:
    Sep 12, 2012
    Posts:
    8
    Has anyone ever successfully made a watch app based on a Unity generated xcode project?

    I found a youtube video here but there is no info how he did it.


    I tried to make a watch app based on Unity's xcode project but failed when code-signing the app.
    Here are the steps I went throught:

    - Create an Unity iOS project, set the build option to Simulator SDK and build the xcode project.
    - Following Apple's instructions, add the WatchKit extension and WatchKit app build targets to the xcode project.
    - Change the Unity target's build location to build/Debug-iphones instead of build/Debug-iphonesimulator to fix a file copy failed error.
    - The build process still failed with this error message
    (null): error: Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target's code sign settings match the parent app's.

    One thing very strange is, in the xcode project's, the Unity-iPhone build target's project information view is missing the General menu tab.( only Capabilities, Build Setings, Build Phases, Build Rules show up)

    If I create the xcode project from Unity Editor without the Simulator SDK flag, then the General menu tab appears.


    Any help or directions for fixing the code signing issue will be very appreciated.
     
  17. lcambiaghi

    lcambiaghi

    Joined:
    Sep 27, 2012
    Posts:
    41
    I have the same problem. I'm not able to setup correctly the x-code project generated by Unity to make it run with the watch kit extension (I don't have any problem in adding an apple watch extension from a non Unity3D project).
    Someone inside Unity could please give us some hints or a step by step guide that explain how to manually do it .

    Thanks
     
  18. Chella90

    Chella90

    Joined:
    Sep 11, 2014
    Posts:
    8
  19. tswalk

    tswalk

    Joined:
    Jul 27, 2013
    Posts:
    1,109
    apple watch...

     
    fffMalzbier and schmosef like this.
  20. Chella90

    Chella90

    Joined:
    Sep 11, 2014
    Posts:
    8
  21. lcambiaghi

    lcambiaghi

    Joined:
    Sep 27, 2012
    Posts:
    41
    yes changing to IOS in project settings (before was iphone) make it works....
     
  22. lcambiaghi

    lcambiaghi

    Joined:
    Sep 27, 2012
    Posts:
    41
    Today I've tested in the UK apple Lab on a real device. All works fine ;)
     
    Chella90 likes this.
  23. lcambiaghi

    lcambiaghi

    Joined:
    Sep 27, 2012
    Posts:
    41
    As someone asked me the steps to make an apple watch app working with unity now I'll explain how to do it:
    -make your apple watch app in a blank xcode project
    -copy the files project in the project folder and create a post build process in python of c# that do these stuff
    *change to IOS from iphone in the project setting
    *add apple watch target
    *copy the files in the xcode project from the unity project folder that cointains our app
    *add all the frameworks that your app needs
    You can do also manually but is quite difficult to redone every time you export the project for ios.
    - apple watch app need 3 identifiers (1 for the app,one for the apple watch extension and one the apple watch app) and the * doesn't works
    Would be great if Unity will do these S*** for us so we have to only copy our project in the project folder and is done :p but for now we have to do by ourself
     
    Last edited: Apr 13, 2015
  24. fluidImages

    fluidImages

    Joined:
    Sep 27, 2013
    Posts:
    29
    Hey guys, I am just getting a blank, black screen - has anyone had that issue? (on the secondary watch screen)
     
  25. lcambiaghi

    lcambiaghi

    Joined:
    Sep 27, 2012
    Posts:
    41
    it is strange...have you inserted something in your interface.storyboard under Watchkit app ?
     
  26. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Actually I like the concept of the Apple Watch. I wanted to design myself one 3 or 4 years ago but have it also look like a regular watch and be able to serve as an emergency beacon using 112 or 911 free cell services, say should I get lost or hurt.

    I have a Garmin CX420 (or something like that) and it is fun to see my activity on the running track or that I walk 2.2 miles to mow the yard.
     
  27. fluidImages

    fluidImages

    Joined:
    Sep 27, 2013
    Posts:
    29
    I did. I do not even see the time? Its quite odd.
     
  28. lcambiaghi

    lcambiaghi

    Joined:
    Sep 27, 2012
    Posts:
    41
    have you changed to IOS in the project setting? The default is iphone and doesn't work with it
     
  29. metalchouchen

    metalchouchen

    Joined:
    Sep 6, 2012
    Posts:
    16
  30. RMGK

    RMGK

    Joined:
    Sep 30, 2011
    Posts:
    75
    Any update?
     
  31. metalchouchen

    metalchouchen

    Joined:
    Sep 6, 2012
    Posts:
    16
    Nop,

    I want to give a try of the Icambiaghi solution but I'm lock at the seconds step.

    I've got absolutely no idea of what does that mean : "copy the files project in the project folder". Is it the folder of the Xcode project ? Where to I have to paste the content exactly ?
     
  32. Chella90

    Chella90

    Joined:
    Sep 11, 2014
    Posts:
    8
    This video has some straight forward explanations....




    I havent tried using plugins to communicate them (kind of stuck there as i am new to using Xcode's App Group and NSUserDefaults )
    This link has some good explanation regarding the plugins that i think should work or go for the plugin as mentioned int he above video
    http://www.jerrodputman.com/2010/01/10/the-unityobjective-c-divide/


    I am using Unity 5 , Xcode 6.2 , and i dont see any blank screens , you can also check whether the schemes are added(both watchapp extension and unity parent app)..
     
  33. lcambiaghi

    lcambiaghi

    Joined:
    Sep 27, 2012
    Posts:
    41

    copy the 2 apple watch folder ( app and extension) in a folder inside your project (not asset or unity will import all the images)

    if is too much complex to do all these step in the postbuild process another solution would be:
    generate the ios xcode project from unity
    add all apple watch stuff
    make it run in a real device
    open the Unity-iPhone.xcodeproj (right mouse button -> show package content)
    copy project.pbxproj
    replace the this file at every unity ios generation (if you change the destination folder you need to parse this file and replace all the file relative path but if you have the same target directory you don't have this problem) and copy the 2 apple watch folder
     
  34. metalchouchen

    metalchouchen

    Joined:
    Sep 6, 2012
    Posts:
    16
    Chella90, it's a cool interaction. But what I wanted to achieve is run the Unity3d in the watch screen, not use the watch as a controller.

    Icambiaghi, thanks for the extra explanation I will take a look. But I've got no iOS device (hardware) for the moment. I've got only a mac mini.
     
  35. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    You cant run Unity there or even mirror it in a way that Apple approves. They don't accept any heavy duty apps yet and the API does not support complex views.
     
  36. Chella90

    Chella90

    Joined:
    Sep 11, 2014
    Posts:
    8
    @metalchouchen you cant do that right now as clearly mentioned by ostwind. If you want to create games i would suggest you to look at Xcode Sprite kit ...
     
  37. mellinsa

    mellinsa

    Joined:
    Apr 16, 2015
    Posts:
    7
    wondering who will be the first one to eat this 'crab'. There will be a great opportunity for iOS developer in next a few months.
     
    Last edited: Apr 22, 2015
  38. jshrek

    jshrek

    Joined:
    Mar 30, 2013
    Posts:
    220
    How do I actually get what is on my iPhone screen to show up on the Apple Watch, to just mirror it?

    I would like to do a little testing in the simulator, but can only get as far as watch simulator running with a blank black screen!
     
  39. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    Any news about a new watchkit sdk with at least accelerometer and heart rate support?
     
  40. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    Few replies above yours just said it's not possible. It could be that first generation of these watches will never allow this based on on the current SDK and other info been flying around.

    No. If not announced at WWDC then estimates are that first generation of these watches will not let normals devs access any of em due battery issues.
     
  41. Nik0s

    Nik0s

    Joined:
    Aug 16, 2013
    Posts:
    9
    Hi Unities,

    I have made this step by step tutorial for implementing the WatchKit api in Unity - you will also find a WatchKitUnity package which includes the iOS plugin and WatchKitUnityManager to setup the communication and listeners required

    http://devgallery.com/unity/watchkit-unity

    Please let me know how you get on!
     
  42. InitoryDad

    InitoryDad

    Joined:
    Jul 3, 2012
    Posts:
    21
    I have download your package, but the prefab file is not available. Which version is your unity? Mine is 5.0.0f4 and 4.6.1f1.
     
    Nik0s likes this.
  43. Nik0s

    Nik0s

    Joined:
    Aug 16, 2013
    Posts:
    9
    Thanks - I should have tested it - I exported the package from 5.0.1f1 - will fix it soon
     
  44. Nik0s

    Nik0s

    Joined:
    Aug 16, 2013
    Posts:
    9
    Fixed - thanks iamjianxin!
     
    InitoryDad likes this.
  45. Muckel

    Muckel

    Joined:
    Mar 26, 2009
    Posts:
    471
    Hey Nik0s,
    respect and many thx for the really nice How To!
    Hope Unity3d will implement it soon because it is not only great for Games also for many App's made by Unity!
    Thank you!
     
  46. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Thanks for this, seems your tutorial is only nice one I can find on net currently.
    Please keep updating and streamline as new findings happen :)
     
  47. Kinnunen

    Kinnunen

    Joined:
    Jan 24, 2014
    Posts:
    2
    I don't understand how you can build this apps. I keep getting
    libiPhone-lib.a(GameCenter.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64

    Now you can't turn off bitcode for xcode 7, since you can't make an archive without it (WatchOS). So how exactly does one get libiPhone-lib.a without GameCenter or at least build with bitcode?

    I tried latest 5.1.2p1 and 5.0.1f1. So far have not found a way to build the Unity project with the watchkit.
     
  48. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Any news on this, when can we expect something?
     
  49. dilmerval

    dilmerval

    Joined:
    Jun 15, 2013
    Posts:
    232
    Guys,

    I wrote a very detailed article about my recent experience in creating a WatchOS companion app for my Unity3d game which I believe to be a great guide for those who want to add a new approach to your game experiences. The guide provides different steps I took and I also explain what worked or didn't work while I was working on it as well as providing source code examples that should give you everything you need to create your own game companion.

    http://www.dilmergames.com/blog/2017/03/29/how-create-watchos-companion-your-unity3d-game/

    If anyone has any questions let me know and I will be happy to help.
     
  50. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    Hey thanks @dilmer thats really awesome!