Xcode Watchkit no executables in Edit Scheme - ios

I am trying to create different schemes in Xcode for the Watchkit app - one for Notification and one for Glance.
When I duplicate the Watchkit scheme, and then go to "Edit scheme", to change the Executable in the Run tab, there is only the main executable there, and not the one I just duplicated.
I tryed everything.
Any ideas?

In the latest beta of Xcode 6.2 WatchKit automatically creates the Schemes for Glance and Notification.

In the Edit Scheme Window, click on the Run icon in the left panel. Next, look to the right panel and where it says "Watch Interface", click on the word "Main" and change to the appropriate option.

You have select watchkitInterface and you will see static, dynamic notification and glance in that.

Xcode Schemes manage build targets. Apple Watch Notifications and Glances are not created as separate targets.
They are designed with Glance Interface Controller and Notification Interface Controller objects on your Storyboard within your WatchKit app, and supported with code in your WatchKit App Extension (and potentially elsewhere, for the source of notifications).
Therefore, they cannot be managed with a build scheme. May be useful to review what you were you trying to achieve functionally with this action. There may be another way to achieve it. If, for instance, you want to have just a Glance or Notification interface without having a WatchKit App, you simply create a Storyboard in your WatchKit App that only includes Glance and/or Notification Interface controllers, and not a standard WKInterfaceController. The Apple Watch will do the rest.

Related

Remove 'Embed watch content' on the basis of a scheme

We are creating a companion watch app for our mobile applications. We have created two different mobile apps from a single codebase and a single target by using different schemes.
But we want to release watch only for one of the mobile apps.
So is there a way to remove 'Embed watch content' on the basis of the scheme or some script/pre-action that can be executed while compilation per the scheme for removing watch content?
Any help would be appreciated.
Answering my own question, I believe there is no way to separate out this on the basis of the scheme. Schemes are associated with a target.
I created a separate target and made it mobile app only. Applied the corresponding theme on them.
Separate target gives you the capability to modify build settings as per need.

Are voice shortcuts for custom SiriKit Intents supported on watchOS?

I’m trying to get a voice shortcut for a custom Siri Intent working as part of an Apple Watch app, but I’m not sure whether that’s possible. Has anyone had success with this or know if it’s supported?
There isn't much code to share in this case, since most of the code is auto-generated by Xcode, but here’s a quick overview of how I have everything set up.
I created a custom Intent with a .intentdefiniton file and separate Intents Extension targets for my iOS app and watchOS app to handle the Intent.
I set up and donate the shortcuts at the appropriate time. I included an INUIAddVoiceShortcutButton in my app so a user can easily add or edit a phrase for the shortcut.
Everything works fine on an iPhone: the shortcut shows up at relevant times throughout iOS, and the Intents Extension in my iOS app handles the shortcut when I say the invocation phrase to Siri.
Since 20% of my app’s users use the Apple Watch app, I want to provide a congruent experience on watchOS. The donated shortcut shows up on the Siri watch face, as expected. I trigger the shortcut from the Siri watch face, and is handled by the Intents Extension that's part of my watchOS app.
When I say the intent’s invocation phrase to my Apple Watch (Series 3 GPS-only), however, it doesn’t work. Siri says:
Checking with the app...
Then a few seconds later:
I do not recognize that command.
I’ve tried this with a separate Intents Extension for my watchOS app, and without. I get the same results in both situations. It works on the simulator, but not on a real device.
I’ve also made sure I have my Watch Extension and Watch App selected under Target Membership for the .intentdefinition file.
I’ve also tried going into Settings > Developer and enabling Display Recent Shortcuts then tapping Force Sync Shortcuts to Watch, but that doesn’t change the behavior.
Are voice shortcuts for these custom intents even supported on Apple Watch? I haven’t been able to tell one way or another with Apple’s documentation. The SoupChef sample project is set up with an Intents Extension for the watchOS app, which makes me think it should be supported. And, since it works on the simulator, that makes me think it should be supported.
However, this page doesn’t list custom intents as being supported on watchOS, so that makes me think they may not be supported: https://developer.apple.com/design/human-interface-guidelines/watchos/user-interaction/siri/
If anyone can help me figure out whether this is supported I’d really appreciate it. I’m not sure if I’m doing something wrong or if this just isn’t supported.
The problem was on my Apple Watch.
I was able to get it working by erasing the watch (Settings > General > Reset > Erase All Content and Settings) then restoring it from a backup.

Sirikit launching the app fully instead of showing in own scroll

I have just created single view controller app and adding targets with Siri extensions( intents and intent ui extension).
But when I say Siri command to start the intent it just launching the app instead of showing in Siri view itself. Since I have started exploring Siri please let me know the issue and if any tutorial I can go through
I had the same problem. The bug was that the extension's plist contained the wrong entry in NSExtensions->NSExtensionAttributes->IntentsSupported – obviously the default Xcode actions are incorrect.
What you need to state there are the actual class names of the intents you handle, not their names as per the intentdefinition file.
Disabling 'copy only when installing' under Embed App Extensions in main target build phases fix the issue for me.
You should follow these steps:-
Add intents and intentsUI(if you need to customize default UI) as
extension
Override the Intent handers
Mention your intents in info.plist
Allow app to be accible by siri in phone settings
The best way to start is to go thru the SiriKit Programming Guide
Also, you can get some sample code from Apple here

How can I test my iOS application, using Xcode, in another language without changing my language preferences on my iPhone?

I have an application that I would like to test in another language. Using Xcode is there a way to test the application in another language without changing my language preferences on my iPhone?
It is very simple. In Xcode go to menu "Product" and Alt + click on "Run..." menu item.
This will open schemes. On "Run" scheme open "Options" tab. Select "Application Language" and Run.
Well, not really I guess. The only other way is to implement the whole language choosing possibility by yourself, i.e. give the user (or just yourself as developer) the possibility to change the language manually. But that's really a lot of overhead and you'll probably not want that.
There is no quick other way of doing so I'm afraid :/
You can create instances of the simulator with Xcode 6.1 (windows->devices) , see attached ss.
So, create a iphone-language version. This new 'simulator' is now available in the drop down list of devices when you build and run. Run in that new target device. When your app start, you should see the proper simulator in the window banner as here :
Now go into settings and set the language to your desired target. Should work, but have not tested with an actual multi-language app myself.

In-app preferences screen in an iOS 7 app

I'm fairly new to iOS development and I am porting an Android app to iOS 7. The Android app provides a screen that allows the user to change a number of non persistent settings. Because these are not saved, it doesn't seem appropriate to me to expose them, on iOS, as preferences via a settings bundle and the built-in Settings app. So I'm looking at an in-app settings screen, which I understand is allowed - but perhaps not encouraged - by Apple.
Some questions:
Am I correct that an in-App approach is allowed by Apple? Most example code seems to use settings bundles. Am I going to have problems when the app is submitted to the App Store?
I can put the settings UI in a simple UITableViewController, but is there an approved way to expose this to the user? XCode 5 doesn't provide a settings identifier (and icon) for toolbar buttons, and the "Info" identifier (letter i inside a circle) seems to have been dropped too. Should I use a custom icon? Are there any de facto standards?
I haven't seen this kind of UI element before on iOS but my exposure to the platform as a user is limited.
There is nothing wrong with doing an in-app preference (table)view. You won't be rejected for that (this point seems to be way too much exagerated outside the iOS community). There are guidelines that you can follow: iOS Human Interface Guidelines... or not. As long as you don't use private APIs (assuming you know how to access them anyway), you're fine! So you can use a custom icon, the "i" button, or any UI element that convey the reasonable meaning of providing access to more info/preference.
In your code, you can use the class NSUserDefaults (with the standardUserDefaults) to store your preferences.
Many apps have in-app settings. It's fine. Apple even states that it is fine. Just don't have both.
Use a custom icon. Many apps seem to use an icon that looks like a gear.

Resources