watchOS2 and NSLog on device - watchkit

I am using XCode 7 (beta) to write standalone watchOS2 App Extension.
Debugger works fine, so I can use breakpoints for example, but seems to be that NSLog() is not working for the Watch. Note: It works fine on simulator, but doesn't work on device
Whatever I write to NSLog(#"..") is not displayed in Debug Area.
So the question is:
Is this behavior expected or am I doing something wrong? Are there some workarounds to see some debug logs, may be use WatchConnectivity for example?
Thanks in advance!

Until NSLog() works on real watchOS 2 devices I've ended up using -[WCSession sendMessage:replyHandler:errorHandler:] to send log strings from my watchOS 2 app back to my iOS phone app and then NSLog them from my phone app.

Did you try this one?
It's a known issue on developer forum.
You have to unpair and re-pair your watch to trust your computer.
Then you could see NSLog in Debug area.

Related

Xamarin Forms - iOS debug on actual device hangs on launchscreen. Workin on simulator

I have a XF app already published on the play store and now I am targetting iOS. During developpent I made sure the app was still working on iOS, using the simulator only.
On the simulator everything works as expected, the launch screen is shown then the MainPage starts. But when I debug on an actual IPhone device, the app get stuck on the Launchscreen.storyboard for about 20 sec then the app exits. I've no debug output and it seems that the AppDelegate is never hit. Breakpoints in AppDelegate.FinishedLaunching method are not hit for instance. I tried to F11 for start in debugging mode but I don't hit anything, still hanging on the launch screen. I was expecting the transition from simulator to device to be less painful.
My plist file contains the following permission requirements
...
<key>NSLocationAlwaysUsageDescription</key>
<string>We need to use your location</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>We are using your location</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs access to photos.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app needs access to the photo gallery.</string>
The only difference I saw is that location permissions are not asked on the device while in the simulator it asks for it at start. But this might be related to the fact that I can't reach AppDelegate, I am not sure yet.
The iOS project was generated via Prism templates. I am using VS 16.8.0 on Windows, XF 4.8.0.1687, Prism 8.0.0.1909, Xamarin iOS SDK 14.4.1.3 and I am set to "don't link" for linkers option. The device is an Iphone 10.
Any idea how can I find out the root cause - or get some useful logs?
Thanks in advance for your help.
EDIT:
Here are the device log output during a new installation https://taits.s3-eu-west-1.amazonaws.com/devicelogs.txt. I am trying to go through them but kinda lost.

Firebase and Swift 3

I have searched around and have not found the particular answer that I am seeking for. I just went and updated my App to a Swift 3 Language from swift 2. It obviously threw out a host of errors which I went through and fixed to the best of my abilities and now I do not have any errors. I can run the app but I cant tell if anything else is working because the Login or Auth sections of the app are not working. I know that I can just bypass to test but I have been working on it a lot and trying to get this feature to work that worked well before the language was changed..
Very simple my question is this:
I upgraded to Swift 3. Do I need to upgrade the cocoa pods to support the change in language? If not is it just an issue with the way that my code is and because of the change to swift 3 that i need to keep tinkering with?
Thanks for any help
sorry posted that about 12 hours to early. After doing a lot of research it looks like I found the answer. have not tested yet but I think I am getting the same errors in the compiler.
"We've noticed what seems to be an issue with the latest iOS 10 simulators (up to beta 6 at the time of this writing) that causes Firebase Auth to throw an error due it to not being able to write values to the keychain. This issue does not affect real devices." This is from a Firebase Blog
Hello I got this problem on the device and not on simulator, my device is iOS 9.3.3 and the strange thing is that when run from xcode it works just fine
But when I open from device after stopping debug from xcode, the error will occur
And after some digging, I found out that if pod is only using firebase, it connect just fine even opening from the device
But if I add just 1 pod, it will error like above, so I don't really understand what is going on
And yes already try using keychain sharing
Any tips?
Edit: it works fine on other devices running iOS 8.1

URLForUbiquityContainerIdentifier never returns on iPad Air 2 running iOS 8.1

I have a new iPad Air 2 running iOS 8.1 that I am using to test my app.
The call to URLForUbiquityContainerIdentifier never returns.
I installed iOS 8.1 on my iPhone 5s and everything works as expected.
I am thinking there may be a bug in iOS 8.1 for the iPad Air 2 but I am not sure. I noticed that in Settings for iCloud that Documents and Data wasn't even listed, and I signed out and signed back in and Documents & Data showed up in settings. That leads me to believe that this might be an iOS bug.
But in case it is not, is anyone else had the call to URLForUbiquityContainerIdentifier never return? If so, what did you do to fix it?
This is a Core Data app using iCLoud storage for an sqlite data store.
I call ubiquityIdentityToken before and it retuns a non-nil value, so iCloud is available.
NSURL *cloudStoreURL = [fileManager URLForUbiquityContainerIdentifier:#"XXYYZZ.com.yourcompany.appname"];
A user emailed me and said it suddenly started working for him. I just ran my app with no changes and everything works as it should. I do not know why it is working, but something changed somewhere, my guess is Apple changed something.
I've seen the same issue recently for one of my apps. It never occurred directly for me but it has occurred for Apple during the review process. However, it happened only for one of my apps. A second app with the same code never showed the issue for myself or for Apple. I have contacted DTS regarding the problem. If I get a solution I'll post it here.

iOS Simulator keeps asking for an app to simulate

I only use the iOS simulator for testing websites, not actual apps. Today I opened it up and it keeps asking me for an app for it to simulate. If I click cancel, it just quits the simulator.
I've tried deleting preference files, but I'm just not familiar enough with the simulator to know what's going on. How can I just get this back to normal, or satisfy this dialog?
I think you could try the menu
iOS Simulator -> Reset Content and Settings...
This would clean your simulator storage.
Update
According to this link, Cleaning up the iPhone simulator
move to path
/Users/<username>/Library/Application Support/iPhone Simulator/{6.0 / 6.1}
You could try to clean it manually

iPhone app crashes from Finder

I've written an iPhone app and only tested it with the simulator as I don't have an actual iPhone. If I Build and Go, I can see the app running. But if I go to Finder and then open it through the project's build folder, it just crashes immediately. Does anyone know the reason for this?
It crashes because double-clicking it causes Mac OS X to try and run it as a Mac app. It's got the same structure as a Mac app, and it's an x86 binary, so why not? But the iPhone app tries to dynamically link UIKit, fails to do so, and crashes. The simulator sets up the iPhone app's environment so that the linking succeeds. You could probably do this at the command line with careful use of environment variables, but the Finder doesn't do so.
Finder won't launch the simulator correctly. XCode is the only supported way to launch the simulator as far as I know.
So Tom, if I wanted to send that binary to a friend, what are the instructions for opening it?

Resources