Showing posts with label iOS. Show all posts
Showing posts with label iOS. Show all posts

Thursday, May 7, 2015

I Just Want to Run my Watch App in the Simulator!

I spent the better part of a day and a half trying to add a Watch app to an existing iOS 7 project and run it in the simulator, but ran into two primary problems. First, the repeated appearance of the SPErrorInvalidBundleNoGizmoBinaryMessage error and second, the “Waiting to attach” message in the Xcode Debug Navigator. This seems to be happening to lots of others as well. Let me outline what worked for me in the hopes that it saves you from spending as much time as I did on this.

Note that this pertains to using Xcode 6.3 with an iOS project having a deployment target of iOS 7.0. If your situation is different, this may not help you at all.
  1. Select the project target of your iOS app. Go to the General tab. Make note of the version and build values there.  Select your WatchKit Extension target and your WatchKit App target and set them to be the exact same values as the iOS app. If the version is 1.2, set the version for all three targets to be 1.2, If the build is 32, set the build for all three targets to be 32.
  2. Select the project target of your iOS app. Go to the General tab. Make note of the team setting. Select your WatchKit Extension target and your WatchKit App target and set them to be the exact same value as the iOS app.
  3. Select the project target of your WatchKit App – NOT the iOS app, NOT the WatchKit Extension. Got to the Build Settings tab. Find the iOS Deployment Target setting. Set that to be iOS 8.2. I’m not clear on the reasons, but it CANNOT be iOS 8.3. The extension can be set to 8.3, but not the app.
  4. Select the project target of your WatchKit Extension and then your WatchKit App. Both of mine showed warnings for my provisioning profile. In my previous attempts to get to this point, I had created new App IDs using the bundle identifiers Xcode created in the Member Center. Xcode then created provisioning profiles on its own. I would suggest you create the App IDs, got to the Build Settings tab and set your Provisioning Profile to be Automatic, quit Xcode, re-launch Xcode, open the project, build, and hope that this voodoo dance gets you what you need. You may need to refresh provisioning profiles Xcode has, but I did not. 
Now, at this point I could run the iPhone 6 8.3 simulator and see the time and charging icon in the top-right corner of the Watch simulator. BUT, if I switched to one of the 8.2 simulators, specifically the iPhone5s 8.2 simulator in my case, THEN I started to see the “Waiting to attach” message in the Xcode Debug Navigator, where it sits indefinitely.

To recover from this problem, sometimes I had to reset the simulator and do a deep clean (Cmd + Shift + Option + K) and sometimes I just needed to switch back to the iPhone 6 8.3 simulator.

I honestly don’t know what new issues will come up as I try to test on a real device, but this at least got me to the simulator.


Saturday, June 7, 2014

jQuery show() and hide() Don't Seem to Work with jQuery Mobile

That's not entirely true. Chances are you're running into this type of situation.

I was trying to hide a set of ui-block-* elements in a JQM grid when the user tapped a button. On the same set of ui-block-* elements, my media query for an iPhone was setting display: block !important. When the user would tap the button the elements would animate to hide but then suddenly re-appear.

This was not a problem on an iPad or in a desktop version of Chrome. But on the iPhone (iOS 6 and 7 at least), the !important directive was winning -- was dictating the final display.

That !important directive was unnecessary in my case, so when I removed it the calls to hide() and show() began working as expected.

Sunday, February 5, 2012

iOS, Private Browsing, and the HTML5 Application Cache

This problem makes sense, but it caught me off-guard during debugging.

If you have a web application that uses the HTML5 Application Cache feature, the cache will not function properly with iOS Safari's Private Browsing setting on. The various JavaScript snippets that help with debugging will catch the most general error, which doesn't tell you much.

So if you have an app that seems to be caching properly in your desktop browser but not your mobile device, be sure to check your privacy settings!