johnno1962 / injectionforxcode

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

help on Library not loaded: @rpath #257

Closed patchthecode closed 5 years ago

patchthecode commented 5 years ago

Using Xcode 10 downloaded Injection here -> johnholdsworth.com/InjectionIII_10.app.zip

I launched your sample app: but got error:

Error loading /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection:  dlopen(/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection, 265): Library not loaded: @rpath/XCTest.framework/XCTest
  Referenced from: /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection
  Reason: image not found
johnno1962 commented 5 years ago

Needs to be /Applications/Xcode10b1.app

patchthecode commented 5 years ago

you mean i need to rename the XCodeBeta app into --> Xcode10b1.app ?

patchthecode commented 5 years ago

i have renamed XCode beta, and now i have this error

Error loading /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection:  dlopen(/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection, 265): Symbol not found: _$SSS5IndexVs10ComparablesWP
  Referenced from: /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection
  Expected in: /Users/LeniJay/Library/Developer/CoreSimulator/Devices/9037F862-3314-439D-B2DC-DB0DF32384BB/data/Containers/Bundle/Application/D9B0038D-B4E1-4B1F-A047-039318004958/GettingStarted.app/Frameworks/libswiftCore.dylib
 in /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection

Any help appreciated

I am using Xcode Version 10.0 beta 3 (10L201y)

johnno1962 commented 5 years ago

I’ve recompiled for Beta 3, can you try again now? Xcode will need to be /Applications/Xcode-beta.app

patchthecode commented 5 years ago

Ok hey, im new to Injection ok. Can you give the instructions to run it again?

Which link do i download the new injection. Is it still here? -> johnholdsworth.com/InjectionIII_10.app.zip

And do i just re-download your sample application? (http://johnholdsworth.com/GettingStarted.zip)

patchthecode commented 5 years ago

what i have done.

  1. redownloaded jinection -> http://johnholdsworth.com/InjectionIII_10.app.zip
  2. re-downloaded sample app -> http://johnholdsworth.com/GettingStarted.zip
  3. downloaded Xcode and placed Xcode in Applications folder Version 10.0 beta 3 (10L201y) /Applications/Xcode-beta.app
  4. run the GettingStarted App

result:

Error loading /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection:  dlopen(/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection, 265): Library not loaded: @rpath/XCTest.framework/XCTest
  Referenced from: /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection
  Reason: image not found

Seems like it went back to the original error.

johnno1962 commented 5 years ago

Did you recopy the new InjectionIII.app to /Applications?

Try an otool -l /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection and ls -l /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks

patchthecode commented 5 years ago

ok. i just again did the 4 steps above. otool -l /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection --> Result --> otoolL.txt and running the following command gives the result

LeniJays-iMac:SampleCalendar-master LeniJay$ ls -l /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks
total 0
drwxr-xr-x  9 LeniJay  staff  306  1 Jul 08:56 XCTest.framework

Just to confirm, the 4 steps above that i did above are correct right? (just checking if i had the correct links)

johnno1962 commented 5 years ago

Looks like you still have the old version. Re-download from http://johnholdsworth.com/injection.html

patchthecode commented 5 years ago

This is the confusing part for me. That web-page has many links on it for injection. Can you confirm that the link for injection that is supposed to work with XCode Beta Version 10.0 beta 3 (10L201y) is -> http://johnholdsworth.com/InjectionIII_10.app.zip ?

Because this is the link i am downloading. Clicking on this link gives me this version of injection.

screen shot 2018-07-10 at 5 20 12 am

I have just re-downloaded that very same link again, and ran the getting started sample file but i am still seeing

2018-07-10 05:15:51.068828-0700 GettingStarted[32366:10138680] libMobileGestalt MobileGestalt.c:890: MGIsDeviceOneOfType is not supported on this platform.
2018-07-10 05:15:51.333171-0700 GettingStarted[32366:10138680] Error loading /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection:  dlopen(/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection, 265): Library not loaded: @rpath/XCTest.framework/XCTest
  Referenced from: /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection
  Reason: image not found
patchthecode commented 5 years ago

I got that link for injection by clicking here

screen shot 2018-07-10 at 5 23 14 am

Is this the correct link i am clicking on? Because it still is not working.

patchthecode commented 5 years ago

i give up. closing this issue. I resorted to going back to Xcode 9.3 and to using the Injection from App store. Thanks.