XCode 4.3 & Frank/Cucumber

閲覧: 719 回
最初の未読メッセージにスキップ

Marcos Pianelli

未読、
2012/02/24 13:26:012012/02/24
To: Frank
Hello everybody, I'm writing you because I found something is not
right after the lastest Apple release of iOS SDK 4.3. I spent hours to
find a way to run the command "sudo gem install frank-cucumber" to
install frank-cucumber. I was getting an error about not finding the
file "ruby.h" in the built-in Ruby package. Anyhow that problem was
fixed installing the package "Command Line Tools for Xcode - February
2012" (which was included before in previous versions of XCode).

Now when I try to run "my_first.feature" from the sample project
CountItOut with cucumber "cucumber my_first.feature" I get the
following error :

Feature:
As an iOS developer
I want to have a sample feature file
So I can see what my next step is in the wonderful world of Frank/
Cucumber testing

Scenario: #
my_first.feature:6
Rotating the simulator for demonstration purposes
sh: line 1: 6011 Trace/BPT trap: 5 /usr/local/lib/ruby/gems/1.8/
gems/sim_launcher-0.3.7/lib/sim_launcher/../../native/iphonesim
"showsdks" 2>&1
sh: line 1: 6014 Trace/BPT trap: 5 /usr/local/lib/ruby/gems/1.8/
gems/sim_launcher-0.3.7/lib/sim_launcher/../../native/iphonesim
"launch" "/Users/marcospianelli/Library/Developer/Xcode/DerivedData/
CountItOut-dnradmwedccxvycntopwtxlcgkkh/Build/Products/Debug-
iphonesimulator/CountItOut.app" "" "iphone" 2>&1

PING FAILED!!!!!!!!!
PING FAILED!!!!!!!!!!!!!

As far as I could understand the sim_launcher can not find the sdk and
thus it can not lunch the application. I imagine that since Apple
release the new SDK 4.3 that you must download from the App Store, all
the old paths to the sdk are no longer working. Did someone else had
the same problem? I would really appreciate some help to fix this.

Thanks,


Marcos

Marcos Pianelli

未読、
2012/02/24 13:29:382012/02/24
To: Frank
Also when I try to run "sim_launcher" using command the server starts
and when I visit "http://localhost:8881/showsdks" I get the following
message :

"dyld: Library not loaded: @rpath/
iPhoneSimulatorRemoteClient.framework/Versions/A/
iPhoneSimulatorRemoteClient
Referenced from: /usr/local/lib/ruby/gems/1.8/gems/
sim_launcher-0.3.7/lib/sim_launcher/../../native/iphonesim
Reason: image not found"

Michael Latta

未読、
2012/02/24 13:31:062012/02/24
To: frank-...@googlegroups.com
Note that all the dev tool apps have moved from /developer to inside xcode.app under applications. There may be some hard coded paths that need to be fixed for this to work with 4.3.

Michael

Michael Latta

未読、
2012/02/24 13:32:012012/02/24
To: frank-...@googlegroups.com
You may be able to create /developer and some symlinks under that to make this work until the sources are updated.

Michael

Geoffrey Peter Verdouw

未読、
2012/02/24 18:29:332012/02/24
To: frank-...@googlegroups.com
Hi Michael,

It seems the newest sim_launcher should include changes which would enable it to work with Xcode 4.3, but I just tested it and it doesn't appear to work.

I have a custom build of the sim_launcher gem that I have been using which I will email to you to use until the official gem works.

Cheers,
Geoff

Michael Latta

未読、
2012/02/24 19:00:082012/02/24
To: frank-...@googlegroups.com
Thanks. No hurry on my part, I am still on 4.2.

Michael

kra Larivain

未読、
2012/02/24 19:21:342012/02/24
To: frank-...@googlegroups.com
Hey,

I just ran briefly through the thread, but having just installed Xcode 4.3 on a fresh new box, I've realized Apple implemented their "modules" features of Xcode starting with 4.3.
Xcode doesn't ship with the 4.3 simulator anymore and doesn't install command line tools.
Those have to be downloaded separately through the preferences/downloads pane.

I don't know how this will work when upgrading from 4.2 to 4.3 though.

/kra

Michael Latta

未読、
2012/02/24 19:44:142012/02/24
To: frank-...@googlegroups.com
They have stated that an upgrade to 4.3 will delete the /developer directory and all its contents, and the various command line tools, then you need to select the components you want installed in the 4.3 way.

Michael

Stewart Gleadow

未読、
2012/02/25 1:11:082012/02/25
To: frank-...@googlegroups.com
I think in Xcode 4.3, as well as everything moving around, there are also a bunch of dynamic libraries missing, so maybe that's also causing an issue with iPhoneSimulatorRemoteClient

I think the new 4.3 structure is a lot nicer and more self contained, but it is going to be a pain for a little while until all the third party tools that assumes /Developer locations get upgraded.

Does Apple provide any environment variables for the developer root directory that we could use instead of hardcoding? I think within Xcode there are paths like this - if you look at the shell script that runs OCUnit tests as part of the build, it references SYSTEM_DEVELOPER_DIR. Not sure if we can use them outside Xcode though.

- Stew

Dale Emery

未読、
2012/02/25 4:46:322012/02/25
To: frank-...@googlegroups.com

> I think in Xcode 4.3, as well as everything moving around, there are also a bunch of dynamic libraries missing, so maybe that's also causing an issue with iPhoneSimulatorRemoteClient
>
> I think the new 4.3 structure is a lot nicer and more self contained, but it is going to be a pain for a little while until all the third party tools that assumes /Developer locations get upgraded.
>
> Does Apple provide any environment variables for the developer root directory that we could use instead of hardcoding? I think within Xcode there are paths like this - if you look at the shell script that runs OCUnit tests as part of the build, it references SYSTEM_DEVELOPER_DIR. Not sure if we can use them outside Xcode though.


For some reason, early in my development of Victor (my Java front end for Frank) I abandoned the third-party launcher and launched the simulator via the command line. Like this:

<simulator-path> -SimulateApplication <application-path> -SimulateDevice <device-name> -currentSDKRoot <sdk-root>

The variable bits are:

<simulator-path> -- the path to the simulator executable (inside the iPhone Simulator.app bundle). See below.

<application-path> -- the path to your iOS app executable (inside your .app bundle).

<device-name> -- which device you want to simulate: iPhone, iPhone (Retina), iPad.

<sdk-root> -- the path to the iPhone Simulator SDK that you want to run against (which determines which version of the iOS to simulate).

Given that the simulator executable and the simulator SDKs all live in predictable places below the Developer directory, all you gotta do is specify which Developer directory and iOS version to use, and you can calculate the rest. Here's some pseudocode:

// Set these two parameters...
DEVELOPER_DIR = /Applications/Xcode.app/Contents/Developer
IOS_VERSION = 5.0

// Then calculate the rest...
PLATFORM_DIR = ${DEVELOPER_DIR}/Platforms/iPhoneSimulator.platform
SIMULATOR_PATH = ${PLATFORM_DIR}/Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone Simulator
SDK_ROOT = ${PLATFORM_DIR}/Developer/SDKs/iPhoneSimulator${IOS_VERSION}.sdk

It probably wouldn't be difficult to create a Cucumber step to build those paths and launch the simulator directly.

Dale

--
Dale Emery
Consultant to software teams and leaders
http://dhemery.com

Marcos Pianelli

未読、
2012/02/28 8:27:122012/02/28
To: Frank
Hello everyone!. A couple of days ago Geoffrey Verdouw sent me a
modified version of sim_launcher to work with XCode 4.3 I just
installed it using the following command : " gem install /Path_to/
sim_launcher-0.3.7.gem" and run cucumber again, worked like a champ.
If you still have the same problem you can download the modified
version here :

http://dl.dropbox.com/u/2319924/sim_launcher-0.3.7.gem

Good coding!

Pete Hodgson

未読、
2012/02/28 10:49:492012/02/28
To: frank-...@googlegroups.com、Frank
If someone sends a pull request I'd be more than happy to release a new version of the gem that fixes this.

Cheers,
Pete
--
Typed on a little bitty keyboard

Francis Chong

未読、
2012/02/28 13:37:132012/02/28
To: Frank
I was trying to patch Sim-Launcher to use only command line:
https://github.com/siuying/Sim-Launcher

The interface is not changed, but now start an simulator it take the
path to executable rather than path to app bundle (executable-path =
"#{bundle-path}/#{executable-name}"

It work on standalone, but not working with frank-cucumber ... I
should look into frank-cucumber code tomorrow...

On 2月28日, 下午11時49分, Pete Hodgson <phodg...@thoughtworks.com> wrote:
> If someone sends a pull request I'd be more than happy to release a new version of the gem that fixes this.
>
> Cheers,
> Pete
> --
> Typed on a little bitty keyboard
>

Pete Hodgson

未読、
2012/02/28 17:48:332012/02/28
To: Frank
Hey Dale,

I tried using your approach, but any apps I try to start crash on
launch. I tried with a couple of different apps and saw the same
issue. Note that I'm still on XCode 4.2 here. Here's the command I'm
using and the crash report, in case anyone can figure out what might
be going on:

Here's the command:

$> "/Developer/Platforms/iPhoneSimulator.platform/Developer/
Applications/iPhone Simulator.app/Contents/MacOS/iPhone Simulator" -
SimulateApplication /Users/pete/Library/Developer/Xcode/DerivedData/
EmployeeAdmin-fceqhbdddlwyviabnxngjbffcivy/Build/Products/Debug-
iphonesimulator/EmployeeAdmin.app -SimulateDevice iPad -
currentSDKRoot /Developer/Platforms/iPhoneSimulator.platform/Developer/
SDKs/iPhoneSimulator5.0.sdk


And here's the top of the crash report:

Process: iPhone Simulator [60825]
Path: /Developer/Platforms/iPhoneSimulator.platform/
Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone
Simulator
Identifier: iPhone Simulator
Version: ??? (???)
Code Type: X86 (Native)
Parent Process: iPhone Simulator [60815]

Date/Time: 2012-02-28 14:45:10.242 -0800
OS Version: Mac OS X 10.7.3 (11D50b)
Report Version: 9

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000

Application Specific Information:
objc[60815]: garbage collection is OFF
*** multi-threaded process forked ***

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.apple.Foundation 0x9b7d6c27
___NEW_PROCESS_COULD_NOT_BE_EXECD___ + 7
1 com.apple.Foundation 0x9b6a96b8 -[NSConcreteTask
launchWithDictionary:] + 4773
2 com.apple.Foundation 0x9b6a840e -[NSConcreteTask launch]
+ 40
3 com.apple.iphonesimulator 0x000119f7 0x1000 + 68087
4 com.apple.iphonesimulator 0x00011915 0x1000 + 67861
5 com.apple.iphonesimulator 0x00005841 0x1000 + 18497
6 com.apple.iphonesimulator 0x0000753e 0x1000 + 25918
7 com.apple.CoreFoundation 0x94ad228a -[NSObject
performSelector:] + 58
8 com.apple.CoreFoundation 0x94ad2207 -[NSSet
makeObjectsPerformSelector:] + 247
9 com.apple.AppKit 0x9bc37c1f -[NSIBObjectData
nibInstantiateWithOwner:topLevelObjects:] + 1315
10 com.apple.AppKit 0x9bc2d992 loadNib + 380
11 com.apple.AppKit 0x9bc2cd79 +[NSBundle(NSNibLoading)
_loadNibFile:nameTable:withZone:ownerBundle:] + 235
12 com.apple.AppKit 0x9bc2cc83 +[NSBundle(NSNibLoading)
loadNibFile:externalNameTable:withZone:] + 154
13 com.apple.AppKit 0x9bc2cbb7 +[NSBundle(NSNibLoading)
loadNibNamed:owner:] + 418
14 com.apple.AppKit 0x9beb4000 NSApplicationMain + 445
15 com.apple.iphonesimulator 0x00002c55 0x1000 + 7253

Thread 0 crashed with X86 Thread State (32-bit):
eax: 0xa1a1a1a1 ebx: 0x943a1e89 ecx: 0x00000000 edx: 0x00000000
edi: 0x0015d4c0 esi: 0x9b6a8424 ebp: 0xbfffef58 esp: 0xbfffef50
ss: 0x00000023 efl: 0x00000286 eip: 0x9b7d6c27 cs: 0x0000001b
ds: 0x00000023 es: 0x00000023 fs: 0x00000000 gs: 0x0000000f
cr2: 0x00075000
Logical CPU: 0

Geoff Verdouw

未読、
2012/02/28 17:21:242012/02/28
To: frank-...@googlegroups.com
Hey Pete,

The gem I sent to Marcos was just the source you have already pulled. When I built it myself it seems to work, but the official gem doesn't.

Cheers,
Geoff 

Dale Emery

未読、
2012/02/28 18:55:452012/02/28
To: frank-...@googlegroups.com
Hi Pete,

I think you need to point at the executable /inside/ your .app package/file.

Dale

Pete Hodgson

未読、
2012/03/01 23:51:022012/03/01
To: Frank
I received a pull request that hopefully resolves this issue for 4.3
users without breaking anything for 4.2 and earlier users.

I'd be grateful is folks could pull sim_launcher 0.3.8 and check
whether it resolves the issue. Please report back to this thread with
a yay or nay, and specify which version of XCode you're using. Thanks
very much!


On Feb 28, 2:21 pm, Geoff Verdouw <gverd...@gmail.com> wrote:
> Hey Pete,
>
> The gem I sent to Marcos was just the source you have already pulled. When
> I built it myself it seems to work, but the official gem doesn't.
>
> Cheers,
> Geoff
>
> On 29 February 2012 02:49, Pete Hodgson <phodg...@thoughtworks.com> wrote:
>
>
>
>
>
>
>
> > If someone sends a pull request I'd be more than happy to release a new
> > version of the gem that fixes this.
>
> > Cheers,
> > Pete
> > --
> > Typed on a little bitty keyboard
>

SorenToft

未読、
2012/03/02 7:53:492012/03/02
To: Frank
Hi

Just wanted to let you know it solved the problem for me.
I am running Xcode 4.3. I am building against the 5.0 SDK and running
my app on the 4.3 simulator.

Rodney Degracia

未読、
2012/03/08 17:18:402012/03/08
To: frank-...@googlegroups.com

Pete,

I would like to test, but I will need the URL to pull the source of the sim_launcher 0.3.8

Do you have a test procedure document that I can follow?

Rodney

Peter Hodgson

未読、
2012/03/08 17:30:012012/03/08
To: frank-...@googlegroups.com
Hey Rodney,

You can visit https://rubygems.org/gems/sim_launcher and use the download link there to get the gem, which includes the native binary. Oh, actually you can just grab it from the github repo: https://github.com/moredip/Sim-Launcher/tree/master/native

Cheers,
Pete

Rodney Degracia

未読、
2012/03/09 11:21:502012/03/09
To: frank-...@googlegroups.com


Pete,

Thanks. I tested sim_launcher-0.3.8 and it looks like the sim_launcher-0.3.8 works good  with XCode 4.3.1

Here is my test procedure, in case anyone else wants to test:

1) Install Xcode command line tools via Preferences-Download Panel
2) ln -s /Applications/Xcode.app/Contents/Developer /Developer
3) xcode-select -switch /Developer
4) rvm use 1.8.7
5) rvm gemset use frank-0.8.8   #current production frank
6) gem install sim_launcher -v 0.3.8 #update the sim launcher
7) created and successfully ran a feature to launch the simulator



Rodney 


Stewart Gleadow

未読、
2012/03/12 16:26:102012/03/12
To: frank-...@googlegroups.com
It seems like Apple is moving away from /Developer, so I'm not sure I'd go sym linking it back again. If you want the scripts to work on Xcode 4.2 and 4.3 style, use this variable in your scripts:

XCODE_PATH=`xcode-select -print-path`

it will be /Developer on Xcode 4.2 and /Applications/Xcode.app/Contents/Developer on Xcode 4.3

- Stew

kra Larivain

未読、
2012/03/12 16:32:592012/03/12
To: frank-...@googlegroups.com
Just tested the updated gem, worked like a charm for me.

/kra

Hlacos

未読、
2012/03/13 11:16:582012/03/13
To: Frank
In terminal: sudo xcode-select -switch /Applications/Xcode.app/
Contents/Developer/
Worked for me.
メッセージは削除されました

Michal K

未読、
2012/04/10 10:56:202012/04/10
To: frank-...@googlegroups.com
If your xcode-select version is 2307 (if you installed new Command Line Tools for Xcode), then "sudo xcode-select -switch /Applications/Xcode.app" is sufficient. xcode-select will figure out the Contents/Developer for itself.

Tim Duckett

未読、
2012/05/05 16:25:132012/05/05
To: frank-...@googlegroups.com
Hello all,

I'm struggling to get the Simulator working correctly from Cucumber - the Simulator app will fire up, but sits with a black screen while the terminal shouts about the ping failing.  Everything else appears OK - the Simulator will fire up from Xcode, and the Symbiote server is running happily.

I'm running Xcode 4.3.2 and the Simulator is 5.1 - I've updated both the sim_launcher to 0.3.8 and Command Line Tools to 2307.  XCODE_PATH is set to `xcode-select -print-path` in env.rb.   Does anyone have any suggestions?

Thanks

Rodney Degracia

未読、
2012/05/05 17:10:022012/05/05
To: frank-...@googlegroups.com

Tim,

I believe XCode 4.3.2 has a different build-products location:

/YOURAPP/Build/Products/Debug-iphonesimulator/APP-FRANKIFIED.app/

You may need to modify your APP_BUNDLE_PATH constant in your features/support/env.rb file.


Rodney

Dale Emery

未読、
2012/05/05 17:33:192012/05/05
To: frank-...@googlegroups.com
Hi Tim,


Hello all,

I'm struggling to get the Simulator working correctly from Cucumber - the Simulator app will fire up, but sits with a black screen while the terminal shouts about the ping failing.  Everything else appears OK - the Simulator will fire up from Xcode, and the Symbiote server is running happily.

I'm running Xcode 4.3.2 and the Simulator is 5.1 - I've updated both the sim_launcher to 0.3.8 and Command Line Tools to 2307.  XCODE_PATH is set to `xcode-select -print-path` in env.rb.   Does anyone have any suggestions?

I use a different method to launch the simulator, but I wonder if I'm seeing the same thing.  It manifests for me as the app taking a long time to load—anywhere from 12 to 25 seconds for my stupid simple example app.

What appears to happen is this:  When I launch the simulator from Victor (my test rig), the simulator loops looking for some resources that just aren't there.  (I found entries in some log by using Console.app.)  This chews up CPU time (check Activity Monitor to see if this is happening for you), and makes launching the app take a long time.  Eventually the app does come up.  Sometimes it continues to respond very slowly, likely because the simulator is still looping, waiting for those resources that will never arrive.

People have observed a similar problem when they run unit tests in Xcode.

From somewhere on the internet, I read an explanation:  The simulator uses several daemon processes to do its work.  When you launch the simulator in a certain way (e.g. launch an app via Xcode), if the required daemon processes aren't running, Xcode (or the simulator itself) starts them.  When you shut down the simulator, the daemon processes continue to run.

Launching the simulator in certain other ways (e.g. the way Victor launches the simulator, or trying to run unit tests in Xcode) does /not/ create the required daemon processes.  So if the daemon processes haven't been launched already, the simulator spins itself dizzy looking for them.

The situation where this is a problem is this:  You've rebooted your computer, and have not yet used the simulator in a way that launches the daemon processes needed by the simulator.

The workaround:  Whenever you reboot, run the simulator in such a way as to launch the daemon processes.  Launching the app in Xcode is one way to do this.  Another possibility is to just run iPhone Simulator.app directly (via command line or double-clicking in Finder). I don't know for sure whether this second method works reliably.

Like I said, my test rig doesn't use Frank's sim launcher.  Instead, it launches the app and simulator itself using the command line, like this:
So perhaps I'm seeing a different phenomenon.

Tim Duckett

未読、
2012/05/06 12:38:502012/05/06
To: Frank
Thanks all - it was the build products directory that was incorrect.
It needed to be something along the lines of

/Users/<username>/Library/Developer/Xcode/DerivedData/<app_name>/Build/
Products/Debug-iphonesimulator/<Frankified target name>.app

where the <app_name> directory has the eleventy-billion-character
string appended to the actual app name itself.

Incidentally, in the process of browsing around I came across a pull
request for Frank which suggests using build script on the Frankified
target to update this automagically - I've added this as a build
script:

# update the cucumber env.rb file with the frankified target location
echo "require 'frank-cucumber'; APP_BUNDLE_PATH = \"${BUILD_DIR}/Debug-
iphonesimulator/${PRODUCT_NAME}.app\"" > ${SRCROOT}/Frank/features/
support/env.rb

and it works like a charm. The original pull request is at
https://github.com/moredip/Frank/pull/16

Thanks once again for the help!
全員に返信
投稿者に返信
転送
新着メール 0 件