Profiling a running iOS app without a computer attached - iphone

I would like to profile a running app without a computer attached. Pretty much what the sample command does on Mac OS X. Is it possible ?
I would like to do this without any computer attached because my app gets into an endless loop only at certain GPS locations. I tried reproducing the problem by faking GPS fixes but I couldn't. Yet the issue is 100% reproductible in the field…

You can try logging suspected method and loop entry/exits to a file, and recover the file later using iTunes Document sharing or Xcode.

No - I'm pretty sure it isn't, as Apple does not allow developers to use any iOS-development tools on the platform itself. You might be able to build analytical stuff into your own app (RAM monitor etc.), but not by using another app.
Anyway, your computer is much better suited to the task than a device - so sick with it.
Maybe some day Apple will let us test/write iPhone apps from iPads...

Related

Creating an Iphone App without having an iphone? (with iphone simulators?)

I am wondering how good of an idea it is to start creating iphone applications without actually having an iphone?
I found that there are simulators for iphone...
Are they good enough or is it likely that I might encounter some problems down the road when creating an app?
-I don't have an idea of an app yet.
-I don't have a real iphone. There ARE some handsets in my job's office, though, but I don't want to use them too much.
Thanks! And if you think that it is an okay idea to create apps and test them on simulators, which ones would you recommend?
Bad idea.
You can get a lot of work done but you really, really need an actual device to do your final testing.
Remember that it's a simulator and not an emulator. There are significant differences in performance. Lots of things work fine on your Mac but poorly on an real device. There are, perhaps surprisingly, a number of situations where the reverse is true (i.e., faster on the iPhone). You get better at figuring out these differences after a while, but without working on a real device you'll never know.
If cost is the main factor, you don't actually need an iPhone; you could work with an iPod touch instead.
xCode has an Emulator in itself, so why not? All you need is a Mac-PC
check http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/25-Using_iOS_Simulator/ios_simulator_application.html#//apple_ref/doc/uid/TP40007959-CH9-SW1
Do you have a mac?
iOS SDK has a really good emulator where you can try your apps, and i think if works on it, it should work on a real iPhone.
Consider that the simulator is good enough, to create your app, but it all depends on what you use. For example if you use the accelerometer or the Bluetooth simulator is not suitable to your case. Overall, in many respects is very limited, but to begin with can go just fine.
To use the devices of which you speak, you must have a valid license from the developer and associate devices to your license, otherwise you will not use them (though not with the jailbreak)
the iPhone simulator does not support everything, which is supported by a real device. Some things are impossible to test on a simulator, including but not limited to features/API associated with: calendars, camera, gyroscope, accelerometer, music, ...
The iPhone simulator that comes with xCode is fine for the development of most applications. In my experience the area where it falls down is when you are dealing with stuff that runs in real time such as audio and graphics. The processor on the computer is obviously faster and if you are only testing on the simulator you might not realise that what you are trying to achieve is outside the capabilities of the device.
This could have impact on your frame rate (as you will get a higher frame rate on the computer) and in depth audio with lots of DSP faces the same issues.
If you are developing Line Of Business apps the simulator is probably all you need. Of course you need to test on a device before release, but most of the bug testing and debugging is possible in the simulated environment.

iPhone app crashing on some devices -- looking for advice

Hey everyone, I'm in a bit of a pickle and am looking for some advice.
I have an app that's been released to the app store..nothing special just a first time sort of thing. The app runs perfectly fine on my device(s) but a couple buddies always get a crash.
So here's the details:
It crashes by sometimes stalling and other times by just exiting to the main screen.
I've tried to replicate the crash (or any crash) using
the same iPhone generation/model
on an ipod touch as well
the same OS
different OS
using debug/release/distribution/downloading from app store builds
since it's an app that connects to a google maps service, I've tried with both
a wifi connection and the att network.
The only thing that MAY be different is any other apps on their phones that are not on mine.
The fact that I cannot replicate with exactly the same setup leads me to believe it's a memory issue, maybe uninitialized variables or incorrect cleanup at some point (i'm from C++, so I know this sort of thing can vary from machine to machine). I'm somewhat new to obj C and may very well be missing something there. I'm just curious to hear what others have to say, does this sound like a memory issue with the info I've provided? Any other ideas to test/suggestions come to mind to try and reproduce the crash?
Thanks!
One possibility is that it's a backgrounding issue. You don't say whether your app tries to use those features or whether your friends experience the crash in that context, so it's hard to say.
I would provision your friends with a beta that logs verbosely if you can't pin it down.

Does iPhone developer REALLY needs iPhone?

For the sake of coding itself, I know that I don't need to buy iPhone as there's pretty good emulator.
However, as I will develop iPhone apps for clients (will not have direct contacts to clients) via freelancers sites, do you think that I might get rejected (not chosen) by the contractor because I don't have iPhone at home?
Do contractors accept this way of working:
I develop the app, test it in the emulator and send it to them
They test it in iPhone and send me the list of the bugs
I fix the bugs and send them the app back
They find new bugs and...
Yes, or at least an iPod Touch.
To clarify:
Yes. You really need one. Debugging the kind of errors that cause it not to open on the device at all, for example, can be mind-numbingly tedious if you don't have the device handy.
For most purposes, of course, an iPod Touch should do just fine, but the crux of the matter is that the testers can only test what they see; only the developer can actually test crucial stuff, most of the time.
So to repeat. Yes, you'll need a device. A thousand times yes.
Your client may have something of an issue paying money for software that was never tested on actual hardware. No matter how good an emulator is, you should always try the software on the real machine your program will be running on. The emulator will simulate the way the API responds etc, but you could be blindsided by things such as interference from other running applications, subtle timing bugs, interaction between different versions of the firmware or hardware, etc.
In short, I don't think there is a legal reason you have to test on a real iPhone, but from a Q/C point of view, I think there is no question you need the real hardware to run it on.
Paying customers generally dislike being treated as a beta tester.
I don't think that you won't get the clients - but I do think its a terrible idea not to have a device to test on.
There are many things that won't work properly in the simulator. For instance you can't simulate a camera function, you can't simulate GPS (properly - it always sets you at the apple HQ), you can't simulate sound recording, or test with a real contact address book or a real set up. You can't test whether there is an internet connection or if there are any iphone specific bugs.
On the other side of the coin there are loads of things that will work in the iphone simulator that won't work on the device itself. For instance NSXML and such won't work on an iphone, but WILL work in the simulator.
If you can get hold of one of the new ipod touches they do pretty much most things you will need, and you don't have to get into a data plan or anything. I would suggest AT LEAST getting one of those. You can't make apps if you can't test them properly.
Other things:
In app purchases - #Stephen Darlington
Whenever working for clients, the clients do not pay you for having an iphone or not... or being able to test it on a actual iPhone. The clients pay you for the product you deliver. They expect it to work on the device.
My recommendation is to get yourself an iPhone 3, 3gs and 4 if you want the best results. But, if money is a object here... try developing minor projects which are reliable in the simulator. AND ask friends/family which do have iPhones to test it for you on their device. Its better to ask mates to do this, then ask the client, this way you have a better comunication with your client, your client has more faith in you and... well lets face it, it is the developers responsibility to deliver quality code. Right?
There are some tests you cannot perform in the emulator.
And I am not sure contractors will like this ping-pong test approach (somebody will get tired after couple passes).
You can get an old second-gen iPod touch at a very good price since there are many people who would like to get rid of it. And Apple advices to test apps on older hardware to achieve the best performance. So you'd better get something 'hard' to play with.
Another aspect is performance. The simulator (running on a powerful Mac) will be much faster than a device. This was a huge difference with the original first iPhone.
As an alternative to the iPod: look for a cheap original iPhone on eBay or so. But remember that this will not run iOS4.

Can I run multiple app in iphone simultaneously

I want to run two app simultaneously, I am using jailbroken phone and dont want to upload that app to the app store.
Is there any way so that I can log phone call time, this can only be done if my "logging app" is running in background.
Please suggest me, how can I do this on jailbroken phone.
Some thing like:http://msdn.microsoft.com/en-us/library/ms884959.aspx (its for windows)
Is this actually a programming question, or are you asking for an app that logs call times?
Assuming the former, you would write a iPhone program that hooks into current phone conversations some way (private APIs? Not sure if this is indeed possible, just assuming.) You would then run your app via Backgrounder or some other wrapper that provided an interface for multiple applications to run at the same time. This usually comes at the cost of increase battery life, depending on how much CPU (and maybe memory?) the backgrounded app consumes.
Backgrounder is available via Cydia, I believe.
Need to include CoreTelephony, will solve the issue

Is it possible to develop for the iPhone without an iPhone?

I know there are emulators, but is this good enough? If someone is serious about iPhone development, do they absolutely need an iPhone?
Just my personal opinion: if you're serious it means that you're committed to quality of your product. If you're committed to quality there is no way to deliver a product without actually launching it on the target platform :)
As noted in other posts you'll have tough time testing the multi-touch screen and other aspects of the hardware on your emulator.
Don't forget that most types of iPhone apps also work on the iPod Touch, which is a one time cost and no monthly fees. Even network apps work if the iPod Touch is connected to WiFi.
During development of my first iPhone app, I wrote code that worked fine on the iPhone Simulator, but which did not work on the device. So I would say "Yes, you definitely need to test on an actual device."
The simulator is not an emulator. It is not running the actual iPhone OS; it is running a set of Mac OS X libraries that are very similar, but not identical, to iPhone OS. The simulator is great for debugging and saving time during the code-and-test cycle, so you will use it a lot more than the device, but a device is indispensible.
You really do need to touch-and-feel your app on a real device. A UI that works great while pointing and clicking with a mouse might be terrible when used with thumbs and fingers. If there is any text entry, you need to feel how painful it is to type using the onscreen keyboard, to determine whether it makes sense to provide alternative data-entry methods.
There are also significant performance differences between the simulator and actual devices. You need to test with the oldest (slowest) device you want to support to verify it is not too slow, doesn't run out of memory, etc.
As others have suggested, an iPod Touch is also sufficient, so the cost of a device isn't huge. Also, try to find beta testers with a variety of different models.
Necessary: How the app handles in your hands is critical to something like the iPhone. you cannot tell how it will feel to use when plastered straight in front of you in the emulator on a big screen.
If you cannot hold it you won't be getting the true user experience.
If you need to learn Obj-C, go with the emulator for a while until you learn the ropes and save the expense for later. But yes, eventually you will need an iPhone for final testing. How long you can wait will depend on the features that your app uses, If all you are doing is button presses, you can wait a long time. If you are dragging, using location services, etc., you'll need a device earlier in the development cycle.
Are you trying to convince yourself or your boss? ;-)
I'd say you need one. Emulation of such a new device can only go wrong. Plus don't forget the tactile aspects.
The iPod touch is a reasonable substitute provided you are not using:
GPS, BlueTouch or Camera - the iPod touch doesn't have these
Cellular network - although the iPod touch has WiFi, the latency of a cellular network is way way higher than that of a wifi network. If you are doing anything like designing a custom protocol for your application, you will want to check real-world performance - and if you do this too late in the development cycle, you will be in for an unpleasant surprise.
Whether you develop on the iPod touch or on the iPhone, you absolutely must have a device. This is not optional! The simulator is good, but it is not perfect, and there is no substitute for having a device which correctly indicates performance, screen resolution, brightness, form factor and all the other factors that you will need to consider in your application.
If you buy an iPod touch, you will probably end up getting an iPhone too. I'd just go straight for the iPhone. That way you can use it as your main phone, and get a real feel for how the platform behaves and what an application needs to do to make it great.
Kind-of "yes".
Just download iPhone SDK (it's easy and free) and check out the emulator that is in there. You'll see whether that suits your needs or not. The emulator is not indicative of real hardware performance, there's no touch input, some quirks might be different, some things can not work, etc.
The iPhone Simulator makes it easy to test your applications using the power and convenience of your desktop or laptop computer. Although, your development computer may not simulate complicated touch events, such as multifinger touches, the Simulator lets you perform pinches. To perform a pinch, hold Option while tapping on the Simulator screen.
I'd say it depends on the kind of application you are developing. For a successful iPhone app, one which is properly integrated on the system, you are going to need to be able to test your tactile interface. That's hardly accomplished with the Emulator.
So, my answer is Yes, you do need an iPhone to develop iPhone apps. Fortunately, if you cannot afford one, an iPod Touch (200 bucks) is a very competent replacement. The underlying hardware is pretty much the same.
Necessary. If you plan to develop a successful product it needs to be one the end users (not just the developers) find easy to use.
The best way to do that would be to load your app on an iPhone then take it to various people and ask them to use it while you watch them to see if they experience any issues.
Users can get mighty creative in trying to do things a developer never intended - just ask any support tech.
Unless you're app is going to sell for less then $500 total it's a relatively small investment to build a quality app.
If you are serious about development, an iPhone (or iPod touch) is a must. However, the official SDK comes with a very complete "iPhone simulator". This will allow you getting a feel for Objective C and the entire development workflow. The SDK requires Leopard.
You don't need a Mac for this. You can use OSX86 on your PC, either installed on and booted from disk or through VmWare.
It works. In fact, you can even synch the iPhone through Leopard running in vmWare.
Now, testing on a real iPhone is a necessity because of performance, memory usage etc. Also you need it for the entire authentification procedure, getting the keys etc. (if you want to sell your stuff on the Appstore), testing this really requires an iPhone.
If you buy an iPod touch, you will
probably end up getting an iPhone too.
I'd just go straight for the iPhone.
That way you can use it as your main
phone, and get a real feel for how the
platform behaves and what an
application needs to do to make it
great.
I absolutely agree with this.
If you are seriously developing an iPhone application - for fun or for profit - you will have to run it on a real iPhone to test out compatibility and usability at some point. Since you going to have to get one at some point, you may as well get one now. Don't go for half measures. An iPod Touch may be [significantly] cheaper to start with, but will be money wasted when you go and get your iPhone. (Of course, if you are planning an app that runs on the iPhone as well as the iPod Touch, then you MUST test it on both. You cannot assume that if it is good on one it must be good on the other).
Also, by having an iPhone from day one, you can familiarize yourself with its user interface, its norms and the common metaphors the apps use. That will heavily feed into your own application design process, and make sure that your app looks, feels, and works like a first class iPhone citizen.
From experience developing on other mobile platforms, once you get to a certain point, it really is best to have a physical device to test on. If this is something that you would also be using yourself, if it much easier to get some real world type of testing by using the application out and about.
I also think it helps one to understand the platform better by having the device or devices you are targeting with your app,
if you are going to develop native apps for the iphone, I would say get an iphone or ipod touch to target. emulators are good, but eventually you will need to target the real thing. if you are developing web specific content there are lots of things you can do without it (there are some great dev videos free from apples dev site which will only cost you a sign up) but eventually I would think you would still want to test with the real deal
Get a cheap used iPod touch, develop, get money, buy an iPhone 5.
I'm a nokia dev now, I'm thinking of going to iPhone, Actually I have the Mac to work, just the device itself ;)
I've tried iPhoney and compared to my iPhone (Mark 1) it's not the same, it's close - but not close enough to rely on if the interface is of importance to you.
You absolutely need the real device. The performance difference between the simulator and the actual iPhone/iPod Touch hardware is huge. Code that will run nice and fast in the simulator can easily turn out to be too slow to be usable on the real thing. Also the API provided by the simulator is not 100% identical to the real thing, so code that works fine in the sim, may not work on the device. The only way to know for sure is to test often on the actual device.
As others have mentioned, the iPod touch works well as a development device. So if you don't need any of the features of the iPhone, it's a good, cheaper, alternative.