Debugging frankified app in XCode

601 views
Skip to first unread message

michaelklimczak

unread,
Oct 30, 2012, 11:53:45 AM10/30/12
to frank-...@googlegroups.com
Hello

I'm having trouble figuring out how to run our frankified app and be able to debug in Xcode. My desire is to figure out what happends when the app crashes and we receive the FrankNetworkError (http://rdoc.info/github/moredip/Frank/Frank/Cucumber/FrankNetworkError). 
In this case we are calling frankly_map("view:'<CustomClass>'", "touchx:y:", 200, 200 ). 

I've tried using steps 3-7 from this article:
which doesn't seem to work (blank simulator window), but not sure if this is the relevant way since we have frankified the app using the new way with frank setup/build(http://blog.thepete.net/blog/2012/06/24/writing-your-first-frank-test/)

I'm running Frank 0.9.6 / Xcode 4.5.

All help appreciated.
Thanks
Michael

Stewart Gleadow

unread,
Oct 30, 2012, 6:31:38 PM10/30/12
to frank-...@googlegroups.com
To run it in Xcode, I'm guessing you'll need to set up Frank the old way (duplicating the target and linking the static library manually), since the new way only feeds Frank in on the command line.

If you only need to do this somethings, you could potentially just see what build settings Frank pipes in on the command line, and just add these to your main app target in Xcode manually (and remove them when you're done!)

- Stew

Peter Hodgson

unread,
Oct 30, 2012, 7:09:22 PM10/30/12
to frank-...@googlegroups.com
I am convinced there IS a way to do this via a command to gdb or similar. It should really be 'just' a matter of telling gdb that the Frank project's source code maps to the libFrank symbols in the frankified app.

I could have sworn I got it working at some point, but have never had a chance to re-create the success. :(

do any XCode wizards have any clues?

Aki Koskinen

unread,
Oct 31, 2012, 5:38:27 AM10/31/12
to frank-...@googlegroups.com
I can't call myself a wizard with Xcode but I think I might have a solution for this one. I have done it like this:

In this solution the Frankified application isn't built with Xcode so no changes are needed to any of the build settings of the project in Xcode. Instead the Frankified.app that 'frank build' makes is used directly. So the first step is to build your Frankified.app the usual way with 'frank build'.

Next, create a new scheme in Xcode. The "New Scheme..." item can be found from the "Product" menu for example. In the presented dialog choose "None" as the "Target" and give your scheme a name. Press OK.

In the next dialog make sure "Run" is selected in the left pane (it's probably selected by default) and the "Info" tab is selected in the center of the dialog. Choose "Other..." in the "Executable" dropdown and navigate to your Frankified.app and select it. If all goes well Xcode should now change the "Destination" selection in the upper part of the dialog to an iOS simulator of some kind. I just experienced a moment ago that Xcode didn't do this but restarting Xcode got it behaving again.

Basically this is all that is needed but you can off course tune other settings in the scheme as you wish. Press OK in the end.

Running the Frankified app is now as easy as selecting the newly created scheme and pressing the run button.

Hope this helps. Cheers,
Aki

michaelklimczak

unread,
Nov 1, 2012, 9:42:23 AM11/1/12
to frank-...@googlegroups.com
Thanks, that works! (Now I only need to figure out why touchx:y: crashes....)

I also need to make sure my feature doesn't call the "Given I launch the app" when I want to debug in Xcode. I just commented it out.

StrangerKXH

unread,
Nov 8, 2012, 3:55:04 PM11/8/12
to frank-...@googlegroups.com
Hi i'm experiencing the same problems with touchx:y: crashing, can you post anything you find?

Thanks

michaelklimczak

unread,
Nov 13, 2012, 8:57:46 AM11/13/12
to frank-...@googlegroups.com
I haven't figured it out but I'm looking in to it now, since I have some time now.

I'm trying to touch a component in a window which is not the key window and not seen by symbiote, but should be possible to access according to this post:

Since there were several instances of the custom class I've labeled one (it's in a xib):
frankly_map("view:'NumericKeyboard' marked:'Invisible'", "touchx:y:", 10, 10 )

Two follow up questions:
1. Is it possible to send keyPress events to subcomponents with specific Object IDs using the above call?
2. Is it possible with Frank to send touchx:y: (or keyPress events) from the absolute top of the hierarchy kind of like the UIApplication and then the app would catch the event with whatever window/component is the "first responder" for that coordinate?

Thank

some of my trace

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000

VM Regions Near 0:
--> __PAGEZERO             0000000000000000-0000000000001000 [    4K] ---/--- SM=NUL  /Users/USER/Library/Application Support/iPhone Simulator/*/Frankified.app/***
    __TEXT                 0000000000001000-0000000000348000 [ 3356K] r-x/rwx SM=COW  /Users/USER/Library/Application Support/iPhone Simulator/*/Frankified.app/***

Application Specific Information:
objc_msgSend() selector name: floatValue
iPhone Simulator 358.4, iPhone OS 6.0 (iPhone/10A403)
 

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib               0x02a671ef objc_msgSend_fpret + 19
1   i***                        0x00227276 -[UIView(KIFAdapter) touchx:y:] + 35 (UIView+KIFAdapter.m:34)
2   CoreFoundation                 0x02c241bd __invoking___ + 29
3   CoreFoundation                 0x02c240d6 -[NSInvocation invoke] + 342
4   CoreFoundation                 0x02c2424a -[NSInvocation invokeWithTarget:] + 74
5   i***                        0x00218577 -[Operation applyToObject:] + 947 (Operation.m:81)

michaelklimczak

unread,
Nov 13, 2012, 10:01:48 AM11/13/12
to frank-...@googlegroups.com
Got this in the target log...?:

2012-11-13 15:57:44.133 *******[47803:c07] Using Shelley to select views with selector: view:'NumericKeyboard' marked:'Invisible'

2012-11-13 15:57:44.134 *******[47803:c07] Didn't know how to convert NSNumber to type @

2012-11-13 15:57:44.134 *******[47803:c07] Didn't know how to convert NSNumber to type @

michaelklimczak

unread,
Nov 14, 2012, 3:55:39 AM11/14/12
to frank-...@googlegroups.com
My crash is avoided by calling with coordinates in quotation marks:
frankly_map("view:'NumericKeyboard' marked:'Invisible'", "touchx:y:", "10", "10" )
I guess this might be causingthe messages below. Tried it after reading:
although I'm not sure why this works better. Both are valid ruby calls
The right components are still not touched though...

michaelklimczak

unread,
Nov 14, 2012, 4:49:28 AM11/14/12
to frank-...@googlegroups.com
Solved now by setting Accessibility Enabled and a Accessibility label for the (xib contained) custom keyboard view I was trying to access in a second window.
Thanks!
Reply all
Reply to author
Forward
0 new messages