johnno1962 / injectionforxcode

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

Can't Inject Code #109

Closed scorpiozj closed 8 years ago

scorpiozj commented 8 years ago

Environment: Xcode7.2.1, OS X 10.10.5, Obj-C project
I install the plugin following the guide: build the project, and I check that the plugin exists in the directory. When I reopen the Xcode, it doesn't pop the alert which indicates Xcode is loading 3rd plugin. But at the same time, the Inject exists in Product.
I create a simple view-based project, and When I try to inject the source:

  1. add code to my ViewController: - (void)injected, and add breakpoint
  2. build and run my project
  3. in the injected ViewController, click: control+=

Result:

  1. After clicking, project didn't stop at the breakpoint.
  2. if I click 3 times control+=, it will pop up 3 alerts when I stop the running. The alert is attached below.

2016-03-21 4 29 06

Please take a look!

orta commented 8 years ago

What does the injection console say?

scorpiozj commented 8 years ago

Thanks for quick response! I check and find the console is blank.
But I create a new project and follow the guide, the project can be injected!
Now it seems that the existing project can't be injected.

johnno1962 commented 8 years ago

Hi, you noramally get this message if your project doesn’t connect to injection for some reason. Wehn you run your project and try to inject, what does your Xcode debug console say? It should say something about “trying to connect to Xcode”. Is there a red “1” badge on the Xcode Icon?

scorpiozj commented 8 years ago

I just tested the project and found it could be rejected! Close this issue although didn't find why fail to connect to injection.