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

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?

#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.

Related

Unable to install development app on iphone

I am using xcode 11.3.1 to archive an app. I have set my profile correctly and run the same ipa to multiple devices. I have an new iphone device with ios 10.0.1 to which I can't install the archive. I have added the device's udid in the profile. I create development archive.
The error on device is Unable to Download App. "App" could not be downloaded at this time.
Any thoughts?
The provisioning profile must not have the newly added iPhone UUID.
Do following checks.
1. Rename your AppName.ipa file to AppName.zip
2. Unzip the file to get Payload.
3. Run below command on terminal
security cms -D -i /PATH_TO_PAYLOAD_DIR/Payload/appName.app/embedded.mobileprovision
and check your included devices UUID's.

Command xcodebuild failed with exit code 70 - Nativescript

I'm using Nativescript (using VScode) and trying to upload my app in App Store Connect following steps from official {N} documentation. When I'm done with all steps: set Bundle ID, edit Info.plist and build.xcconfig, create distribution certificate, app identifier, provisioning distribution profile. I run the following command in VS code:
tns publish iOS *My_Apple_ID* *My_Apple_Password* *Provisioning_Profile_UUID* iPhone Distribution --appleApplicationSpecificPassword *password_for_two_factor_auth*
and then I get this error:
Error Domain=IDEProvisioningErrorDomain Code=9 ""nsvue.app" requires a
provisioning profile." UserInfo={IDEDistributionIssueSeverity=3,
NSLocalizedDescription="nsvue.app" requires a provisioning profile.,
NSLocalizedRecoverySuggestion=Add a profile to the
"provisioningProfiles" dictionary in your Export Options property
list.}
** EXPORT FAILED **
Command xcodebuild failed with exit code 70
My question is:
What I'm doing wrong? How to make it work?
Here's in detail what I had done so far:
Certificates, Identifiers & Profiles
Distribution certificate generated by Xcode
Registered App Identifier (BundleID) is "com.nativescript.nsvue" (my app's name is "nsvue" and I had tried BundleId to be same as the app name, but without success same error again)
Provisioning profile (where the REAL problem is) name of the provisioning profile with App ID - "My_Development_Team.com.nativescript.nsvue". Then I dowloaded it and installed it on my Mac.
App Store Connect
Create app with same BundleId as my app's and prepare it for submission now only I need to upload my app in App Store Connect
Package.json, Info.plist and build.xcconfig
Thats how my Info.plist looks like. And that's build.xcconfig. Id of my app in package.json is "com.nativescript.nsvue" too.
There is a related issue in the NativeScript GitHub Issues: https://github.com/NativeScript/nativescript-cli/issues/3222
While I'm not 100% sure why this problem exists, I have found that you can work around the problem by explicitly passing your provisioning profile uuid on the command line with the --provision flag, like this:
tns appstore upload *My_Apple_ID* *My_Apple_Password* --appleApplicationSpecificPassword *password_for_two_factor_auth* --provision *Provisioning_Profile_UUID*
Note: I think tns publish has been replaced with tns appstore upload...but under the covers, I think they're the same command...FWIW
Hope this helps as a work around for others that find this thread.

Xcode Command CodeSign failed with non zero when deploying to device

I received this error when trying to deploy application to device. I am using Xcode 10.1 with free developer account. In signing section I set personal team with signing certificate iPhone Developer. I can ran the app in iOS simulator but not run in real device.
Exact error message:
CodeSign /Users/***/Library/Developer/Xcode/DerivedData/****-eqztbodhqkugrwevuvkmzysmcvdj/Build/Products/Debug-iphoneos/****\ Mobile.app (in target: ******)
cd /Users/***/Projects/**********/platforms/ios
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
Signing Identity: "iPhone Developer:******#*****.com (QALD7Y5PCU)"
Provisioning Profile: "iOS Team Provisioning Profile: com.***.****"
(7475de4a-3ae3-4798-9c9c-a8e65a1bc1b9)
/usr/bin/codesign --force --sign 55DEB33A3DF3254D66B1AC6CEACB052CABCF3644 --entitlements /Users/***/Library/Developer/Xcode/DerivedData/************-eqztbodhqkugrwevuvkmzysmcvdj/Build/Intermediates.noindex/****\ Mobile.build/Debug-iphoneos/****\ Mobile.build/****\ Mobile.app.xcent --timestamp=none /Users/****/Library/Developer/Xcode/DerivedData/**********-eqztbodhqkugrwevuvkmzysmcvdj/Build/Products/Debug-iphoneos/****\ Mobile.app
/Users/****/Library/Developer/Xcode/DerivedData/********-eqztbodhqkugrwevuvkmzysmcvdj/Build/Products/Debug-iphoneos/**** Mobile.app: errSecInternalComponent
Command CodeSign failed with a nonzero exit code
Your code signing for free account should look like this
I got same issue , my certificates was created automatically but Device Udid does not create.
then check your device Udid is exist on your Apple developer Account and also check your Bundle identifier?
// hope its works for you thanks
I also encountered this error, in my experience I am trying to run my app in a device which is not registered in my provisioning profile. To resolve this, you need to make sure you are not using a production provisioning profile because you can not assign a device there. Use development provisioning profile, assign the device in that provisioning profile, download the provisioning profile and double click it. Build again and it should work.
I experienced this error today, and it resolved with steps below.
1 Deleted newly added image from Asset folder.
2 Restarted my mac computer.
3 Re-launched xCode and did a clean build.

Frameworks/libswiftAVFoundation.dylib : valid provisioning profile for this executable was not found

I am re-signing a third party vendors app for enterprise distribution. I go through my usual re-signing process and it will install OK on an iOS10 device. However when I run the app it immediately crashes and I see the following in the debug log:
iPad amfid[224] :
/private/var/containers/Bundle/Application/BB77EC6D-32E0-4762-B11B-9894799DD96C/ScannerPro.app/Frameworks/libswiftAVFoundation.dylib
not valid: 0xe8008015: A valid provisioning profile for this
executable was not found
Missing step was
codesign -f -s “iPhone Distribution:[company name]" '--entitlements'
'entitlements.plist' AppName.app/Frameworks/*
After doing this, and then resigning the overall app, the IPA launched successfully on both iOS9 and 10

Distribution app phenomen

I'm making a .app with Distribution provisions and after ziping i uploading him to iTunes with "Application Loader".
All is fine, and .app is submitting at successfully.
But in some case, i see error
Application failed codesign verification. The signature was invalid, contains disallowed entitlements, or it was not signed with an iPhone Distribution Certificate.
And i solving him just:
1) Copy, paste folder with content, source, xcode project files to another folder
2) Rebuild app from new folder
3) Trying again to submit, and all is fine.
What's going up ?
UPDATED
Solved! In my mac this command is not working at perfectly
codesign --verify -vvv My.app
When error is exist, him told me
Valid on disk
But when i tryed this command at another Mac, then told a true error, and we solved this error.
Mac OS version: 10.8.3, Xcode version: 4.6, Application Loader version: 2.8

Resources