I have received an IPA file of an iOS app from another team, I need to code sign the IPA file in order to run the app on my device.
I unzipped the IPA file, and it only contains .app file. How could I code sign the IPA file then ? Could some one provide me an step by step tutorial please?
(I have my development certificate, provisioning profile, registered device ready.)
===== UPDATE =====
What I am asking is almost the same as this one, the difference is that when I unzip the IPA, it is an app file which is different than the linked question.
You should create a ResourceRules.plist and Entitlements.plist with your credentials. After you create and update those files, delete _CodeSignature folder inside the .app file. Then you can run the following process from the command line:
codesign -f -s 'iPhone Distribution: YOUR_DISTRIBUTION_PROFILE_NAME_HERE' --resource-rules ResourceRules.plist --entitlements Entitlements.plist PATH_TO_APP_FILE
Entitlements.plist example:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>application-identifier</key>
<string>XXXXXXXXXX.com.xxx.app</string>
</dict>
</plist>
ResourceRules.plist example:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>rules</key>
<dict>
<key>.*</key>
<true/>
<key>Info.plist</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>ResourceRules.plist</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>100</real>
</dict>
</dict>
</dict>
</plist>
Related
I'm using Xcode version 8.2.1 and Mac OS Sierra 10.12.2
Having issues exporting archive using Xcode build command:
xcodebuild -exportArchive -archivePath {archivePath} -exportPath {exportPath} -exportOptionsPlist {exportOptionsPlistPath}
While running this command i'm getting this issue:
[MT] IDEDistribution: Step failed: <IDEDistributionThinningStep: 0x7fa4d888ee20>: Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.}
error: exportArchive: No applicable devices found.
Also when trying to export manually, and choosing export for specific device i'm getting this error :
The exportOptionsPlist file looks as follow:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>enterprise</string>
</dict>
</plist>
I tried to play with the thinning param but nothing helped.
Thanks in advance
Are you still having this problem?
I recently run into this issue ... and I am still working on it. So far, I see a problem in your exportOptionsPlist file, it should also include a teamID, I mean:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>enterprise</string>
<key>teamID</key>
<string>XX..XX</string>
</dict>
</plist>
Also, the error No applicable devices found might appear if one of the framework/library you app depends on, does not support bitcode but your app requires it.
I recommend you to follow this issue in fastline where it is described how to fully debug this error: https://github.com/fastlane/fastlane/issues/8737.
Regards.
After upgrading to xcode8, my project will no longer run on the simulator (runs on a device)
Error:
/Users/johnsmith/Library/Developer/Xcode/DerivedData/JT-fnslglvifmonzwhlgrchcqujqiwt/Build/Products/Debug-iphonesimulator/
Assets.bundle: Is a directory
Command /usr/bin/codesign failed with exit code 1
I have deleted the entire deriveddata folder and cleaned the project several times with no success. Any ideas how to fix please?
If you are using CocoaPods (especially an older version), you'll notice that all the resource bundle targets in the pods project file don't have an info.plist.
Set them all using CocoaPods generic Info.plist and it'll run.
This however is not a permanent solution. It will reset on next pod install
https://forums.developer.apple.com/thread/66538
EDIT:
If you don't happen to have a generic plist file in your project already
create a new file Info.plist in Pods Target Support Files/Pods-<App Name>/ and paste this
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
EDIT 2:
Fixed the values above. Apple won't accept it when uploading to App Store the way it previously was.
It shouldn't have CFBundleExecutable
and the CFBundlePackageType should be set to BNDL
I am able to install ipa using dropbox on 9.2.1 on 5c but not on 6S.
Any idea about that. this is mainfest.plist file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>https://dl.dropboxusercontent.com/u/publicul/myapp.ipa</string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>com.mysrting.test2</string>
<key>bundle-version</key>
<string>1.0.41</string>
<key>kind</key>
<string>software</string>
<key>title</key>
<string>myapp</string>
</dict>
</dict>
</array>
</dict>
</plist>
Even i had tried Diwai ..
it was showing unable to Dowload App
Any idea. i had tried with developer and distribution certificates both.
Thanks
You said in comment you don't want to include UDID of devices on your certificate. I guess you're using AdHoc cert.
If you don't want to provide each udid, you'll need an InHouse certificate, which you can create once you subscribed an Enterprise Developer Account.
Otherwise, you won't be able to install app on devices not included.
I have to build ios application, but without using xcode.
Problem is in pass entitlements to application.
My entitlements file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.domain</string>
</array>
</dict>
</plist>
and xcode formats it to this (.xcent file):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>application-identifier</key>
<string>A1B2C3D4E5.product.name</string>
<key>com.apple.developer.team-identifier</key>
<string>E5D4C3B2E1</string>
<key>get-task-allow</key>
<true/>
<key>keychain-access-groups</key>
<array>
<string>A1B2C3D4E5.com.domain</string>
</array>
</dict>
</plist>
by using the command:
builtin-productPackagingUtility app.entitlements -entitlements -format xml -o ${HOME}/Library/Developer/Xcode/DerivedData/app//Build/Intermediates/app.build/Debug-iphoneos/app.build/app.xcent
Can anybody explain what exactly this command does and how can i invoke it manually? Or how can i simulate this command call by my hand?
Thanks.
If you can use xcodebuild, builtin-productPackagingUtility will be invoked as a step. You simply need to supply entitlements as a build setting variable in the command line.
This library will create a xcent file you can use for codesigning.
https://github.com/sotownsend/iarrogant
Note: I haven't tested the library.
You can also grab the resulting xcent file from an ipa created with xcodebuild and use that to sign future releases. You would have to keep these files in sync as your entitlements change.
I'm trying to push an iOS application to iTunes Connect, but I get this error when I try to validate it in Xcode:
Application failed codesign verification. The signature was invalid, contains disallowed entitlements, or it was not signed with an iPhone Distribution Certificate
I've seen loads of questions related to the same issue, but those didn't work for me. I follow every single step of Apple's Technical Note TN2250. I check that in the build settings a distribution profile is selected for release (have tried with the wildcard and a custom one for the app) and the schema is the correct one. To ensure the app was signed with that profile, I use the codesign -d -vvvv MyApp.app command, and get something like:
Executable=/Users/myuser/Library/Developer/Xcode/Archives/2012-09-17/myapp 17-09-12 09.27.xcarchive/Products/Applications/MyApp.app/MyApp
Identifier=com.example.MyApp
...
Authority=iPhone Distribution: My Company
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
...
I check the entitlements, which I haven't modified, with security cms -D -i MyApp.app/embedded.mobileprovision, getting this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ApplicationIdentifierPrefix</key>
<array>
<string>PR3F1X</string>
</array>
<key>CreationDate</key>
<date>2012-09-17T07:20:35Z</date>
<key>DeveloperCertificates</key>
<array>
<data>
...
</data>
</array>
<key>Entitlements</key>
<dict>
<key>application-identifier</key>
<string>PR3F1X.com.example.MyApp</string>
<key>get-task-allow</key>
<false/>
<key>keychain-access-groups</key>
<array>
<string>PR3F1X.*</string>
</array>
</dict>
<key>ExpirationDate</key>
<date>2013-09-16T07:20:35Z</date>
<key>Name</key>
<string>PROFILE NAME</string>
<key>TeamIdentifier</key>
<array>
<string>PR3F1X</string>
</array>
<key>TimeToLive</key>
<integer>364</integer>
<key>UUID</key>
<string>...</string>
<key>Version</key>
<integer>1</integer>
</dict>
</plist>
The bundle id of this app looks like com.example.MyApp, and I thought the upper cases could be the problem, but changed them and it didn't do. After that, I revoked my certificates, got fresh mobileprovision profiles and went through the whole process again, with no success.
The software I'm using is Xcode 4.3.2 with Mac OS X 10.7.4
I can't see where the problem is, I'm missing something.
EDIT 1:
Does modifying the bundle ID requires I change some other setting manually?
EDIT 2:
I just made a sample app from scratch, signed it with the same certificates and everything goes smooth, so it seems that the problem is in the configuration. I'm trying to see the differences between those two project's settings, but the only remarkable ones would be that the first one is iPad only and it uses a couple of PhoneGap plugins.
I had the same problem.
You had to check your Application's Signature, see How do I check the entitlements on my Application's Signature with following:
codesign -d --entitlements - /path/to/MyGreatApp.app
It's OK and I don't know what the error you have, if you get something like:
Executable=/path/to/MyGreatApp.app/MyGreatApp
??qq?<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>application-identifier</key>
<string>ABC123DE45.com.appleseedinc.mygreatapp</string>
<key>get-task-allow</key>
<false/>
<key>keychain-access-groups</key>
<array>
<string>ABC123DE45.com.appleseedinc.mygreatapp</string>
</array>
</dict>
</plist>
But If you get only:
Executable=/path/to/MyGreatApp.app/MyGreatApp
Then, it's a problem. Probably, you damaged the entitlements during the code resigning with codesign tool.
I've made next steps to fix it:
Archive any app in Xcode.
Choose 'Distribute ...'->'Save for Enterprise Ad-Hoc Deployment' as AppName.ipa
Unzip AppName.ipa
Create Application's Signature entitlements file:
codesign -d --entitlements :enterprise.plist Payload/PathToApp.app/
Go to the folder where uploaded app located.
Create Provisioning profile entitlements file:
security cms -D -i /path/to/the.app/embedded.mobileprovision > provision_entitlements.plist
Open provision_entitlements.plist and enterprise.plist. Modify settings of enterprise.plist , it should be equal to provision_entitlements.plist->Entitlements property. Save the changes.
When resign the app add argument --entitlements enterprise.plist to codesign tool.
codesign -fs "iPhone Distribution: My Company" APP_DIRECTORY --entitlements enterprise.plist