CocoonJS for iPhone (NOT iPad) - ios

I've already spent two weeks trying to figure this out, and I'm unable to get it working... I made an HTML + Javascript game intended to work on both Android and iOS devices, so I used Ludei's CocoonJS (https://www.ludei.com/cocoonjs/) to compile the project and generate two projects: one for Android and one for iOS.
I've already successfully uploaded the Android project, which is available at the PlayStore and works well on different devices, but I'm heaving REALLY trouble with the iOS one. The problem is that, somehow, when I upload the project using XCode, it is understood as being a universal application, though it is only intended for iPhone devices. Due to this, Apple keeps rejecting it, as the game's screen doesn't adapts to the iPad screens.
As I don't want the game to fit iPads, the "only" thing I have to do is to upload the game specifying that it only is intended for iPhone devices... But such a trivial thing begins to seem impossible after days and days of fails.
What I've tried doing:
CocoonJS doesn't let you specify a device family, so it seems that the XCode project it compiles is intended to be universal. However, before uploading the app via XCode, you can change its "Build" attributes.
I've ensured one time and another that every option within the "Build" and the "Info" list points only at iPhone devices with iOS 7 (and not iPads nor universal).
I've tried creating multiple projects on iTunes Connect to ensure that the whole process doesn't get messed with a previous universal binary or some other bizarre things.
I'm only uploading screenshots for the 3.5 and 4 inches screens (iPhone 4 and iPhone 5).
What I'm ALWAYS getting:
An issue just when the project finsihes uploading saying that a localized screenshot is missing... I've searched over the net and it seems that this message may refer to various things, among them the fact that a supported device has no screenshot... Guess which one: iPad, I suppose!
The scariest part of everything is that when I open the details of the binary uploaded to iTunes Connect it shows a line:
Device family: iPhone / iPod, iPad
What the...!? What's the iPad doing here? I've tried almost everything and I'm not even to solve this... Maybe I'm missing something on the XCode "archiving" process, or I'm missing something on the iTunes project creation process... or maybe I'm missing something relating CocoonJS... I just don't know what else to do!
Anyone found something similar or can guess what can be happening?
Thanks in advance for your time and effort! :)

I faced the same issue recently while uploading a game created with CocoonJS. The problem is that CocoonJS uses the info.plist for most of the settings and configurations. So, while looking into the plist, I found the issue.
There's an entry in the plist called UIDeviceFamily which overwrites the device selection in build settings. It's an array containing two values, 1 and 2. 1 denotes iPhone and iPod while 2 denotes iPad. So just delete the second entry (2) from this array and you should be good to go. You can read more about it here.

Related

Regarding App slicing feature in iOS9

One of our old project is now updated to XCode 7 and iOS9 SDK. Some of the images in the project is missing #3x versions and since we have a critical bug we need to submit it soon. We were testing our AdHoc build by
"Exporting one app for all compatible devices" - It is working fine.
What I want to know is, will App Slicing create problem if I dont have #3x images? Is there a way to turn it off?
Meanwhile I am trying hard to get all the 3x images
Okay, This is what happened,
I submitted the App without some of the 3x images.
App got approved.
Released in production, no issues so far related to images.
But one thing I noticed was that the slicing didnt happen. The Universal App size was 65MB and now also for every device it is showing 65MB in the AppStore, so i am confused whether the slicing happened or not.

Xcode 5.1 very slow to build and run on iPad Air

While using Xcode 5.1 to deploy our iOS application I am seeing quickly build and say "Running on iPad Name" but it doesn't launch the application for a little over 7 minutes. When I tap on the status bar at the top for more information it says "SandboxingApplication."
This does not happen on other iPads that we use with the same application.
Any ideas? I've tried all the basics like restarting the device, Xcode, and my computer.
You already said it:
This does not happen on other iPads that we use with the same
application.
That's the point, you'll have to reinstall the iPad. Some time ago I had a iPhone 3GS for testing on which it sometimes also took minutes to launch the app. Xcode behaved like what you described, showing "Running on DeviceName".
But although this iPhone is older it hadn't been always this slow. After I restored it from iTunes it again was pretty much faster.
Finally with the help of #flowmachine1 this is solved! It was fixed by:
Deleting Derived Data
Clean Project
Delete App and Reinstall
Thanks so much!
It could be really any issue, but here are some troubleshooting tips.
Restart Xcode and iPad (You already did it)
Try to create a new Project, and try to run it on the iPad Air (Let me know the comments below what happens)
Reinstall Xcode (Most common fix)
Also report to Apple, if none of those fixes work, https://developer.apple.com/bug-reporting/.
Thank you.
I've nailed down one cause, for my situation at least. The app's sandboxed area is huge (gigabytes) as it contains a large amount of resources (as discussed here). Wiping out these resources prevents the delay in the sandboxing process (with the unfortunate side effect of rendering half of the app unusable).
I can only assume that, as part of attaching the debugger, some processing of each file in the sandbox has to occur every time, and it is this process that is taking the time.
The resources are in the application support directory. If anyone knows of a way to mark or relocate these files to improve the speed of the sandboxing process I'd be very interested to hear (and would award the bounty).
Well, I'm running apps on an iPad Air here and it runs in just a few seconds, using Xcode 5.1 and Xcode 6 (beta 4). So, I'd guess three possibilities here:
Your Mac's HDD is failing, or your app is very large (having GiBs of files OR thousands and thousands of small files). You already said your app has 27MB, so size shouldn't be the issue here. Unless you're talking about a 27MB .ipa file, which is compressed. If your IPA contains 27MB, the app itself can be rather big (not enough for 7 minutes sandboxing time, but affects the sandboxing time.)
You're out of RAM memory on your mac, which causes memory swapping. This can easily lead to 7 minutes build time.
Your USB cable (or port) is damaged. I tried using a damaged cable before, and even with the basic templates that Xcode has I would take several minutes to run it on the device.

Limit App to only iPad 1

I have an app that has been in the store for a while now. I am coming out with a completely new app to replace the old one but it is not compatible with the original iPad (iPad 1). I don't want to completely get rid of the original app because, believe it or not, there is still a large number of people running it on iPad 1's. Is there a way to somehow set up either the app or the app store to where users who have newer iPads only see the new app in the app store and not the old one? (They have different titles, icons, etc)
EDIT: it seems that you cannot change the capabilities of an already published app when you submit a new version. This would rule out the first approach I suggested and leave only limiting the current deployment target.
You could require a device capability not available on the iPad 1, like the camera.
This amounts to setting UIRequiredDeviceCapabilities in your app plist file to front-facing-camera.
Another option you would have, in case the former one did not work, is setting your deployment target to iOS 6 -- this would also rule out the iPad 1s (and all devices running iOS 4 and 5).

iOS app works on developer's iPad, fails immediately on in-house iPads

I have an iOS app written by someone else that I need to put on a colleague's iPad. We recently got an Apple Enterprise developer account, so in-house distribution becomes available, and is in fact the preferred distribution method in this case.
I was able to switch to the the enterprise provisioning profile in Xcode and build the app successfully. I can use Xcode to sync it to my iPad and it runs without error there. I then email the app to a colleague and he uses iTunes to sync it to his iPad. When he runs it, the screen goes black for a moment and then returns to the home page with all the installed apps on it.
Do you have any idea what is going wrong? Where can I look for more detailed error messages? I did some digging online but don't really know where to look, since the problem is so vague. Searches on "iPad app fails on startup" or "iPad app fails on launch" yield little. Some suggest simply restarting the iPad, but I'd like to know what is really going on and solve any underlying problems.
One thing that is a little weird is that Xcode generated a .xcarchive file, not a .ipa as I was expecting, when I built an archive as Apple's documentation suggested.
I am using Xcode 4.1 on Mac OS 10.7.2 with a 4.3.5 iPad 2. My colleague has a 4.3.5 iPad 2 as well.
My question was mostly where I could look for more information. #keno's suggestion to use the iPhone Configuration Utility was spot on. It let me view the console output of the app and debug from there. Problem solved.
Regarding the weirdness about the .xcarchive being generated and not a .ipa file, I didn't notice the Share... button in the upper right of Xcode's archive panel in its Organizer window. Sharing through that button did the trick, too.
Live and learn. Thanks everyone.

JQM/Phonegap native app stuck at splash screen when run on Iphone simulator from xcode

This guy seems to have a similar problem, except mine doesn't work at all, not just on the first try. Today I installed xcode 4.2/ios simulator 5.0 hoping that would fix the problem, but it hasn't helped. The app has consistently run on actual devices, but all the developers who own Iphones are out of the office today and the company ipod is in use elsewhere.
I've tried closing both xcode and the ios simulator, changing between 5.0 and 4.3, changing between regular iphone and iphone retina, trying with simulator running first and trying with simulator closed first. It just sits there on the loading screen. As far as I know the simulator has never worked, I'm not the one who setup xcode or any of the devices (he doesnt work on Mondays and didn't know how to fix it on Friday anyway). Any help would be appreciated.
Turns out adding "localHosts" to ExternalHosts fixed the Simulator, but the simulator doesn't like the ajax call to our services site, so it still isn't working, but now at least we have an acceptable reason for it. (Devices work correctly, so it isn't that big of a deal) Hope this helps someone.
If anyone can think of a way for the simulator to work with the reference to external calls I'll transfer the answer to their answer :P.
Like Luke said in a comment to you: just use JSONP.
It's not the simulator's fault, that's just how browsers work. They don't allow cross-domain ajax requests. That's why there is a solution to this problem, namely JSONP. In essence, the response must be a regular JSON object that is enclosed in a function call, something like callback_function({json: 'object'}).

Resources