johnno1962 / injectionforxcode

Runtime Code Injection for Objective-C & Swift
MIT License
6.55k stars 565 forks source link

xcode 8 run script failed - cannot load image with wrong team ID #169

Closed QuynhNguyen closed 7 years ago

QuynhNguyen commented 7 years ago

I am seeing this in my build log when try to build the plugin. Buid succeeded but the log said otherwise.

Showing All Messages /Library/Application Support/Developer/Shared/Xcode/Plug-ins/InjectionPlugin.xcplugin/Contents/MacOS/InjectionPlugin: cannot load image with wrong team ID in process using Library Validation" UserInfo={NSLocalizedFailureReason=The bundle is damaged or missing necessary resources., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/Library/Application Support/Developer/Shared/Xcode/Plug-ins/InjectionPlugin.xcplugin/Contents/MacOS/InjectionPlugin, NSDebugDescription=dlopen_preflight(/Library/Application Support/Developer/Shared/Xcode/Plug-ins/InjectionPlugin.xcplugin/Contents/MacOS/InjectionPlugin): no suitable image found.

When I try to run my app, I would get

+[BundleInjection load] 192.168.1.70 (see project's main.(m|mm) Injection attempting connection to: 127.0.0.1:31444 Injection: Could not connect: Connection refused

It seems like I may need to modify the run script and replace "iPhone Developer". What would be the appropriate value to replace it? Thanks!

johnno1962 commented 7 years ago

The name of one of your development codesigning keys. Check your KeyChain or try iOS Developer. I mean the name you use to codesign your app when you are developing on a device.

QuynhNguyen commented 7 years ago

I am still getting "no suitable image found." after updating the build phase script

johnno1962 commented 7 years ago

Do you see the injection items on the product menu? I think “unsigning" your xcode is the answer if the plugin is not loading (If you’re prepared to take the risk yourself.) Please look it up on the internet.

QuynhNguyen commented 7 years ago

Thanks John! Seems like that fixed the problem!