phoneGap app for iOs: if application works in xCode device emulator - ios

I've got a newbie question about phoneGap and creating apps for iOs.
If my phoneGap app runs in device emulator in xCode and everything is ok, can I be sure that it will work the same way on a real iOS device when I publish it in the appstore?

The XCode simulator does what the name suggest - 'simulates'. It is not identical to the actual hardware, for a number of reasons. Here are just a few of them:
Performance - your computer has much more memory and processing power available than the phone itself. Your app may run fine on the simulator, but quite slow on the device. This is why it's a good idea to run on the device itself, especially if you're doing stuff which could use up a lot of memory.
Missing features - the simulator doesn't allow certain things to be tested, like in app purchase or media/asset management. And obviously you're missing things like the camera, the accelerometers, compass, etc. You can from iOS 5 simulate certain things like the GPS, but nowhere near everything.
Visuals - the simulator runs at your monitor resolution, whereas the phone itself has a much higher DPI display. Things that look readable or fine on the simulator can on device look very different.
If you're not testing your app on an actual device before releasing it to the app store you're doing a disservice to your users - this is Apple's point of view, and one shared by most developers. It's not necessarily what you might want to here, but unfortunately the simulator really is just that - a simulator. You wouldn't want to be in a plane piloted by somebody who had only trained on a simulator. And you probably wouldn't want to use an app that had only been run on the iOS simulator.
Here's what Apple have to say about it in their own documentation:
Although you can do much of your debugging and testing of an iOS application using iOS Simulator, simulation cannot completely match the results of running your application on the target devices; you must test your application on actual devices to ensure that it runs as intended and to tune it for performance on actual hardware.

Related

The iOS Simulator is a Virtual Machine or a Emulator?

The iOS simulador that installs with Xcode is a VM or a emulator like Android does?
It's neither a Virtual Machine nor an Emulator. It's a simulator, in another words it's a standard mac application which mimic the behaviour of iOS devices. It mimics most of the features of an actual devices, but lacks some major features. So you need to use a real device for testing some of the real world scenarios.
You can read more about simulators here : About Simulator
I would like to quote some key information from the above linked page:
What is Simulator
Simulator allows you to rapidly prototype and test builds of your app
during the development process. Installed as part of the Xcode tools,
Simulator runs on your Mac and behaves like a standard Mac app while
simulating an iPhone, iPad, Apple Watch, or Apple TV environment.
Think of the simulator as a preliminary testing tool to use before
testing your app on an actual device.
Need of actual device for Testing
Simulator is a useful tool, but it should not be the only way you test
an app. Because the simulator is an app running on a Mac, it has
access to the computer’s resources, including the CPU, memory, and
network connection. All of these resources are likely to be faster
than those found on a mobile device. As a result, the simulator is not
an accurate test of an app’s performance, memory usage, and networking
speed. For this same reason, always test the performance of your app’s
user interface on a device. In Simulator, your app’s user interface
may appear to run both faster and smoother than on a device.
Also keep in mind that some user interface elements can be easier to
interact with in Simulator using a mouse than when trying to interact
with the app through touch on a device.
Finally, there are some hardware and API differences in Simulator.
These differences may affect your app when testing in Simulator.

iOS Development Testing Requirements

On Apple's website they say you to test on iPad, iPhone and iPod touch.
Is it actually required to test on all three before distributing the app, or is it acceptable to just test on one of them (say, iPhone)?
is not required,or rather, they may not know where you've tested the app, but it is obviously highly recommended to test the app on all devices and all iOS supported by your app.
the simulator replaces a device well true, but sometimes it can happen to encounter errors that simply can not be seen on the simulator, but that may be encountered on a real device
To avoid unexpected problems is always better to try more devices

iOS and Cocos2d: my app REALLY slow on simulator but is FINE on device

..I am wondering whether there is some setting I should change to get my iOS 5.0 app running fine on an iPhone IOS 5.0 simulator. It runs at only 12fps instead on my device runs at 60fps. Any help? I would have expected the simulator to work fine..
I am using XCode 4.3 and Mac OS X 10.7.3.
Simulator performance is completely and utterly irrelevant. The Simulator runs on your Mac's CPU, that's multiple times faster than the fastest iOS device. The Simulator does however not use hardware graphics accelerations, so it's easily maxed out even though your Mac is so much faster. Lastly, which of your app's users are going to run your app on the Simulator? Answer: no one!
That said, there is still reason to be alarmed. You get 60 fps on the device, that's great. But which device? If it is an iPhone 4S or iPad 3, that device is a lot faster than older devices like iPhone 3GS (or even older yet) or iPad 1. So depending on which device is the oldes device you're developing for, you might still have a problem. Try to find or borrow such a device, and test it on that oldest-supported device, and do test only with a release build.
Consider the facts:
Simulator performance sucks
Retina Simulator performance sucks even more
iPad Retina Simulator performance is beyond good & android
You're most likely the only person ever to run your app in the iOS Simulator
Therefore:
Simulator performance is irrelevant
Simulator performance can not be compared to device performance
The Simulator is for quicker testing of your app's business logic, nothing else. Not even Samsung copied it.
In addition:
Debug build performance is largely irrelevant. At least verify performance measurements in release builds.
Test on oldest supported device. Otherwise you have no way of knowing whether the previous generation device from the device you're testing on may still render 60 fps or only renders 20 fps. That's quite possible.
Lastly, to answer your actual question: the only thing you could do is to make sure you run the standard (ie non-Retina) resolution Simulator. There's really nothing else you can do besides getting a Mac with a (much) faster CPU.
For graphics, par for course. Dont use simulator for any user experience validation, but stick to devices. Dont waste a minute trying to tweak your workstation settings or looking for ways to improve simulator performance. In any event, your are trying to deploy to devices after all no ?
Some functions work faster on simulator (depending on your workstation of course), like data or computation intensive functions. As always, benchmark on your devices, dont be fooled by 'suitable' simulator performance.

Is owning hardware necessary for iOS development and testing?

I'm learning iOS development and I need to know what hardware I need to test my apps.
Is the iPhone/iPad simulator in Xcode sufficient? Or do I need the hardware? I have an iPad 2, and an iPhone 3G. The iPad 2 is one generation old, while my iPhone 3G is three generations old.
My first project is a basic card game with networking, based on a tutorial.
Opinion: Considering the number of questions I see of the form "this works great on the simulator but not on my device" I'd say that having hardware for testing is necessary. I don't think you need every possible device but certainly ones that cover the features that your app uses.
It depends on features you need.
Example of things you can't test in the simulator:
Push notifications
Performance of an OpenGL game (usually you need a wide set of device to test OpenGL)
The simulator can be used for development, but the simulator is not relevant for efficiency. It is very recommended to testing on a real device too. Some of the services can not be developed on the simulator:
the push notifications
in-app purchase
iCloud services
And you know, that the iPhone 3G is not able to be updated for the lastest iOS (your iPad is able).
The first answer is YES, you need hardware as there are differences between the behaviour of the simulator and the devices. They won't always act the same as the simulator is a bit more forgiving than the device.
For example the simulator will find files (images/sounds/models etc.) even if the case is different between the request and the file name, the device will not find them. And there are more.
An other point is whether to buy/have devices to hold different iOS versions. I don't have them all as this is too expensive for me but I can say that this is a problem. No matter how much you will try to consider the differences between the devices you will always miss something and your app might not work or crash on this device.
Still you can consider this question by looking at the apps that you are going to work on. I would say that if your apps don't use the device hardware (camera for example) and don't have features that might cause problems on different devices you will be able to start with out the devices.
Bottom line is that if you want to deploy good working apps, in most cases it will be better if you could test your apps on a variety of devices.
It's not a requirement to have a equipment to test, but certainly very important. You can test FPS of your app, even not containing hand-made OpenGL. All features that you use on your app, like view effects, are tested for sure on a device. Since simulator uses your mac memory, you won't see any side effects from memory shortage. I believe your best chance is to have a iPhone 4 and your iPad 2.

Blackberry Development (Test Devices)

I'm planning to create an app for blackberry. The Android and iPhone Versions are almost done. Next on the list is the blackberry one.
So my question is: how good are the simulators? Do I need a real device to test? Which one would you recommend?
It is unlikely you'll be able to create a bugless app without a real device. However totally ignoring simulators would also be a mistake. Simulators are quite good, because they allow to test a substantial part of features on a wide range of device models/OS versions. It would be quite expensive to have a dozen of real devices. :)
Usual points to bear in mind while working on simulators:
real devices are slower in times.
simulators do not support permissions (simulators act as if permissions are always granted regardless of what you actually see).
real device may not support the same type of network transport that your simulator has (TCP, WIFI, BES).
big wireless providers (e.g. Verizon) usually install a slightly customized version of BB OS on their devices, and sometimes it results in a different behaviour (or even bugs).
I've had fairly good luck with the simulators. I've been using the Storm, and I have a real curve. I have a colleague with a real storm so I run everything by him as well.
There have only been 2 times that having a real device has helped me. 1. Making sure I had my install files correct. Since Eclipse just copies them out to the simulator it took me 2 attempts on a real device.
and 2. When testing creating & using a database on the sim card. I got about 95% there on the simulator, and the other 5% was really just verification.
That said, which one depends on what version you're writing for. Storm and some curves are 5.0 (and can be upgraded to 6.0) The Torch is only 6.0
Blackberry simulators are really good
They are exact replicas of the devices
I have worked with storm and also the torch devices
I have faced problems during the connections to the internet
and while using the SD cards (SQLite databases)
Getting images from the SD Card which is not possible from the simulator
If you are developing an application which needs the basic UI components and the native blackberry components, simulators are fine
But if you are really developing something out of the box device is a must
It would be more better if an app can be tested in the device before rolling out
Try your luck
Thank you.
The Blackberry simulators are fine. I believe they are built using the same code as actual devices, so they are pretty much identical to real devices. The only thing that makes a difference is the software that they run.
The simulators will provide you with almost all the same functionality with the exception of things like GPS. I believe I've used an image from an SD card before using the simulator as well...
As far as I know, simulators are set at a specific OS version, whereas in the real world there are tons of different OS versions being used (minor revisions). There have been cases where a feature has worked on the simulator but once it was built and launched on the device, the device shows something different. So if you want to get your app tested, you should test on your TARGET device and OS on simulator and real device.

Resources