18

TL;DR: I can run our app in development mode through VS2015 with remote debugging on the iPhone 5c that I have, but I cannot do the same on the iPhone 4s.


I'm having some difficulty getting a Cordova powered hybrid app to deploy on one particular device in my development environment... However I'm unsure if this is something I'm doing wrong or if there's some compatibility issue here. Posting a question here in the hopes that someone can help me work out what's going on.

Just for some background: The app in question was created using Intel XDK, then ported across to Visual Studio 2015 when Intel recently removed some of XDK's "Debug" functionality. A few things needed to be adapted, but the project does still include some of Intel's JS code as it was in the original project.

My environment includes:

  • Windows 10 Pro (primary desktop)
  • Apple Mac Mini with OSX "El Capitan" 10.11.6 (on the network as a build server)
  • iPhone 5c with iOS 8.3
  • iPhone 4s with iOS 9.0.2

While configuring this environment, I followed the instructions here. The remotebuild agent is configured to use http only to keep it simple, since this is all contained within a corporate network anyway.

After this I could run our app on the iPhone 5c without any problems, but trying to run it on the iPhone 4s gives an error in VS2015 stating:

Failed to deploy iOS remote for <project_path>\bld\ios\Debug\buildInfo.json to http://10.66.7.23:3000/cordova: Error from http get [object Object]: Error: socket hang up

Note: There are no errors in the remotebuild console output on the Mac and VS builds the project correctly, but then fails to deploy it.

I've also tried multiple Provisioning Profiles on both devices, installed using iTunes, Xcode or Apple Configurator 2; but thanks to the provisioning profiles not showing up on devices with iOS 8 or newer, I can't even verify that they're installed at all.

Both of these devices can install and run the previous version of this app (available in app stores), but I need to be able to inspect the DOM in real-time, because even though they have the same screen size, the responsive break points are behaving differently.

So, before I pull out what little hair I do have left, please could somebody help me work out what the hell is going on here?? I've been fighting with this for over a week now and I feel like I'm going round in circles.

  • There is a problem on remote machine where another user is logged in, but the user need to build has no active session. This is the socket hang up part. Let me know if this is your case. – ares777 Feb 13 '17 at 07:41
  • Why do you have to do remote debugging ? is it an obligation ? – Ryad Boubaker Feb 13 '17 at 09:38
  • @user3344236, I'm sorry to say I don't understand what you mean by that: the Mac is sitting on my desk next to my Windows machine and I'm the only person using either one at the moment.. –  Feb 13 '17 at 12:52
  • @Ryad, this is unfortunately needed because of the way the app was initially designed (I've been told I'm not allowed to rewrite it), so the only way I can see any of the important views in our app is to have it running on the phone with a bluetooth connection to our own proprietary hardware: no mock data sources here. This means I need to be able to inspect the DOM directly while it's running on an iPhone. :'( –  Feb 13 '17 at 12:55
  • @ZaLiTHkA i may not be able to provide solution to your issue as i dont have hands on this setup. But after some search the pointers i could give you is, "sockt hang up" error is thrown when there is no response from the server. Secondly, it may not be working in iphone 4 as it uses iOS9 and some security policy may result in this issue. Is it possible to upgrade iphone 5s to ios9 and test once? Thats all i can help for now. Sorry – Gandhi Feb 13 '17 at 13:05
  • @Gandhi, thanks for the tip. I'm hesitant to upgrade this since it's the only iOS 8 device I have at the moment; my boss has asked that I refrain from updating or jail breaking this 5c until the contract is renewed and we get a replacement phone, but my hands are tied until that happens. –  Feb 13 '17 at 13:46
  • @ZaLiTHkA Could you try it out on someother device that has iOS9 so that we can narrow down the issue atleast? – Gandhi Feb 13 '17 at 14:57
  • @Gandhi, I've literally just got home (GMT+2 over here), so I'll see what I can find at work first thing in the morning. –  Feb 13 '17 at 15:06
  • @ZaLiTHkA Thanks for the update.. take care.. – Gandhi Feb 13 '17 at 15:35
  • @ZaLiTHkA Could you get a chance to test it on different iOS9 device? – Gandhi Feb 16 '17 at 05:16
  • @Gandhi, apologies for the delay, where I am in SA we've been affected a bit by tropical storm Dineo and my house has almost been flooded twice in the last few days. I'll try find another device today to test with and let you know what happens. –  Feb 16 '17 at 05:47
  • @ZaLiTHkA Feel sorry for your state. Do take care – Gandhi Feb 16 '17 at 06:42
  • @ZaLiTHkA Also i could see one issue similar to this - https://github.com/Microsoft/TACO/issues/126 finally ended up in using workaround – Gandhi Feb 17 '17 at 15:08
  • @ZaLiTHkA You may also have to look at this - http://stackoverflow.com/questions/34220247/visual-studio-2015-hangs-on-deploying-cordova-application – Gandhi Feb 17 '17 at 15:21
  • @ZaLiTHkA, can I ask a 'basic question'? Can you deploy "hello world"-ish builds from the mac to the iphone 4s? – Larry B Feb 18 '17 at 00:03
  • @ZaLiTHkA Have you tried the Mac Safari Web Inspector? I described a workflow in an answer here: http://stackoverflow.com/questions/39039537/cordova-app-on-ios-device-cannot-debug-from-visual-studio/41080587#41080587 – pprchsvr Feb 18 '17 at 15:39
  • @zalithka hi, any updates? Bounty period running out... – Gandhi Feb 19 '17 at 12:28
  • @Gandhi, no news as yet unfortunately, still trying to get my hands on another iOS device. Due to a bunch of silly delays on my side, I'm going to add a new bounty again when this one expires. I (by choice) don't have access to any Apple devices at home, so this is something I can only do while I'm at the office. –  Feb 19 '17 at 13:07
  • @zalithka thanks for the update once again... Do keep the bounty alive and take care. Awaiting updates to narrow down the issue. – Gandhi Feb 19 '17 at 14:24
  • @ZaLiTHkA Nothing more than the OP's happiness. Try `4s` with `ios 7` as per gandhi said. Because `ios 9` does not support `4s` – dahiya_boy Feb 20 '17 at 06:24
  • @the_dahiya_boy, could you provide a reference for that? By my research, the 4s is listed as supported by iOS 9, as well as the 4s showing updates available to 9.3.5 (currently on 9.0.2). Besides, is it still even possible to install iOS 7 these days without jailbreaking the device? –  Feb 20 '17 at 06:36
  • @pprchsvr, the issue here is not that I can't inspect a running app, it's that I can't get the app to deploy, so unfortunately that question doesn't help me much. –  Feb 20 '17 at 06:38
  • @ZaLiTHkA As this topic is of higher level. So less developer have deep knowledge about that. As I also have less knowledge about this. So I put some links on the answer because its too lenghty to write here. May be it helps. So some said its all for bounty so I delete my answer bcz nthng more than OP's happiness. And sorry to hear about your state. Take care buddy. – dahiya_boy Feb 20 '17 at 06:39
  • @LarryB, I just created a new blank Cordova app through VS2015, got all dependencies downloaded and copied relevant details from another project's `build.json` file - unfortunately I get exactly the same behaviour with a blank app. I'm now starting to wonder if there's something wrong with this iPhone specifically.. –  Feb 20 '17 at 06:59
  • @ZaLiTHkA As i keep repeating, you gotta test it out in different iphone device running 4s to narrow down the issue – Gandhi Feb 20 '17 at 10:30
  • I'm doing the best that I can to get my hands on other iOS devices, but it feels like trying to get water out of a rock.. About an hour back I finally managed to get hold of an iPad mini running iOS 9.3.5, but for all my begging and pleading with management and work colleagues, this is all I have so far. –  Feb 20 '17 at 10:52
  • @ZaLiTHkA were you able to narrow down the issue? the bounty is gone :( – Gandhi Feb 21 '17 at 07:44
  • (repeated question) @ZaLiTHkA, can I ask a 'basic question'? Can you deploy "hello world"-ish builds from the mac to the iphone 4s? Also, is the 4s listed as developer device on http://developer.apple.com? – Larry B Feb 21 '17 at 15:41
  • @LarryB, if you check a few comments back, you'll see I did actually try that and reply to your question.. Unfortunately I got the exact same results with a fresh VS2015 Cordova project. The device was also included in our dev account and a new wildcard provision profile created and installed to Xcode on the Mac Mini. –  Feb 21 '17 at 15:48

2 Answers2

0

After all this backwards and forwards with the iPhone 4s, it turns out the device itself was actually faulty. Somehow this had translated to having a version of iOS that was not installed correctly, which resulted in software issues for apps running on the device.

This was not immediately apparent to us because of the unfortunate lack of devices we had access to for testing, but since I managed to get my hands on an iPad Mini with 9.3.5 and an iPhone 6 with 10.2.1, we've managed to verify our app's compatibility with the newer OS versions.


Anyways, in closing I just wanted to say a massive thank you for all the suggestions and ideas I got in the question comments (especially @Gandhi, sorry about the bounty story, I still feel like you deserve that just for being so helpful).

Despite the fact that my particular issue was not something that could be resolved here on SO, I have still learned a great deal during this process and I am so very grateful.

  • I m glad that you resolved the issue. As expected the device was culprit. Big miss on the bounty. Take care – Gandhi Feb 23 '17 at 04:54
0

Even the answer is already posted by the Questioner himself, I m still posting mine for the benefit of others.

When a build deploys fine on one device running on iOS 8 and not on the one running on iOS 9, it could either be problem with iOS version due to the security changes or it could be the device compatibility problem.

In such case, the quick way to narrow down the problem is to test the build on other device with the same version (iOS 9). But unfortunately in @Zalithka's case he dint had device to test. But if someone encounters such problem, try out in different devices to narrow down the problem quickly and nail it.

Gandhi
  • 11,875
  • 4
  • 39
  • 63