an easier way to launch/relaunch apps in the simulator

690 views
Skip to first unread message

Pete Hodgson

unread,
Jan 30, 2011, 3:50:19 PM1/30/11
to Frank
Hi Folks,

I finally got around to packaging up the little http app we use on my
team to help Frank launch iOS apps in the simulator.

The motivation for this was to avoid the fussiness of launching the
app via Xcode automation commands - that required XCode to be running
on the CI server, with the right project open, etc. It also prevented
the CI server from being able to test multiple projects. This new
approach works without XCode running, and allows launching arbitrary
apps in the simulator. It even lets you specify whether you want to
use the iPhone or iPad simulator, and which SDK version you want to
use (great for running regression tests against both iPad 3.2 and 4.2,
for example).

I packaged the app up in a ruby gem, so installing it is as simple as
"gem install sim_launcher". Once installed you launch the server using
the included 'sim_launcher' script. This kicks off a little sinatra
server running on port 8881 (by default, you can specify a port as an
argument to the sim_launcher command).

Once the sim_launcher server is running, you just send an http request
to the appropriate url, specifying which sdk you want to use and the
full path to your app bundle. For example:
http://localhost:8881/launch_ipad_app?sdk=4.2&app_path=%2Ffull_path_to_your_project_file%2Fbuild%2FDebug-iphonesimulator%2Fyour_app.app

If I get a spare moment I'll add a little ruby driver class to make it
trivial to launch the app from a cucumber step. Of if anyone else
would like to do that please go right ahead :)

Cheers,
Pete

Stewart Gleadow

unread,
Jan 30, 2011, 5:02:38 PM1/30/11
to frank-...@googlegroups.com
Thanks Pete. That will make it much easier to integrate with testing the xcodebuild artefacts our CI server already produces.

cheers,
Stew

Pete Hodgson

unread,
Mar 4, 2011, 9:27:56 PM3/4/11
to Frank
As promised, today I did add a client class to the sim_launcher gem,
and modified the frank-cucumber gem to use it as a dependency. Only
took me two months to get around to it. :)

If you check out the EmployeeAdmin example at the head of the repo
you'll see how the sim launcher is used. As always if there are any
questions don't hesitate to send out an email to the group!

Cheers,
Pete


On Jan 30, 12:50 pm, Pete Hodgson <phodg...@thoughtworks.com> wrote:
> Hi Folks,
>
> I finally got around to packaging up the little http app we use on my
> team to help Frank launch iOS apps in the simulator.
>
> The motivation for this was to avoid the fussiness of launching the
> app via Xcode automation commands - that required XCode to be running
> on the CI server, with the right project open, etc. It also prevented
> the CI server from being able to test multiple projects. This new
> approach works without XCode running, and allows launching arbitrary
> apps in the simulator. It even lets you specify whether you want to
> use the iPhone or iPad simulator, and which SDK version you want to
> use (great for running regression tests against both iPad 3.2 and 4.2,
> for example).
>
> I packaged the app up in a ruby gem, so installing it is as simple as
> "gem install sim_launcher". Once installed you launch the server using
> the included 'sim_launcher' script. This kicks off a little sinatra
> server running on port 8881 (by default, you can specify a port as an
> argument to the sim_launcher command).
>
> Once the sim_launcher server is running, you just send an http request
> to the appropriate url, specifying which sdk you want to use and the
> full path to your app bundle. For example:http://localhost:8881/launch_ipad_app?sdk=4.2&app_path=%2Ffull_path_t...

Peter Hodgson

unread,
Jun 21, 2012, 2:10:33 PM6/21/12
to frank-...@googlegroups.com
There isn't a quit_simulator end point :)

It should be really easy to add one though. Take a look at how /launch_iphone_app is implemented: https://github.com/moredip/Sim-Launcher/blob/master/bin/sim_launcher#L42 

A free-hand solution (I'm just coding this in this email so obviously it's not tested) would be something like:

get '/quit_simulator' do
  shared_simulator.quit_simulator
end

I'd happily accept a patch to SimLauncher with that in it, assuming it actually works.

Cheers,
Pete

On Thu, Jun 21, 2012 at 10:36 AM, pat <patt...@gmail.com> wrote:
Hi Pete,

I tried using this url to close the simulator
http://localhost:8881/quit_simulator
but it doesn't work
Do you know what wrong with the URL?

Thank you,

Pat

On Jan 30 2011, 4:50 pm, Pete Hodgson <phodg...@thoughtworks.com>

wrote:
> Hi Folks,
>
> I finally got around to packaging up the little http app we use on my
> team to help Frank launch iOS apps in the simulator.
>
> The motivation for this was to avoid the fussiness of launching the
> app via Xcode automation commands - that required XCode to be running
> on the CI server, with the right project open, etc. It also prevented
> the CI server from being able to test multiple projects. This new
> approach works without XCode running, and allows launching arbitrary
> apps in the simulator. It even lets you specify whether you want to
> use the iPhone or iPad simulator, and which SDK version you want to
> use (great for running regression tests against both iPad 3.2 and 4.2,
> for example).
>
> I packaged the app up in a ruby gem, so installing it is as simple as
> "gem install sim_launcher". Once installed you launch the server using
> the included 'sim_launcher' script. This kicks off a little sinatra
> server running on port 8881 (by default, you can specify a port as an
> argument to the sim_launcher command).
>
> Once the sim_launcher server is running, you just send an http request
> to the appropriate url, specifying which sdk you want to use and the

abaca way

unread,
Jun 26, 2012, 2:52:36 PM6/26/12
to frank-...@googlegroups.com
I tried to set up another machine today (I was successfully using sim_launcher a few days ago)
But for this machine I got this error message when I execute the url

dyld: Library not loaded: @rpath/iPhoneSimulatorRemoteClient.framework/Versions/A/iPhoneSimulatorRemoteClient Referenced from: /Users/ibmemployee/.gem/ruby/1.8/gems/sim_launcher-0.4.2/lib/sim_launcher/../../native/ios-sim Reason: image not found

Do you have any ideas?

Thank you,

Pat

Peter Hodgson

unread,
Jun 26, 2012, 7:45:22 PM6/26/12
to frank-...@googlegroups.com
What versions of XCode do you have installed? Also can you send me the output of the following command:

mdfind iPhoneSimulatorRemoteClient

abaca way

unread,
Jun 27, 2012, 8:47:35 AM6/27/12
to frank-...@googlegroups.com
It returns this

/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/iPhoneSimulatorRemoteClient.framework/Versions/A/Resources/iPhoneSimulatorRemoteClient.strings
/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/iPhoneSimulatorRemoteClient.framework/Versions/A/iPhoneSimulatorRemoteClient
/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/iPhoneSimulatorRemoteClient.framework

and I used Xcode 4.2
I think the problem is @rpath value is incorrect.
Could you please suggest what should I do?
Thanks,
Pat

Peter Hodgson

unread,
Jun 27, 2012, 9:32:02 PM6/27/12
to frank-...@googlegroups.com
can you try running the following:

export DYLD_FALLBACK_FRAMEWORK_PATH=/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks
"/Users/ibmemployee/.gem/ruby/1.8/gems/sim_launcher-0.4.2/lib/sim_launcher/../../native/ios-sim" showsdks

and see if that works?

Thanks for your help with this!
Reply all
Reply to author
Forward
0 new messages