Measuring FPS/Performance in Xcode/Iphone - iphone

I am running a Sencha Touch application and I am wondering what the best way to measure my FPS while running my app on a device from Xcode? Specifically I have an infinitely scrolling facebook-like wall and I am trying to measure my scrolling performance.

You can use instruments for this! Tap and hold the play button in Xcode and press 'profile' and it will open the instruments app. Use the Core Animation Template. It'll show you FPS to test your scroll performance.

You can also use this tool for measuring FPS on both iOS and Android devices, simultaneously and you dont even need a mac (PC/linux would do!)
https://www.gamebench.net/en/content/gamebench-desktop-profiler

You can use the native CADisplayLink to count frames as they are rendered on the screen. FPSCounter does that.

Related

Making my iPhone 5 app compatible with iPhone 4, iPod Touch, legacy iPhone?

I am new to xcode and mobile app design in general, but was able to pull together some resources and make a nice looking app optimizing for iPhone 5. However, I noticed a few problems with compatibility and am hoping someone can suggest to me a quick fix.
First, I take advantage of the entire iPhone 5 screen size, and when loaded on iPhone 4 or earlier the placement of icons is all awry. Would this be fixed by just making the entire view scrollable somehow? And if so, can someone point me in the right direction to accomplish this?
Second, I've noticed that if I am using my app while in a call (and therefore have the green notification bar at the top) it also causes misalignments for my objects. Is there a way to prevent this?
Thanks for the advice.
If you are targeting iOS 6 you should take advantage of Auto Layout. Here is a good tutorial to get started http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2
Add a Default-568h#2x.png launch image.
and check the all screen.

How to port an app from old iPhone to iPhone 4? (Retina Display)

Sorry if im asking something stupid but please dont shoot me down!
I have done a little playing in xcode but nothing more than a button press counter kindof thing..
I was curious.. when developing with the retina display in mind you obviously produce higher resolutions png's and what not for the new display..
How would you go about making the app run on a lower resolution iPhone?
Would you use the same high res graphics and have the OS do the rest of the work or do you need to write in a chunk of code to switch the graphics based on the device?
Again sorry if its in the documentation but i couldnt find it!
Thanks in advance..
Daniel
You want to read the iOS Application Programming Guide.
Especially Supporting High-Resolution Screens.

App is fast on 3GS but slow on 3G

I'm new to computer coding and have just finished coding an app and tested it on both 3G and 3GS. On 3GS, it worked as normal as on the simulator. However, when I tried to run it on 3G, the app becomes extremely slow. I'm not sure what's the reason and I hope someone could shed some light on me.
Generally, my app has a couple of view controller classes, with one of them being the title page, one being the main page, one is setting, etc. I used a dissolve to transition from the title page to the main page. But even this simple transition shows un-smooth performance on a 3G! My other part of the app involves zooming in to some images by scaling up the images, switching images by push or dissolve upon receiving touch events, saving photos into photo library and storing and retrieving some photos in a folder and some data in a SQlite database, each showing un-smooth actions.
Compared with some heavy graphic or heavy maths app, I think mine is pretty simple. I totally have no clue why the app would behave so slow and un-smooth that it is barely useful on a 3G. Any help/ direction would be much appreciated. Thanks for helping out.
You might want to try profiling your application with Shark to find out where the performance bottlenecks are.
I don't know how relevant it is to your case, but my game (shameless plug) MultiMaze is quite undemanding graphically, and worked beautifully on my 3GS. But when I tried it on a 3G, the frame rate dropped to a glacial 10-20 fps. I ported the whole code base from CoreGraphics to OpenGL ES, and that made a world of difference. It now runs at the limit (60 fps) on my 3GS and very close to it on the 3G.
Are you using a lot of memory? 3G has 128MB while the 3GS has 256MB RAM.
Are you getting memory warnings? In my debug builds I have an NSLog in didReceiveMemoryWarning so I can see if/when I get warnings.
EDIT: Check the size of your photos, are they resized for the iPhone screen or are they original sized?
OK, finally found the problem and got the solution. The problem was that I have about a dozens of transparent images laying on each other to form my main view. So when in any animation, the system needs to redraw on every single layer and calculate their transparent effect and so on. (actually I'm not quite sure, but that's what I think)
The solution I have is to make a temporary composite view containing of them all, and placing the composite as an image in a full screen view before starting any animation. It delays starting the fade a moment, but the fade itself is a lot smoother now.

IPhone application won't launch correctly

So I'm developing and iPhone game right now and everything has been working just fine when I test it on my first gen iPod touch. Last night, I added in some NSUserDefaults stuff to save a few variables for it. I ran it on the simulator a few times and it worked perfectly, but when I built the app and put it on my iPod, all I got when I launched it was a black screen. Anyone have any ideas? They would be much appreciated, thank you.
I recommend deleting the application from your iPod Touch first then trying to install it again. When are you trying to read from NSUserDefaults? In your applicationWillFinishLaunching call? If so, try to comment that out to ensure that it really is the source of your problem.
You need to run it on the iPod touch with the debugger switched on - you should be able to track this down.
Do you know about setting a breakpoint for exceptions - if you tell the debugger to break on objc_exception_throw it is extreemly useful in these cases.
Do you have a custom Default.png file? If no, then you will see a black screen while your application loads. Depending what type of (possibly unending) operations you are doing on load this might be the reason you are seeing a black screen. Remember the simulator runs on top of the processor in your mac which is significantly faster than the processor in your iPod Touch.

iphone: Sending multitouch from the device to the simulator?

I need to record a video of a multitouch game I'm working on, and I'd like to record it from the simulator. My idea was to send touches from the device to the simulator (like this project does with the accelerometer). Just by googling I haven't found anything like that, but before I start implementing it I thought I'd ask here if anyone knows about an already existing solution.
Just to be clear, I do need full multitouch (up to 5 fingers). The pinch and drag that are available on the simulator are not enough.
Matt Gallagher has a writeup on synthesizing touch events, which might provide what you're looking for, although I've not tested it myself.
Check out iSimulate, it is an application/library pair that allows you to use to multi-touch (up to 5 fingers), the accelerometer, and the GPS in the iPhone Simulator. It takes only few minutes to integrate into your iPhone project.