Code Monkey home page Code Monkey logo

Comments (12)

johnno1962 avatar johnno1962 commented on June 12, 2024 1

Very strange problem. Using the daemon eliminated a couple of things. Could you try switching HotReloading to branch "include-entitlements" which adds the entitlements file to the code signing arguments? HotReloading uses a cache and to make sure it gets flushed remove the file /tmp/iOS_builds.plist before you start your app. You should see the new -entitlements argument in the com.johnholdsworth.InjectionIII defaults after that.

from hotreloading.

johnno1962 avatar johnno1962 commented on June 12, 2024 1

Thanks, I'll take a look and get back to you.

from hotreloading.

johnno1962 avatar johnno1962 commented on June 12, 2024 1

Can't get your app not to work :S I've messaged you on twitter if you want to TeamView or email me at github at johnholdsworth.com.

from hotreloading.

johnno1962 avatar johnno1962 commented on June 12, 2024 1

This turned out to be a change to the default value for the PATH environment variable. This should be fixed in the 4.7.4 release.

from hotreloading.

johnno1962 avatar johnno1962 commented on June 12, 2024

Hi, getting codesigning right is difficult and the code sign (errno=1) doesn't give you much to go on.

The first thing to check is that Injection is signing correctly. Can you run the Injection app from the command line

$ /Applications/InjectionIII.app/Contents/MacOS/InjectionIII

Then look for the line πŸ’‰ InjectionIII Signing with identity: 511C1148E461780FD8B3C04906E..., check the identity is the same as for the app in the build logs and look for any error that might follow it.

from hotreloading.

adrienbaron avatar adrienbaron commented on June 12, 2024

@johnno1962 thank you for coming back to me that quickly! I've ran the app in a terminal and I'm getting a similar error there too. Nothing in those logs strike me as super suspicious, but I'm quite new to Swift dev πŸ˜…

2023-06-25 20:05:36.052 InjectionIII[28722:1161158] Connection from 192.168.1.242:59057
2023-06-25 20:05:36.052 InjectionIII[28722:1179193] πŸ’‰ InjectionIII Connection for project file: /Users/adrien.baron/perso/volumizer-new/Volumizer/Volumizer.xcodeproj
2023-06-25 20:05:36.174 InjectionIII[28722:1179193] πŸ’‰ InjectionIII Using tmp dir: /private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/
2023-06-25 20:05:44.950 InjectionIII[28722:1179276] πŸ’‰ InjectionIII evalError: Compiling /Users/adrien.baron/perso/volumizer-new/Volumizer/Volumizer/ContentView.swift
2023-06-25 20:05:45.298 InjectionIII[28722:1179276] πŸ’‰ InjectionIII Signing with identity: 55B1F64367A6DB4244C5D555C6062DAC71AF1B7F
2023-06-25 20:05:45.424 InjectionIII[28722:1179193] πŸ’‰ InjectionIII Injection error: Error Domain=SwiftEval Code=-1 "dlopen() error: dlopen(/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval101.dylib, 0x0002): tried: '/usr/lib/system/introspection/eval101.dylib' (no such file, not in dyld cache), '/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval101.dylib' (code signature invalid in <8C1A4437-765F-3D39-8587-08FE4370F1AA> '/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval101.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x0001B8B0, codeBlobSize=0x00004E30), '/private/preboot/Cryptexes/OS/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval101.dylib' (no such file), '/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval101.dylib' (code signature invalid in <8C1A4437-765F-3D39-8587-08FE4370F1AA> '/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval101.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x0001B8B0, codeBlobSize=0x00004E30)
πŸ”₯ ⚠️ Loading .dylib has failed due to invalid code signing.
πŸ”₯ Add the following as a Run Script/Build Phase:
defaults write com.johnholdsworth.InjectionIII "$PROJECT_FILE_PATH" "$EXPANDED_CODE_SIGN_IDENTITY"" UserInfo={NSLocalizedDescription=dlopen() error: dlopen(/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval101.dylib, 0x0002): tried: '/usr/lib/system/introspection/eval101.dylib' (no such file, not in dyld cache), '/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval101.dylib' (code signature invalid in <8C1A4437-765F-3D39-8587-08FE4370F1AA> '/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval101.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x0001B8B0, codeBlobSize=0x00004E30), '/private/preboot/Cryptexes/OS/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval101.dylib' (no such file), '/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval101.dylib' (code signature invalid in <8C1A4437-765F-3D39-8587-08FE4370F1AA> '/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval101.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x0001B8B0, codeBlobSize=0x00004E30)
πŸ”₯ ⚠️ Loading .dylib has failed due to invalid code signing.
πŸ”₯ Add the following as a Run Script/Build Phase:
defaults write com.johnholdsworth.InjectionIII "$PROJECT_FILE_PATH" "$EXPANDED_CODE_SIGN_IDENTITY"}
2023-06-25 20:05:45.577 InjectionIII[28722:1178734] πŸ’‰ InjectionIII evalError: Compiling /Users/adrien.baron/perso/volumizer-new/Volumizer/Volumizer/ContentView.swift
2023-06-25 20:05:45.904 InjectionIII[28722:1178734] πŸ’‰ InjectionIII Signing with identity: 55B1F64367A6DB4244C5D555C6062DAC71AF1B7F
2023-06-25 20:05:46.079 InjectionIII[28722:1179193] πŸ’‰ InjectionIII Injection error: Error Domain=SwiftEval Code=-1 "dlopen() error: dlopen(/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval102.dylib, 0x0002): tried: '/usr/lib/system/introspection/eval102.dylib' (no such file, not in dyld cache), '/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval102.dylib' (code signature invalid in <A435AA7A-D3DB-35DE-A046-79AAD1B26CBC> '/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval102.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x0001B8B0, codeBlobSize=0x00004E30), '/private/preboot/Cryptexes/OS/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval102.dylib' (no such file), '/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval102.dylib' (code signature invalid in <A435AA7A-D3DB-35DE-A046-79AAD1B26CBC> '/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval102.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x0001B8B0, codeBlobSize=0x00004E30)
πŸ”₯ ⚠️ Loading .dylib has failed due to invalid code signing.
πŸ”₯ Add the following as a Run Script/Build Phase:
defaults write com.johnholdsworth.InjectionIII "$PROJECT_FILE_PATH" "$EXPANDED_CODE_SIGN_IDENTITY"" UserInfo={NSLocalizedDescription=dlopen() error: dlopen(/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval102.dylib, 0x0002): tried: '/usr/lib/system/introspection/eval102.dylib' (no such file, not in dyld cache), '/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval102.dylib' (code signature invalid in <A435AA7A-D3DB-35DE-A046-79AAD1B26CBC> '/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval102.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x0001B8B0, codeBlobSize=0x00004E30), '/private/preboot/Cryptexes/OS/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval102.dylib' (no such file), '/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval102.dylib' (code signature invalid in <A435AA7A-D3DB-35DE-A046-79AAD1B26CBC> '/private/var/mobile/Containers/Data/Application/48BE6955-97CB-4072-8CBA-AB869A6BB5F2/tmp/eval102.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x0001B8B0, codeBlobSize=0x00004E30)
πŸ”₯ ⚠️ Loading .dylib has failed due to invalid code signing.
πŸ”₯ Add the following as a Run Script/Build Phase:
defaults write com.johnholdsworth.InjectionIII "$PROJECT_FILE_PATH" "$EXPANDED_CODE_SIGN_IDENTITY"}

It seems to sign with identity: 55B1F64367A6DB4244C5D555C6062DAC71AF1B7F

I've checked the build log and the signature do seem to match:

export EXPANDED_CODE_SIGN_IDENTITY\=55B1F64367A6DB4244C5D555C6062DAC71AF1B7F
...
    cd /Users/adrien.baron/perso/volumizer-new/Volumizer
    
    Signing Identity:     "Apple Development: [email protected] (LBMXXXX)"
    Provisioning Profile: "iOS Team Provisioning Profile: net.abaron.volumizerapp"
                          (876dd9d8-XXX)
    
    /usr/bin/codesign --force --sign 55B1F64367A6DB4244C5D555C6062DAC71AF1B7F --timestamp\=none --preserve-metadata\=identifier,entitlements,flags --generate-entitlement-der /Users/adrien.baron/Library/Developer/Xcode/DerivedData/Volumizer-emiufhnxurptayfpuzkoyaghlqne/Build/Products/Debug-iphoneos/Volumizer.app/Frameworks/SwiftTrace.framework

Feel free to ask if I can provide anything else πŸ‘!

from hotreloading.

johnno1962 avatar johnno1962 commented on June 12, 2024

Thanks for the detailed reports. The next thing to try is to update the HotReloading package and replace the "Build Phase" you added with the following instead of running the InjectionIII.app:

if [ -d $SYMROOT/../../SourcePackages ]; then
    $SYMROOT/../../SourcePackages/checkouts/HotReloading/start_daemon.sh
fi

This runs the app's code but as a daemon which is easier to work on. If this doesn't work I can TeamView to investigate further. Would that be possible?

from hotreloading.

adrienbaron avatar adrienbaron commented on June 12, 2024

@johnno1962 replaced the script with the code to start the daemon, and killed the InjectionIII app. Then started the app, it does start the daemon and connect, but still the same issue with dylib.

Happy to TeamView (or similar) if that can help! You can DM me on Twitter?

from hotreloading.

adrienbaron avatar adrienbaron commented on June 12, 2024

@johnno1962 ok done this, still the same issue πŸ˜…:

  • I do get the entitlements flag:
➜  ~ defaults read com.johnholdsworth.InjectionIII                                                                          
{
    "/Users/adrien.baron/perso/volumizer/Volumizer/Volumizer.xcodeproj" = "55B1F64367A6DB4244C5D555C6062DAC71AF1B7F --entitlements /Users/adrien.baron/Library/Developer/Xcode/DerivedData/Volumizer-csaltqlpifoltncgdifgioalxcwi/Build/Intermediates.noindex/Volumizer.build/Debug-iphoneos/Volumizer.build/Volumizer.app.xcent";
    deviceInform = Informed;
    deviceUnlock = any;
    lastProject = "/Users/adrien.baron/perso/volumizer-new/Volumizer/Volumizer.xcodeproj";
    lastWatched = "/Users/adrien.baron/perso/volumizer-new/Volumizer";
}
  • I did delete the cache file, although it was called /tmp/maciOS_builds.plist

Here are the logs/cache I've found in /tmp (hot_reloading.log, maciOS_builds.plist and unhide_object.log).
I've cleared them, started the app, did one change and then got them. Hope this helps πŸ™‡β€β™‚οΈ!

logs.zip

from hotreloading.

johnno1962 avatar johnno1962 commented on June 12, 2024

Still looking at this, about the only progress I've made is to replicate the code signing error=1 if you add the following to the Build phase (which stops the --entitlements "fix" being bypassed by values in the environment):

unset EXPANDED_CODE_SIGN_IDENTITY
unset CODE_SIGN_IDENTITY

Give me a little longer, I've not seen this code signing problem before. Usually it is connecting over the network that is the problem.

from hotreloading.

adrienbaron avatar adrienbaron commented on June 12, 2024

@johnno1962 the code is also very new, so I'm also happy to give you access to that repo if that helps debugging πŸ‘ (sorry should have offered that before)

EDIT: Added you, the branch is feature/inject πŸ‘

from hotreloading.

adrienbaron avatar adrienbaron commented on June 12, 2024

Can't get your app not to work :S

Argh the dreaded "It works on my machine" πŸ˜…, will be in touch!

from hotreloading.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.