watch connectivity works on simulator but not real device, iOS9 Xcode7 - watchconnectivity

My watch connectivity is working with my simulator but not my real device (iPhone and Apple watch).
I have no error messages.
Are there any settings (eg on my Xcode I needed background settings) which I need set on my devices?
Any ideas?
Thank you

Related

How do I run my application from xcode on Apple Watch?

I am trying to run my first WatchKit application on Apple Watch (watchOS 7) from latest XCode (12.0).
I can select emulator as a destinantion, but I have no idea how to add my real watch to the list, so I can start testing on a real device.
I have iCloud account, and it seemed sufficient to run iPhone applications, but not Apple Watch.
How do I make it work?
Ok, I am not the sharpest tool in the shed.
Apart from assigning a proper Team to the Project, make sure you have your iPhone (to which the Apple Watch is paired) connected to your Mac via cable.
The "connect your iPhone using cable" was not thet obvious to me. I assumed it got the device from iCloud account.

Xcode fails to install watchOS app onto Apple Watch device

Xcode "Run" operation fails to install a watchOS app on a real Apple Watch device with error description:
The host is not paired with the device.
Context:
First time ever trying to install a watchOS app from Xcode onto an Apple Watch device for testing/debugging
The watchOS app is an official Apple SwiftUI tutorial example
Assume latest versions of MacOS, Xcode, watchOS, Watch device, etc.
The selected scheme is the watchOS app target
The selected device is "[my Apple Watch name] via [my iPhone name]"
The Apple Watch is in fact paired with the companion iPhone, despite what the Xcode error says
The Apple Watch has not yet trusted this particular Xcode, Mac, developer account, or app. The Apple Watch should have received a "trust/don't trust" notification, but did not; this may be a bug on Apple's part.
However, we can force the notification to pop up by simply restarting the Apple Watch device. The Watch should receive the notification immediately upon restarting. Click "Trust" in the notification on the Watch. Then retry, from Xcode, the "Run" operation. The watchOS app should now install OK on the Apple Watch device.
What needs to be done is restarting both devices, iPhone and paired Apple Watch, connect iPhone to computer with cable. When the trust/don't trust notification appears on the Apple Watch or iPhone obviously choose 'trust'. Then the app will install again.
What it stops from running on your watch sometimes is if you have a simulator debug session open still. It says it can't install because there is another debug session running (but not on your watch..)! Closing this simulator session will allow you to install on your watch.
Other times xCode is building fine and thinks it's running the app on your watch, but it runs an old version and you don't see any changes made. Then you have to delete the app from your Apple Watch.
What also sometimes stops it from running on the Apple Watch are in Xcode the Preferences->Accounts->Profiles. Installing them manually will help in that case.
If nothing works uncouple your apple watch from your iPhone and recouple again.
Why isn't this still been resolved? I see people complaining about it for several of years now. Is this bug only related to standalone apps?

Swift sample code compiles but does not connect to Phantom 4

I've successfully compiled the Swift sample code onto my iPhone 6S, however, the status continues to remain in Trying to connect. I'm able to connect with the DJI app itself so it must be something to do with the code or some configuration. Any tips? Also, is there any way to connect to the Phantom with the iOS simulator or is it necessary to compile onto the device to be able to connect to the remote?
OSX: El Capitan 10.11.6
iPhone 6S with iOS 11.0.2
XCode 8.2
You should read the bridge app tutorial
http://developer.dji.com/mobile-sdk/documentation/ios-tutorials/BridgeAppDemo.html
so that you can run your app from the iOS simulator.
As to connecting with iOS 11.0.2 - if you open your app, then un-plug and reconnect the USB cable with your app in focus, how does it go? Some issues are being seen with multi-tasking apps into the DJI remote controllers, and it's an issue that is being worked on.
Hope that helps!
You might have to plug the lightning cable into the phone after the application has already launched, then your Phantom 4 will appear.

App only crashes in certain devices ios8

So I recently had my app rejected by Apple. This is what they said:
2.1: Apps that crash will be rejected
----- 2.1 -----
We found that your app crashed on iPad running iOS 8 and iPhone 5s running iOS 8, which is not in compliance with the App Store Review Guidelines.
Your app crashed when we:
tapped on various menu items
If you have difficulty reproducing this issue, please try testing the workflow as described in Testing Workflow with Xcode's Archive feature.
I found it confusing why the app was only crashing on certain devices, especially the iPhone 5s. Since I don't personally own a 5s, I have been using the simulator and cannot recreate the crash. On the iPad retina simulator the app crashes when I press menu buttons and Xcode tells me the offending line is in the viewdidappear method of the view being segued FROM:
if( adBanner != nil )
{
adBanner.removeFromSuperview()
adBanner.delegate = nil
adBanner = nil
}
My questions are: How can I recreate these crashes on the iPhone 5s? How can I possibly fix this bug on the iPad or do I even need to? I assumed you could submit an app optimized to run on only certain iOS devices and that was determined by which devices you submitted screenshots for. Do I need this app to work for iPad or is there a way to just not publish it for iPad?
Mine was not also for ipad, but Apple still tested for that anyway.
I had the same issue. I was reproducing the issue on my ipad 2 when the project options is set to "link all assemblies" on my Xamarin project settings. The issue was not reproduced and the app on my ipad was working fine when I change options to only "link SDK assemblies only." This has been the reason with another app I published.
I'm going to try republishing the app again with that change in setting and hope for the best.
How can I recreate these crashes on the iPhone 5s
An iPhone 5c might reproduce the issue, but your best bet is to use an iPhone 5s. The simulator cannot possibly match behavior of the device when it comes to timing and memory characteristics.
You might be able to use guard malloc or NSZombies to find some issues related to memory mismanagement, so I suggest you try that out in the sim or on devices you own.
Do I need this app to work for iPad or is there a way to just not
publish it for iPad?
You can build an iPhone-only app that will be run in compatibility mode on an iPad, but there's no way to prevent someone from running your iPhone app on an iPad.

How to test the iPad app in iPad hardware (not in simulator)

After I'm done with build and test on iPad simulator, I need to test the app on iPad hardware.
How can I do that?
If you've paid for a developer key, you should be able to open the Organizer window, set up your device, and then select the device rather than the simulator as the target in XCode. See Apple's documentation for details.
If you haven't and won't buy a developer key, you'll have to jailbreak your device. In that case, the answers to How can I test my iPad app on my actual iPad? may help you.

Resources