How to signig existing .ipa or app. with provisioning profile

730 views Asked by At

I'm writing mobile autotests using C#, Xamarin 6.1.3., iOS 10.2, iPhone 6s Plus, Xcode 8.2, OS X El Capitan 10.11.6. I'm trying to launch tests on simulator using the following command:

IApp iApp = ConfigureApp.iOS.AppBundle(path_to_app/Application.app).StartApp();

I've got the following error:

Calabash.XDB.Core.Exceptions.DeviceAgentException : Failed to install app /Volumes/Win7 Ultim/Framework/Atom.app

ExitCode: 1



       app: /Volumes/Win7 Ultim/Framework/Atom.app/PlugIns/AtomTests.xctest
  identity: #<CodesignIdentity: - : AdHoc>
/usr/bin/xcrun codesign -d --entitlements :- /Volumes/Win7 Ultim/Framework/Atom.app/PlugIns/AtomTests.xctest
/usr/bin/xcrun codesign --verbose=4 --verify /Volumes/Win7 Ultim/Framework/Atom.app/Atom
/Volumes/Win7 Ultim/Framework/Atom.app
/Volumes/Win7 Ultim/Framework/Atom.app/PlugIns/AtomTests.xctest
device UDID: 9E44D0FE-A3F9-4FC1-8635-20FB8AD20BA4
Device UDID: 9E44D0FE-A3F9-4FC1-8635-20FB8AD20BA4
ERROR: Error Domain=sh.calaba.iOSDeviceManger Code=5 "Code signing failed" UserInfo={NSLocalizedDescription=Code signing failed, NSLocalizedFailureReason=There was a problem code signing. Please check the logs.}
Path to bundle: /Volumes/Win7 Ultim/Framework/Atom.app
Could not extract entitlements from app:
with command:
    -a,--app-bundle <path/to/app-bundle.app>    Path .app bundle (for .ipas, unzip and look inside of 'Payload')
    -c,--codesign-identity  <codesign-identity> [OPTIONAL]  Identity used to codesign app bundle [device only]  DEFAULT=
    -d,--device-id  <device-identifier> iOS Simulator GUIDs
    -u,--update-app <true-or-false> [OPTIONAL]  When true, will reinstall the app if the device contains an older version than the bundle specified DEFAULT=1
install
/Volumes/Win7 Ultim/Framework/Atom.app/Atom: code object is not signed at all
/Volumes/Win7 Ultim/Framework/Atom.app/PlugIns/AtomTests.xctest: code object is not signed at all
=== STDERR ===
=== STDERR ===
Could not find any Provisioning Profiles suitable for resigning
Could not resign app bundle at path:
Error resigning sim bundle
In architecture: x86_64
with command:

So i don't have application source code, but i need to sign in .app or .ipa file that i have, to make it possible to run tests on the application. Is it possible?

1

There are 1 answers

0
Brandon Minnick On

@Kent.Green's solution to this answer also works to solve your problem:

Re-signing an IPA using Xamarin Test Recorder

One option you can use is using the Xamarin Test Recorder to inject Calabash and re-sign your IPA: https://developer.xamarin.com/guides/testcloud/testrecorder/

After you load the IPA into the test recorder, it will create a new, re-signed IPA it in the same location as the original IPA, with the name prepended with "xtr-" like so:

  • myAwesomeApp.ipa (original IPA)
  • xtr-myAwesomeApp.ipa (IPA, Re-signed, injected with Calabash)

Things to watch out for

  • IPA Re-Signing - The mac doing the resigning needs to have a valid signing identity and provisioning profile installed in its Keychain, including any entitlements the app uses.

  • Any IPA containing Calabash will be rejected by the iOS app store - This is true no matter what method is used to add Calabash to the IPA, but it's important to remember. In the example above, you would test with xtr-myAwesomeApp.ipa and submit myAwesomeApp.ipa itself to the app store.