Testing iOS testing on real devices vs. Simulator - iphone

I am new to iPhone/iPad development and I am close to finishing up my first app and I am looking for some general advice.
I know it is important to test on actual devices and not just the simulator. What are the types of things people generally encounter when testing on a deal device that they don't see in the simulator?
The app itself is mainly a way to track online deals and that type of thing. It doesn't need anything special in term of using things like the camera or GPS.

It's just general usage testing. The device performs in an entirely different environment than your computer, and it's the best way to make sure if you push your app out to devices, that nothing unexpected will happen. For example, the phone/pad may have limited data coverage, low memory situations, incoming calls etc.. These situations are a lot more common on devices, then when people emulate it though the simulator.
On a hardware point of view, the device uses a different processor architecture than your Mac, which also needs to be accounted for (not as much as other cases, but you need to cover your bases). The Mac also cannot reliably emulate RAM, Disc Space, Processor Speed etc...hence testing on the device is useful here also.
Obviously there are some features you can only test on devices, such as Camera, GPS (and not so obviously iPod library usage), and if your app uses them it'd be careless not to test on a device.
Overall if you're intending to release your application to the App Store, or to devices at least, it's worth testing on the device itself. Only then can you be sure that it will act and perform as expected on the platform you intend to target. The simulator is only a simulator after all, not the real thing!

First of all: the user experience is very different.
The mouse based interaction is very different from a touch interaction. focusing at a monitor feels very different then looking on a device on the palm of your hand.
Also the experience of animations running on the simulator and the real device can be very different.
And the usage in the simulator won't tell you anything about the battery consumptions to be witnessed on the real device.
My opinion: every app that will be shipped to the App Store or customer for testing should be tested several different real devices. No excuses.

Simulator runs a lot slower than the real device.
Real device could run out of memory when Simulator doesn't or vice versa.

In app purchases, if you have included them
Orientations (not that
they are unavailable on simulator, but it is easy to forget it
there!)
App life cycle testing - bringing your app to foreground and
background.
Network access - can matter when you access the network from device through wireless or cellular network vs LAN/wifi on your mac. There is a huge testing to be done under the umbrella called Reachability if your app uses any of the resources across the net. You are bound to provide an alert if network is unreachable before using any such resources, as per app store requirements.

Related

iPhone app using 2G, 3G, 4G network

i want to develop an application that is capable of using 2G 3G or 4G depending upon the availability of the network. Because this app will be used in different countries and there is a support of only 2G in some countries while some support 3G or 4G.. i am a little bit confused whether my app will automatically use the Fastest network available or i will have to explicitly code for each one.
According to Apple's documentation, WiFi is what is chosen first. If that fails, then it goes to the next available (and presumably fastest) cellular network data connection.
This is the kind of thing programmers do not have to worry about when designing apps for iOS.
iOS will take care of whether wifi or 3G is used. You don't need to worry about that.
If you have operations in your app that use a lot of data you may want to restrict them to when the user is on WiFi (or at least warn them). The reachability example shows how to do this, among other things. Worth looking into as apple have been known to reject apps that use excessive amounts of cellular data.

Using Old iPhone 3G for testing, remove the sim card?

I just got an old iPhone 3G for testing. It doesn't have a plan attached to it, but I just put in the sim card and it said it will take a while to activate.
When everyone has test devices, do you just leave the sim card out? What about when testing location based services that need to find cell towers? What do we do in situations like this? I don't want to pay for service.
You won't get anything out of the cell towers without a valid SIM card. I use my wife's old iPhone 3G for testing, and it still has the old AT&T sim card, but of course there is no service because that sim card is not on our account anymore. I always leave it in Airplane mode.
The main thing I'm verifying with the physical device is performance, UI responsiveness, and memory issues that present no problems in the simulator, but choke on this old device. The iPhone 3G is great to have on hand as a minimum baseline for that stuff.
The location-based stuff you should be able to mock up without needing any "real" data. Do a google search for "iphone" "mock location" and see what that turns up.
This looks promising:
http://rssv2.blogspot.com/2010/03/mocking-core-location.html
You don't want to have to develop with real, live data until you are in the beta stage anyways. Using real, live data during development is a huge hassle, not easily repeatable, and very time consuming. And this makes it impossible to write effective integration tests.
The iPhone has a GPS receiver, you don't need cell towers they just help speed up the process of acquiring the GPS satellites and finding your location. WiFi service will do the same thing but is not required. With no cell data and no wifi it can take several minutes to acquire GPS satellites, download ephemeris from the satellites and get a good location, but it works.
I use a 3G running 3.1.3 with no sim card for 3.1.3 testing and it works fine even for using location services, but I have wifi here.
I also use a CoreLocation simulator which allows me to simulate and repeat motion scenarios without going anywhere, it can simulate acquisition time, varying horizontal accuracy and motion. The simulator is available on github.

Do you have to have iphone to make iphone apps?

Can you make iphone apps without owning an iPhone? I have a macbook but wondered if maybe there was an emulator you could see your programs on to build your app. All the articles I found were a couple of years old.
Thanks.
You CAN use JUST the emulator to develop apps and for the most part, it works the same as the actual device. Memory and some hardware items behave differently on the device, so it can be be difficult to find bugs before the app gets into the hands of your users, and performance on the device will not be as good as the simulator.
Also, things like the Camera, Location Services, Accelerometer & Gyroscope will not be usable in the simulator.
In theory you can (Xcode comes with a simulator) but in practice I don't think you can. Several things don't work in the simulator or work differently so you won't be able to test if your app works properly.
The practical differences between the simulator and a real device are:
Runs faster than the real device.
Internet access is treated as WiFi. It doesn't emulate 3G.
You can't tilt or control acceleration.
You can touch with one or two (holding alt) fingets, but not more.
It doesn't vibrate.
Some sounds and musics don't run on the simulator.
Accelerators, camera, gyroscope, and GPS return fixed data. Your position reported is always Cupertino, the camera is blank, and the sensors report 0.
It can't be jailbroken.
Keychain doesn't work.
However, that's good enough in 90% cases to develop functional applications.
It is certainly highly recommended so you can actually test on a real device. Apple provides a pretty good simulator for doing the majority of your development on, but things like testing memory usages, performance and making use of features such as a camera, location api, accelerometer, etc, you'll need the device.
Certainly, start developing using only the simulator (if you are not sure you want to do iPhone development), but I would recommend getting a device (iPod Touch is a cheaper alternative) if you decide you want to move forward.
It depends on what you are trying to write. All functions of the device are not available in simulator. For example accelerometer. So if you need that then you can't work without the device. And also the simulator uses Mac environment which is far more powerful, both in terms of processing power and memory. So your app may run well on simulator, but may work poorly and even crash on device. So it's better to have a device for serious development. But obviously you can start learning on simulator.
If you want to write apps that don't suck you will need an iOS device. Period.
Doesn't matter if it's an iphone, ipod touch or ipad.
I never had an iPhone and wrote a dozen apps for it. In fact I still use my old iPod touch 2G for development.
But I wouldn't recommend that particular one for development, because now its end of life and you won't get firmware updates for it.
But last generation is totally fine.

Accessing Bluetooth via Bonjour/GameKit from the iPhone SDK simulator (circa 3.1.3)

I'm in the process of getting hardware for an iPhone prototype, and I'm wondering if it's possible to access bluetooth (ExternalAccessory, Bonjour or GameKit) exposed by development box (eg. a macbook) using the SDK's simulator as of the latest version (3.1.3 at the time of writing)
Before I get any answers on the subject, I accept that I will need an iPhone for the actual development - this is simply a prototype.
I'm not sure I understand your question entirely.
I can state that in iOS (as of May 2011) the only access you have to bonjour is through the Gamekit functionality. That functionality is fairly robust, but (for instance) you will not be able to create a BT based bonjour service that other non-iOS BT enabled devices can find.
On the simulator, even if the underlying device HAS bluetooth capabilities, you will NOT be able to perform "real" bluetooth operations. Instead the simulator will simulate some capabilities, and ignore others. You really do need multiple devices to load your code onto and run, in order to test out BT code.
Bluetooth connectivity is inaccessible using the Simulator. If WiFi is good enough for you, that works with Bonjour and GameKit on the Simulator as well. Otherwise, just like for the accelerometer and several other components of the device, you will need an actual device.

iPod Touch compared to iPhone as development platform for iPhone apps

Essentially I'd like to know just how compatible are the iPhone and the iPod Touch. I would like to know if I could buy an iPod Touch (and thus save some cash) and develop iPhone apps on it or if I really should spend the extra money and put up with AT&T and get the iPhone.
What exactly is different between the two devices (other than the missing phone part in the iPod Touch).
Has anyone done this successfully? Or am I crazy for even thinking it?
EDIT
I've corrected the references to iPod Touch in the text so that #person-b won't strangle me..
Also, i would like to make sure that I point out the fact that I really am interesting in the feasibility of developing iPhone apps on an iPod Touch.
As #Chaos noted, the iPhone and iPod touch differ in their hardware features. The iPod touch lacks:
GPS
3G/EDGE cellular connection (that is, it can only connect to WiFi networks)
Compass
Camera
Built-in microphone (the second generation iPod touch supports external microphones; the first generation doesn't)
As for the CPU speeds, Apple doesn't publish any kind of spec for that. However, the iPhone 3GS is definitely faster than the current iPod touch, which is a bit faster than the original iPhone and the iPhone 3G. If your app is CPU-intensive, you should test it on an older iPhone.
Another important difference is the networking capabilities of the different devices. If your app never has to connect to the Internet, then an iPod touch is just fine. However, if you're using the network at all in your app, remember that WiFi connections are nice and stable and fast, but 3G and EDGE connections are slow and crappy and prone to intermittent failure. Your app needs to be able to deal with a crappy Internet connection. You don't actually need an iPhone to test this stuff, though; instead, you can write a script to artificially throttle or interrupt your development machine's network connection. Craig Hockenberry posted a good method for doing this, which you can find reproduced here.
As far as general software development goes, getting an iPod Touch is a fantastic way to get into iPhone app development. I live in Nebraska, where AT&T coverage is spotty at best (my friend's iPhone doesn't get a clear signal in my house). You won't get the bells and whistles of a 3GS, but you'll save on the up-front investment.
I recently purchased a MacBook and a 32GB iPod Touch to do just what you're suggesting - get into iPhone app development on a budget. In the end I plan to pickup several more devices, but just to get started it doesn't make sense to break the bank. I've developed Windows and Linux software but I'm new to Objective-C and the Mac platform in general, so I'm expecting a learning curve. I'd prefer not to be forking over $100 per month to AT&T while I get up to speed.
Here's what I paid for new-in-the-box hardware and software from Apple to get started:
MacBook - $1070
iPod Touch 32GB - $428
iPhone 3.0 OS upgrade - $10.70
All told I've spent $1500 (including tax) to have a viable development platform. According to BillShrink the TCO of a 16GB 3GS with an average usage plan is $2800 (http://www.billshrink.com/blog/iphone-versus-palm-pre-versus-android/). Add in the MacBook and you're up to nearly $4000 in the first two years. I got 2X the capacity for $440...
While I agree that going straight to the iPhone provides the most flexibility, I also think that the iPod Touch is a great introduction to Apple's new software platform. You can save up to $2400 (depending upon how much your current cell plan costs) while getting a feel for the development process.
Update:
One major reason to get the iPhone 3GS is to get OpenGL ES 2.0 support. If you want to do any advanced shader-based rendering, the 3GS is the only iPhone that will work. The 3GS is also nearly twice as fast as the 2G iPod Touch for OpenGL ES 1.1 code. Source: http://toucharcade.com/2009/06/20/iphone-3g-s-vs-ipod-touch-cpu-opengl-es-benchmarks/
No GPS
No 3G Chip
Different CPU Speed (depending on model)
No compass (if we're talking 3GS)
No camera.
Other than that, the apps I'm working on work as well on our graphics guy's iPod Touch as well as on the 3G/3GS
Aside from the other features lacking that other people have listed, the iPod Touch also lacks a built-in microphone, so apps relying on audio input are also a problem.
In general, though, the iPod Touch makes a great testing and development platform for general-purpose apps or games.
I started developing apps for the iPhone on my iPod Touch, here these gadgets are really expensive... and that is a bummer..
The only problem i have encountered while developing was the lack of 3G and the GPS because i wanted to see how my apps will work on 3G compared to WiFi and also i wanted to use the Maps Api but the Touch doesn't have the GPS and i had to find an iPhone to test my app..
If you want to start developing i think the ipod touch is a good starting point also, the 3GS is really expensive(here - Romania - is like 1100 euros - 2 year contracts) and the 3G also(still 600 - euros - 2 year).. so if you only want to play with cocoa and build small apps for free... keep in mind the costs.
The first generation of ipod touch didn't had the volume buttons, the second generation has them..just to confirm
One thing to bear in mind is that the second generation iPod Touch has a more powerful processor than the original and 3G iPhone. If the app you're making is a particularly CPU intense one, you may want to pick up an old iPhone to test against.
There are also a lot of used first generation iPhones out there. You don't need a plan to use them to run apps and get on the Internet via wi-fi. If you really need to test against the older iPhones, you should be able to get one used and not pay AT&T for a subscription.
Yes, this would work fine. They will be more even product lines after apple updates the ipod's to the same internal tech specs as the new iphone. The "iPod Touch" is just like the iphone software wise except for the hardware specific apps.
The iphone has a few more hardware features over the ipod touch like the cellular radios of course, camera, microphone, compass (3gs), and GPS.
So if you are not developing any application that uses any of those device features, the ipod touch should serve you well.
A quote from gizmodo.com
The iPod runs Mac OS X like the iPhone does and we have got unofficial word from inside Apple that it runs exactly the same applications. The exact quote: "they use the same damn binaries".
That quote is from an article that is almost two years old now, and I haven't seen anything to suggest it is incorrect.
So as has been said, as long as you aren't trying to develop hardware specific applications then using the iPod Touch should be fine. Though personally I believe if you intend to develop for a platform you should use that platform. I also understand the iPhone is expensive so I don't blame you for wanting to save some cash. :)
Many people have give pretty good answers. But they have really only pointed out the difference and have not said if you should get an iPod Touch or an iPhone.
GET AN IPHONE
It is simple as that.
It does more than an iPod touch as listed above.
You can use it as a phone and replace your existing phone.
Once your game actually sells you will end up getting an iPhone anyway because you are now making money, you will then need to sell you iPod touch at a loss (you dont really need it).
You will build more than one app in the next year and one of them might rely on the iPhone camera, GPS, or even Video, maybe even compass, you will need an iPhone for all this.
You will now want the internet where ever you are to check you sales stats every day when they come out.
Save you money, buy one device, buy an iPhone and sell your old phone.
The September 2010 iPod Touch has 2 cameras and a microphone. It has the same functionality as the iPhone4 apart from the phone part & doesn't have GPS.
I think it's better to spend money on a iPod Touch 4th gen than on an iPhone 4 (unless you need really accurate GPS coordinates in your app).