How exactly can I use shark to profile my iPhone app? - iphone

I want to use Shark on OS 10.5 to do some basic profiling of my iPhone game (Open GL ES + Objective C). How exactly can I do this? I've read tutorials but they are too verbose for me after a full day of coding at work and a few hours of iPhone development afterwards.

Build app and launch on device
Launch Shark
From the Shark menu, select Sampling->Network/iPhone Profiling
In the Shark window, select the radio button "Control network profiling of shared computers".
Select your iPhone in the list and optionally configure the profiling session
Press Start to begin profiling, and Stop to end
After that, viewing the profile results is pretty straightforward, assuming you've looked at other profilers before.
Hope this helps!

Shark will only work for iOS devices running version 3.x
As of iOS 4.x, SHARK support has been removed from the OS, with no plans to bring it back.
Apple recommends using Instruments instead.

Right From iOS 4, support for Shark is stopped. INstead we have to use Time Profiler available as part of the Instruments.
A discussion on Apple's Dev forums give information about this:
https://devforums.apple.com/message/243237#243237

Related

iPhone Simulator Display

I'm using Titanium to build my first mobile app. Ultimately, I need to to be universal, but I'm focusing on the iPhone initially in order to learn my way around. I'm running into a problem with image display in that I need to test both the retina and non-retina display, but I can't seem to toggle between the 2.
By default, for whatever reason, my simulator launches with the "old" iPhone resolution (specifically, the combo of iOS 5 -- so location bits mostly work -- and old iPhone hardware). I see in the simulator's Hardware menu that I should be able to switch to iPhone (retina), but attempting to do so just aborts the simulator all together.
Is there a better way to navigate between hardware/software combinations in the simulator? Can the default configuration be changed? Any tips or techniques would be much appreciated by this n00b to mobile dev. For whatever it's worth, the simulator version is 5.0 (272) and, although I'm not developing native code, my XCode version is 4.2.1.
Thanks.
Titanium has a debugger connection running between the simulator and Titanium Studio. When you switch hardware the connection is severed and titanium aborts the simulator all together.
What you can do, is create a build in titanium studio, which builds an Xcode project (project name > build > iPhone).
Then, open this build in xCode, and run it from there. This way there is no debugging session running, but you can test it on multiple devices / OS versions.
Good luck!

Can Applescript identify buttons of applications in the iOS Simulator?

I have to automate the testing for an iOS Simulator application using Applescript. I know that iOS Simulator is not a scriptable application, so i would like to know if Applescript can identify any information about a running application in the Simulator (i.e. Buttons of the menu - the application is not a flash one).
Thank you in advance.
If you want to perform automated testing of your iPhone application in the Simulator or on the device, I highly recommend using the new UI Automation instrument that came with the 4.0 SDK. It lets you create Javascript scripts that interact with the buttons and other accessibility items in your application's interface. It can test for correct operation of your interface, take screenshots (when running on the device), and be paired with other instruments for performance profiling.
I highly recommend watching the WWDC 2010 session video 306 - "Automating User Interface Testing with Instruments".
I also walk through how to use this tool in the "Testing" session of my fall semester Advanced iPhone Development course on iTunes U (that link isn't redirectly correctly right now, so just do a search in the iTunes Store for "advanced iphone development"). I have a sample set of scripts here that can be run against Apple's UICatalog sample application to show off how this works.

What does the "Power Logging" setting in iOS4 do

I noticed a new setting screeen on the iPhone since iOS4: Settings -> Developer (just below iPod, Photos, Store) -> Power -> Logging.
Does anyone know what this does? I could not find anything about it in the documentation or on the net.
This is part of the newest version of Instruments and iOS4. You can record your power usage while your phone is on, running apps, doing whatever you please. You can then load this log into Instruments and see various events and the powerlevels they required. This is great for optimizing games and other high power usage applications.
Is this removed in iOS 4.1? My iPhone 3Gs is developer-sanctioned, and I'm sure I saw the Settings > Developer menu in 4.0.1...

Why is "Run > Run with Performance Tool > Shark" always gray in Xcode? How to call that?

There's this Shark entry in my run menu. But it's always inactive. What's wrong? New xcode with Snow Leopard. Installed all developer tools including CHUD from scratch. Shark itself runs but sees no devices, even though xcode does. it builds and runs on the device. no issues.
I see the same issue when working in iPhone Apps. For MAC Apps it is not greyed out on Snow Leopard for me at least.
So... I suggest build and run your application, then find the Shark Application and launch it manually.
Here is a quick guide I found useful.
http://rudifa.wordpress.com/2009/09/16/profiling-an-iphone-application-with-shark/
Good luck!
Kevin
Just to add to the "real" answer, there are a number of things XCode greys out that are OK to run. You can for example launch Instruments manually and attach to your app to run other instruments XCode would not let you start with, Shark as noted is the same way.

How to test on the IPhone without having access to one?

Want to write a site for the iphone, but I don't have one and I don't know anyone who has one.
Is there a way to develop for it without having access to one, maybe apple has some sort of sim for this or something.
Anyone know of anything?
An iPhone simulator is included with the iPhone SDK, which can be downloaded for free from here:
http://developer.apple.com/iphone/program/start/register/
Or, if you have the Safari web browser, you can use this for a fairly accurate result:
http://www.testiphone.com/ or http://iphonetester.com/
There's a iPhone simulator for Aptana (should work on any system) and an emulator Apple provides (if you have a Mac). I've not tested the Aptana one. The Apple one is pretty good, but it runs most web stuff much faster than the actual device.
Try buying an iPod Touch. It has most of what you need to test your code to make sure it's iPhone ready.
The simulator is available for convenience but you won't be able to check proper HIG such as buttons or text being too small.
For a quick test, try regular Safari zoomed until the dimensions of viewport are similar to those of iPhone. Safari exists for Windows too :) Moreover, you can ask it to present itself as iPhone (in the Develop menu) and try a couple of sites.
For a serious development you definitely need iPod Touch. You'll need to have a familiarity with how interface, both native and mobile web, works. The SDK won't be able to give you that.
I wonder though what kind of application you are developing. I don't think web-based applications are that useful or bring revenue at this moment.
I'd suggest running VM ware booting up Mac OS...
You'll need an intel CPU though but still, worth it.
See here:
How to load Mac OS Lion in a VM