johnno1962 / injectionforxcode

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

Hello, john, could you please update the appCode injection plugin? #149

Open oit63 opened 8 years ago

oit63 commented 8 years ago

I found appCode is much more better than the Xcode, but I am familiar with injection in Xcode. when I install the injection plugin for appCode, I found it not work any longer. Could you please update it to the latest version as Xcode version ? Thanks.

johnno1962 commented 8 years ago

AppCode no longer works or you can’t get the injection plugin for AppCode to work?

oit63 commented 8 years ago

yes, I can’t get the injection plugin for AppCode to work. some photos would be commit soon.

johnno1962 commented 8 years ago

Are you seeing the extra menu items on the “Run” menu? Are you sure you installed the jar file?

gderaco commented 8 years ago

I always get the error message 'Injection Plugin - Application not running/connected' after I lunch the app in debug mode and select Run -> 'Inject code'. AppCode 2016.2, plugin installed from the jar in the repo. With XCode 7.3.1 it works perfectly.

johnno1962 commented 8 years ago

Have you repatched the project. AppCode requires patching and uses a different port number.

gderaco commented 8 years ago

Yes, my main.m file ends like this

#ifdef DEBUG
#define INJECTION_PORT 31444 // AppCode
static char _inMainFilePath[] = __FILE__;
static const char *_inIPAddresses[] = {"100.65.32.138", 0};

#define INJECTION_ENABLED
#import "/Users/<my_username>/Library/Application Support/Developer/Shared/Xcode/Plug-ins/InjectionPlugin.xcplugin/Contents/Resources//BundleInjection.h"
#endif
johnno1962 commented 8 years ago

Is this in the simulator or from a device? Is 100.65.32.138 your IP address, is AppCode allowed to received connections via the firewall? Can you telnet to 100.65.32.138, port 31444 from another host?

gderaco commented 8 years ago

Simulator. Yes from another Mac from the same network, I was able to connect to my ip and port with telnet.

johnno1962 commented 8 years ago

Very strange.. are you seeing messages on your console that injection is trying to connect? If not, are you sure DEBUG is defined in your project?

baldursson commented 7 years ago

Does the AppCode plugin really work with Swift? It says "Select text in an implementation file to inject" when I try to inject code.

johnno1962 commented 7 years ago

It should do:

        else if ( selectedFile == null || !Pattern.matches( ".+\\.(m|mm|swift)$", selectedFile ) )
            return alert( "Select text in an implementation file to inject..." );

Do you have the most recent Injection.jar file installed?

baldursson commented 7 years ago

I installed the plugin from within AppCode, maybe there's an old version there. It says version 3.5

johnno1962 commented 7 years ago

Ah, the AppCode Market jar is way out of date. You can get it from here: https://github.com/johnno1962/injectionforxcode/tree/master/InjectionPluginAppCode

johnno1962 commented 7 years ago

I’ve updated it, can you verify it for me please? The version you are after is 3.6.