Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging iPhone App from Command Line

I can do it from XCode, but I want to be able to launch an iPhone App (on the device) from the command line. Is it possible?

Why? Because I want to capture some of the output for semi-automated testing. I'm guessing I need to use a debug build for NSLog output, but I'd also be interested to know about other methods for getting NSLog / stdio data back to the host Mac.

like image 514
atobe Avatar asked Jan 26 '10 11:01

atobe


2 Answers

There is a project on github called titanium_mobile (part of Titanium Developer).

I use a utility from that project called iphonesim. It launches an iPhone app from the command line (though I am not sure how, I think there is a way to do that with SpringBoard.app). If you take a step up one level in the Titanium Mobile code and look at builder.py you can see how they launch an app in the simulator and capture the output.

like image 126
Jackson Miller Avatar answered Sep 19 '22 20:09

Jackson Miller


Ultimately I solved my specific need a different way. I needed to get data from the iPhone's accelerometers into a prototype app in Adobe AIR(Flash).

I used this app on the iPhone which drops UDP packets with X,Y,Z forces in them. http://code.google.com/p/accelerometer-simulator/wiki/Home

Found that from this blog post which might be of interest to people trying to do other similar things. http://ifiddling.blogspot.com/2009/01/dummy2.html

I used a Python script to present a server to Flash, grab UDP accelerometer packets, munge them into AMF and send them to Flash. Flash uses a socket to connect to this server and receive the accelerometer data.

A few parts, but it works nicely.

like image 43
atobe Avatar answered Sep 21 '22 20:09

atobe