injectionforxcode: Code injection failed due to multiple certificates

Hi, I cannot inject code. I installed the plugin by cloning the git and built it with xcode (6.3 last version).

When I launch my app I see:

+[BundleInjection load] 127.0.0.1
Injection attempting connection to: 127.0.0.1:31442 (see project's main.(m|mm)
Injection attempting connection to: 192.168.1.104:31442 (see project's main.(m|mm)
Connected to "Injection" plugin, ready to load arm64 code.
Param #0 -> 1.000000
Param #1 -> 1.000000
Param #2 -> 1.000000
Param #3 -> 1.000000
Param #4 -> 1.000000
Color #0 -> 0.000000,0.000000,0.000000,1.000000
Color #1 -> 1.000000,0.000000,0.000000,1.000000
Color #2 -> 0.000000,1.000000,0.000000,1.000000
Color #3 -> 0.058130,0.055542,1.000000,1.000000
Color #4 -> 1.000000,1.000000,1.000000,1.000000

So I supposed the project is ready for injection. But when I want to inject some code, I have got this error:


** RECORDED BUILD SUCCEEDED **


Renaming bundle so it reloads..

rm -rf “/Users/jonathan/Desktop/Codage/EIVO/Moods/iOSInjectionProject/build/Debug-iphoneos/InjectionBundle3.bundle” && cp -r “/Users/jonathan/Desktop/Codage/EIVO/Moods/iOSInjectionProject/build/Debug-iphoneos/InjectionBundle.bundle” “/Users/jonathan/Desktop/Codage/EIVO/Moods/iOSInjectionProject/build/Debug-iphoneos/InjectionBundle3.bundle”

Codesigning with identity ‘iPhone Developer’ for iOS device

iPhone Developer: ambiguous (matches “iPhone Developer: Jonathan Tribouharet (T4N37HB354)” and “iPhone Developer: Jonathan Tribouharet (Q8YU37NSUJ)” in /Users/jonathan/Library/Keychains/login.keychain)

Could not codesign as ‘iPhone Developer’: /Users/jonathan/Desktop/Codage/EIVO/Moods/iOSInjectionProject/build/Debug-iphoneos/InjectionBundle3.bundle at /Users/jonathan/Library/Application Support/Developer/Shared/Xcode/Plug-ins/InjectionPlugin.xcplugin/Contents/Resources/common.pm line 51.

main::error(‘Could not codesign as 9hone Developerø/Users/jonathan/D…’) called at /Users/jonathan/Library/Application Support/Developer/Shared/Xcode/Plug-ins/InjectionPlugin.xcplugin/Contents/Resources/injectSource.pl line 422

*** Bundle build failed ***

Check Bundle project.


I supposed the bug is because I have multiple certificate (multiple teams on, one personal (developer), one entreprise, and others from my clients) and codesigndon’t know which one choose. I don’t know if you indicate to codesign to use the same certificate I use for building my app with xcode.

About this issue

  • Original URL
  • State: open
  • Created 9 years ago
  • Comments: 18 (4 by maintainers)

Most upvoted comments

thanks for @johnno1962 providing such an genius plugin!!! I run this in simulator, but when it comes to my iPhone device, I received the same problem with @jonathantribouharet ,then as you suggested, I deleted the iOSInjectionProject/arm64/identity.txt file.but it still pops the same problem(ambiguous code identity…). Finally I have to delete other “iPhone Developer” certificates in login KeyChain to leave only one certificate, as a result it worked for my iPhone device. But I am confused, since xcode7.2 it allows us to debug with Xcode automatically generating provisioning files for us, why I have to delete other certificates to leave only one?

HI, you’re nearly there. Use "Product/<ProjectName>/Open Bundle” to open the bundle project inside which you can select the specific identity. This value is cached in a file <project_root>/isoInjectionProject/<architecture>/identiy.txt. delete it so it gets refreshed. The value in that file is that passed to codesign on the command line.