Polidea / ios-class-guard

Simple Objective-C obfuscator for Mach-O executables.
http://www.polidea.com
1.64k stars 241 forks source link

xctool: command not found #13

Closed tangqiaoboy closed 9 years ago

tangqiaoboy commented 9 years ago

Dear author,

When I ran the sample project, it reported the error message xctool: command not found.

I guess the xctool should be the tool from facebook (https://github.com/facebook/xctool), but facebook's xctool is a batch file, so it should be xctool.sh.

Please help me, the detailed console log is below:

+ PROJECT=SWTableViewCell.xcodeproj
+ SCHEME=SWTableViewCell
+ TARGET=SWTableViewCell
+ CONFIGURATION=Release
+ SDK=iphoneos
+ git reset --hard
HEAD is now at 1d0469d Integrate iOS-Class-Guard
+ git clean -fdx
+ [[ -f Podfile ]]
+ xctool -project SWTableViewCell.xcodeproj -scheme SWTableViewCell -configuration Release -sdk iphoneos clean build OBJROOT=build/ SYMROOT=build/
obfuscate_project: line 19: xctool: command not found
tangqiaoboy commented 9 years ago

Update:

I changed xctool to xctool.sh, then I passed the build.

However, I met another error:

 //
 // Prefix header for all source files of the 'SWTableViewCell' target in the 'SWTableViewCell' project
 //
...skipping...
2014-09-22 14:39:36.845 ios-class-guard[84043:507] Warning: Failed to load: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
2014-09-22 14:39:36.845 ios-class-guard[84043:507] Warning: Couldn't load MachOFile with ID: /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation, adjustedID: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
2014-09-22 14:39:36.867 ios-class-guard[84043:507] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'working directory doesn't exist.'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff8fb0925c __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x00007fff8a4cfe75 objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff8fb0910c +[NSException raise:format:] + 204
    3   Foundation                          0x00007fff87c3c5b1 -[NSConcreteTask launchWithDictionary:] + 604
    4   ios-class-guard                     0x0000000101e82dd4 -[CDSystemProtocolsProcessor systemProtocolsSymbolsToExclude] + 531
    5   ios-class-guard                     0x0000000101e41099 main + 5381
    6   libdyld.dylib                       0x00007fff866945fd start + 1
    7   ???                                 0x0000000000000006 0x0 + 6
)
libc++abi.dylib: terminating with uncaught exception of type NSException
obfuscate_project: line 37: 84043 Abort trap: 6           ios-class-guard --sdk-ios 7.1 -O symbols.h build/$CONFIGURATION-$SDK/$TARGET.app/$TARGET
ayufan commented 9 years ago

It looks like you don't have specified SDK (iOS 7.1) in questioned directory. Can you show output of:

xcode-select -p
xcodebuild -showsdks
tangqiaoboy commented 9 years ago

I am using Xcode5.1.1, the output is:

xcode-select -p
/Applications/Xcode5.app/Contents/Developer
xcodebuild -showsdks
OS X SDKs:
    OS X 10.8                       -sdk macosx10.8
    OS X 10.9                       -sdk macosx10.9

iOS SDKs:
    iOS 7.1                         -sdk iphoneos7.1

iOS Simulator SDKs:
    Simulator - iOS 6.1             -sdk iphonesimulator6.1
    Simulator - iOS 7.0             -sdk iphonesimulator7.0
    Simulator - iOS 7.1             -sdk iphonesimulator7.1
ayufan commented 9 years ago

Try to replace --sdk-ios 7.1 in obfuscate_project with:

--sdk-root /Applications/Xcode5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk
tangqiaoboy commented 9 years ago

Finally , I got a correct result.

Congratulations! Obfuscation completed. You can now build, test and archive Your project using Xcode, Xctool or Xcodebuid...

Thanks very much!