Xcode 8 Beta - hook fails

Questions and Answers about all things *OS (macOS, iOS, tvOS, watchOS)

Xcode 8 Beta - hook fails

Postby elist » Thu Jun 16, 2016 1:50 pm

Hi J, how are you?

I am using this simple library to dump Xcode's communication with lockdown.

I export DYLD_INSERT_LIBRARIES, and run xcodebuild, but it spits out:

dyld: warning: could not load inserted library '~/Code/xcodehook/xcodehook.dylib' into library validated process because no suitable image found. Did find:

~/Code/xcodehook/xcodehook.dylib: mmap() error 1 at address=0x109EF2000, size=0x00001000 segment=__TEXT in Segment::map() mapping ~/Code/xcodehook/xcodehook.dylib

2016-06-16 15:23:05.226 xcodebuild[23285:425594] [MT] DVTToolchain: Failed to get Swift version for ~/Downloads/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain: Error Domain=DVTToolchainErrorDomain Code=-1 "Failed to parse version from swift --version output" UserInfo={NSLocalizedDescription=Failed to parse version from swift --version output, Stdout=Loaded ComHook!

Apple Swift version 3.0 (swiftlang-800.0.30 clang-800.0.24)

Target: x86_64-apple-macosx10.9

}

...



Same hook works fine on Xcode 7 xcodebuild and even on Xcode 8 beta Application itself.

I'm not sure wether the Swift version parsing error has anything to do with the failure..

Any idea what could be the problem and how I can solve it?

Thanks!
elist
 
Posts: 13
Joined: Wed Mar 16, 2016 9:05 am

Re: Xcode 8 Beta - hook fails

Postby morpheus » Thu Jun 16, 2016 1:55 pm

Probably swift has nothing to do with it; Can you attach the library so I can have a look?
morpheus
Site Admin
 
Posts: 532
Joined: Thu Apr 11, 2013 6:24 pm

Re: Xcode 8 Beta - hook fails

Postby elist » Fri Jun 17, 2016 8:01 am

Sure, here it is
Attachments
hook.zip
(4.11 KiB) Downloaded 174 times
elist
 
Posts: 13
Joined: Wed Mar 16, 2016 9:05 am

Re: Xcode 8 Beta - hook fails

Postby elist » Fri Jun 17, 2016 8:05 am

Your right, when I run "~/Downloads/Xcode-beta.app/Contents/Developer/usr/bin/xcodebuild" with no arguments the Swift error goes away.
elist
 
Posts: 13
Joined: Wed Mar 16, 2016 9:05 am

Re: Xcode 8 Beta - hook fails

Postby morpheus » Mon Jun 27, 2016 10:35 pm

Sorry for having missed your reply!

Your library is fine - it's very AMFI prefending you - due to Library validation. XCode is now signed in a way wherein the software requirements prevents you from tampering with it.

Try removing XCode's signature altogether (jtool -r), and it should work
morpheus
Site Admin
 
Posts: 532
Joined: Thu Apr 11, 2013 6:24 pm

Re: Xcode 8 Beta - hook fails

Postby elist » Mon Jul 11, 2016 11:52 am

Thanks, it works great!
elist
 
Posts: 13
Joined: Wed Mar 16, 2016 9:05 am


Return to Questions and Answers

Who is online

Users browsing this forum: No registered users and 1 guest

cron