icuke with xcode 4 times out - iphone

Anyone get iCuke to work with XCode 4?
I'm trying to follow the iCuke tutorial at http://pragprog.com/magazines/2010-07/bdd-on-iphone-icuke
I get a time out error when trying to run the first feature:
Given "QuickContacts.xcodeproj" is loaded in the simulator # iCuke-0.6.3/lib/icuke/cucumber.rb:197
execution expired (Timeout::Error)
/opt/local/lib/ruby/1.8/timeout.rb:64:in `start'
/opt/local/lib/ruby/1.8/net/http.rb:1035:in `request'
features/add_contact.feature:7:in `Given "QuickContacts.xcodeproj" is loaded in the simulator'

I had all kinds of problems getting this (more precisely iCuke in general) to work a few days ago. I'm afraid in the end I abandonded it and went for Frank instead.
That said I had the same problem with Frank but I found a better solution to the problem than fixing the XCode integration (imho). Take a look at this project: I whipped up a cucumber step to boot my binaries in the simulator without the need for crufty Applescripts that convince XCode to do your bidding. Perhaps you can do something similar for iCuke?
For anyone interested...our step looks something like this:
def run_app_in_simulator
target = ENV['TARGET_PATH'] // how you set this is down to you....
if not system('ios-sim', 'launch', target, '--verbose', '--sdk', '4.2', '--exit', '--family', 'ipad')
raise "Unable to launch simulator"
end
end

After tinkering around a little bit in xcode, I was able to get past the timeout issue.
It looks like this can be resolved if "Universal Access" is enabled:
Click on "Xcode -> Preferences->Documentation" , ensure that Universal Access is selected.

Related

"The application does not have a valid signature" Xcode 4.3

I'm getting the weirdest error today.
"The application does not have a valid signature"
I get this error when I try to run the application from Xcode 4.3 on my device. Also when I archive it shows it as a generic archive instead of a real app.
Of course I deleted all of the invalid profiles, cleaned my derived data, cleaned my target, and restarted. No luck.
EDIT: Turns out that I had a folder reference in my app. I removed all of the references to the folders and made them groups and it worked!
Just throwing this out there, might help someone in the future (and also would be good for my future reference).
I have a bigger project with 2 projects within (an API and the main project that is running on the device itself and which uses the API).
I have solved this problem by cleaning both projects and then rebuilding them.
Ohhh...Cleaning the Project solved my problem..cheers :)
This saved me: http://www.two-tails.com/2010/01/12/the-application-does-not-have-a-valid-signature/
Basically you cannot have a folder reference called "resources"! I changed to "rsrc" and magic.
You can get a more detailed error message in the device log, which is extremely valuable for debugging this issue.
In XCode 7.3: Window -> Devices -> Select your device -> At the bottom there is an error log with detailed information.
For example in my case it outputs something like this:
Failed to install application at file:///var/mobile/Media/PublicStaging ... : Error Domain=LaunchServicesError Code=0 "(null)" UserInfo={Error=ApplicationVerificationFailed, ErrorDetail=-402620391,
ErrorDescription=Failed to verify code signature of
/private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.iKT2NH/extracted/XYZ.app
/Frameworks/Raygun4iOS.framework : 0xe8008019 (The application does not have a valid signature.)}
So in my case it is somehow caused by the Raygun framework that I have installed.
Turns out that I had a folder reference in my app. I removed all of the references to the folders and made them groups and it worked!
Also, make sure that when you go to Product > Scheme > Edit Scheme the Build Configuration is set to Running.
I struggled with this for a few hours, but it seems that if you have a framework listed under "Embedded Binaries" as well as being imported through a swift bridging header, this error comes up. I am running XCode 8 with iOS 10. I would try removing your framework from the embedded binaries tab under general settings of your XCode projects. Hope this helps out some person in the future!

Xcode won't build to device

This problem has been KILLING me. I've been working on this app for 8 Months, and I am so close to finishing, I just can't seem to build for device. Building for the simulator works fine, but device always gives me the SAME 2 errors.
The 1st Error:
"Instruction requires a CPU feature not currently enabled"
From googling, I've found this probably means I'm not linking a binary I should be, but I'm not sure.
The 2nd Error:
If you can't read it, it says: Generating JWFNS.app.dSYM ... error: unable to open executable '/Users/ajr1188/Library/Developer/Xcode/DerivedData/JWFNS-azshgysfabycfagnebotitpcyaww/Build/Products/Debug-iphoneos/JWFNS.app/JWFNS'
This is the big one. I cannot seem to build the .app.dSYM file properly. I went in and deleted the build folder, I looked at EVERY stackoverflow question I could find and tried changing any random thing mentioned in another question, but all of it is to no avail. I'm so suck right now. AHH. PLEASE. Any help would be so appreciated!
Maybe your project has become hopelessly corrupted. One thing to try is to start a brand new project and copy/import all your sources/assets into the new project to see if that fixes the problem.
Another less nuclear (but perhaps more time consuming) approach is to binary search the build. Exclude absolutely everything except main.m and see if that fixes the problem. If it does, include half your sources, and buid again....repeat, trying to narrow in on the problem spot. Maybe a file or group of files has received special build settings that don't belong there.
I've had very similar problems, I cant remember the exact error message but it was very similar. Are you able to make a new project that will run on your device?
if so (and I know this sounds bad but it's worth a try) Create a new project and simply copy all the code and resources across and see if it still works. If it doesn't then there is something wrong with you code and you can continue trying to isolate the problem from there.
Hope this is helpful.
check the frameworks you link to. there's a chance that you linked a framework (say quartz) of osx, instead of ios.
Answering in detail is probably going to take looking at your target settings. But it looks like you may be building for the wrong architecture. (It doesn't link, so there is no .dSYM symbol file.) For example, if you have only recently built for device, you probably created your project under an older Xcode, and it may not have the arm6/arm7 settings right.
To check, show the Build Settings for your target (not the project), and filter on Architecture.
Make sure that in build settings the architectures are armv6 and armv7. Also make sure that in .plist file, the "Application requires iPhone environment" is TRUE. Delete "Required device capabilities" in the .plist if present.

SentTestCase doesn't highlight UnitTest failures as errors in code

I have setup UnitTests for some of the logic of my iphone app, I followed apple's guide for UnitTests in XCode, however when some of the assertions fail - instead of highlighting the place directly in code like a regular compilation error - XCode just displays the number of errors in the bottom-right corner and I have to look up the errors in the output log. Does anyone know what additional steps one has to take to make XCode highlight assertion failures in UnitTests like regular errors in code?
This is a known bug in Xcode. I don't think it has worked for at least as long as version 3.2.x but it might have broken earlier. I filed a bug report with Apple back in march but it got closed as a duplicate so they are aware of the problem. I don't imagine it will get fixed in the 3.X incarnation since Xcode 4 is on its way.

Unit Testing broken in iOS 4.1 SDK?

After upgrading to the 4.1 iOS SDK my unit test bundles always return with the following two errors and one warning:
An internal error occurred when handling command output: -[XCBuildLogCommandInvocationSection setTestsPassedString:]: unrecognized selector sent to instance
An internal error occurred when handling command output: -[XCBuildLogCommandInvocationSectionRecorder endmarker:]: unrecognized selector sent to instance
Run unit tests for architecture 'i386' (GC OFF) did not finish
I get these errors despite it reporting that all X out of X tests passed. I read about a similar bug in an older version of XCode that also occurred immediately after it was released (something about a bug in a regular expression for time) that could be mitigated by setting your time zone to Pacific Time, but I can't say for sure it's a regression to there specifically.
Is anyone else having this problem?
There is a fix available on the apple dev forums,
https://devforums.apple.com/thread/68687
it's a date parsing problem. The fix is quick, it requires including one .m added to your test bundle. The fix is available above or from:
http://gist.github.com/586296
It does seem to be a regression with some part of the reporting code not respecting timezone issues. The output is tagged as ending before it began, so gets very confused and chokes.
One work-around, that I found somewhere on Google, is to change the Run Script stage of the target.
Change
"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests"
to
"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests" 1> /tmp/RunUnitTests.out
It’s working round the issue, rather than solving it, but does work.
This is a confirmed bug in Xcode 3.2.4/4.1 SDK. It has been reported to Apple.
Upgrading to Xcode 3.2.5/4.2 beta SDK solves the problem. I don't know if access to beta SDK:s is open, or if you need to be a registered developer, though.
I'm getting the same issue too.
Oddly enough, I can get the unit tests to complete properly by running them through the debugger as per http://www.grokkingcocoa.com/how_to_debug_iphone_unit_te.html
So it looks like something wrong with the XCode interface to otest...
I really don't want to set my timezone to PST which this post seems to be indicating as I'm in the UK...

Xcode falsely claims CFBundleExecutable to be (null)

I'm trying to create an ad-hoc build of an iPhone app for beta testing.
On their end, they're seeing an error like the following:
"The info.plist for application at xxx specifies a CFBundleExecutable of (null), which does not exist"
Here is an excerpt from the actual info.plist:
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
And it clearly is not null.
What am I doing wrong here?
The WORKING SOLUTION is this (and only this):
In Xcode, choose “Executables” from the project hierarchy. Click your project executable then press Command-I. Choose the General tab and set the working directory to “Build Products directory”.
Found via BrainwashInc, who credits MacHackShack. I thought this valuable information was way too important to leave floating around on random blog.
It seems like sometimes XCode may flip this setting, as I suddenly started having this issue, and the fix above repaired it. Changing it back to "project directory" reproduces the issue for me, every time.
I also had to restart XCode to get the debugger to work once this fix installed the app, that may be unrelated.
I don't think there is ONE working solution to this. I found several solutions that doesn't work for me. At the end, I did find one solution.
By deleting whatever I had in the "Producs" folder in xCode I managed to get it working. I am using xCode 3.2.1.
Note: I did the change regarding "Build Products directory” above as well, perhaps both solutions needs to be implemented, up to you to try it out.
This is, to say the least, quite anoying. As a beginner, things are complicated enough without bugs in the SDK...
Hope this will help someone out there!
Cheers
It sounds like you're looking at the info.plist in the project not the built product.
The '${EXECUTABLE_NAME}' in the project info.plist is just a place holder for a variable in the build script. You need to look at the info.plist in your built product to see what is listed there. It sounds like for some reason, the build script is not populating the field as it should.
You might actually check that the contents of the application package actually has an executable. Sounds weird I know but a few years ago I mucked about with my build setting son a project and ended up with a product without an executable. Everything else, the package, resources, string files etc was there just no actual program.
This is a know issue of SDK:
Changing an iPhone Executable's working directory from “Build Products directory” may cause the application not to install properly with the error message “The Info.plist for application at (null) specifies a CFBundleExecutable of (null), which does not exist.”
as you can see here:
http://developer.apple.com/iphone/library/releasenotes/General/RN-iPhoneSDK-3/index.html
For me, it worked to change the working directory.
I created the problem deleting by hand the build directory.