Generate IPA File From terminal - terminal

xcrun -sdk iphoneos6.1 PackageApplication -v "/Users/admin/Documents/Projects/mobi/Mob/build/Debug-iphoneos/Mob.app" -o "/Users/salmannasir/Documents/Projects//mobi/IPAFolder/Mobi234.ipa" --sign "iPhone Developer: Derek Sine (TFJ34N54U5)" --embed "/Users/admin/Documents/Projects/mobi/Mob/DC983365-9967-4F0D-9004-71AFB5450B92.mobileprovision"
i got error :
rogram /usr/bin/codesign returned 1 : [/var/folders/rx/rxc18xvx6vl59pgn2d8yzx3m0000gn/T/HKxz0onJOS/Payload/Mobi.app: replacing existing signature
/var/folders/rx/rxc18xvx6vl59pgn2d8yzx3m0000gn/T/HKxz0onJOS/Payload/Mobi.app: object file format unrecognized, invalid, or unsuitable
]
error: /usr/bin/codesign --force --preserve-metadata=identifier,entitlements,resource-rules --sign iPhone Developer: Derek Sine (TFJ34N3SU5) --resource-rules=/var/folders/rx/rxc18xvx6vl59pgn2d8yzx3m0000gn/T/HKxz0onJOS/Payload/Mobi.app/ResourceRules.plist /var/folders/rx/rxc18xvx6vl59pgn2d8yzx3m0000gn/T/HKxz0onJOS/Payload/Mobi.app failed with error 1. Output: /var/folders/rx/rxc18xvx6vl59pgn2d8yzx3m0000gn/T/HKxz0onJOS/Payload/Mobi.app: replacing existing signature
/var/folders/rx/rxc18xvx6vl59pgn2d8yzx3m0000gn/T/HKxz0onJOS/Payload/Mobi.app: object file format unrecognized, invalid, or unsuitable
this issue was in -o "/Users/salmannasir/Documents/Projects//mobi/IPAFolder/Mobi234.ipa"
Can any one help me

The path u specified is the output directory where u need to store the .ipa file of your project and also i think the command and parameters you are using is also not correct.
if u are still facing same problem u can visit this link for more details
Xcode "Build and Archive" from command line

Related

I get a signing error when I add an image to Assets in the SwiftUI Tutorial

I get a signing error when I add an image to Assets in the SwiftUI Tutorial
I'm working on the SwiftUI Tutorial, but when I add an image or JSON file to Assets, I get the following Sign Error.
CodeSign /Users/k~~/Library/Developer/Xcode/DerivedData/SwiftUIPractice-ctdnfoihimrfqeejvxgheakcfzfv/Build/Products/Debug-iphonesimulator/SwiftUIPractice.app (in target 'SwiftUIPractice' from project 'SwiftUIPractice')
cd /Users/~~/project/SwiftUIPractice
export CODESIGN_ALLOCATE\=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
Signing Identity: "-"
/usr/bin/codesign --force --sign - --entitlements /Users/~~/Library/Developer/Xcode/DerivedData/SwiftUIPractice-ctdnfoihimrfqeejvxgheakcfzfv/Build/Intermediates.noindex/SwiftUIPractice.build/Debug-iphonesimulator/SwiftUIPractice.build/SwiftUIPractice.app.xcent --timestamp\=none --generate-entitlement-der /Users/~~/Library/Developer/Xcode/DerivedData/SwiftUIPractice-ctdnfoihimrfqeejvxgheakcfzfv/Build/Products/Debug-iphonesimulator/SwiftUIPractice.app
/Users/~~/Library/Developer/Xcode/DerivedData/SwiftUIPractice-ctdnfoihimrfqeejvxgheakcfzfv/Build/Products/Debug-iphonesimulator/SwiftUIPractice.app: replacing existing signature
/Users/~~/Library/Developer/Xcode/DerivedData/SwiftUIPractice-ctdnfoihimrfqeejvxgheakcfzfv/Build/Products/Debug-iphonesimulator/SwiftUIPractice.app: code object is not signed at all
In subcomponent: /Users/~~/Library/Developer/Xcode/DerivedData/SwiftUIPractice-ctdnfoihimrfqeejvxgheakcfzfv/Build/Products/Debug-iphonesimulator/SwiftUIPractice.app/Assets.car
Command CodeSign failed with a nonzero exit code

OS X codesign nested code is modified or invalid

Qt4 application with bundle structure like that:
QtCore.framework/
QtCore -> Versions/Current/QtCore
Resources -> Versions/Current/Resources
Versions/
4/
QtCore
Resources/
Info.plist
Current -> 4
codesign --verbose --force --deep --sign "Certificate Name" Test.app
Result: Test.app: signed bundle with Mach-O thin (x86_64) [...]
"Certificate Name" is Comodo code sign certificate
codesign --verify -vvvv Test.app
Test.app: nested code is modified or invalid
codesign --verbose --verify Test.app/Contents/Frameworks/QtCore.framework
Test.app/Contents/Frameworks/QtCore.framework: valid on disk
Test.app/Contents/Frameworks/QtCore.framework: does not satisfy its designated Requirement
p.s. I have tried to sign manually all framework/dylib without option --deep and the same result.
create a folder called A inside versions with same contents of 4, change the symbolic links to the A folder especially current->A
try signing now and it may sign. But the problem may be with the binary, it will use a different framework than A, which you can check with otool -L (take care big L and not small l)
to change it, you need to use install_name_tool
good luck and have fun

build failed xcode can't exec 'codesign'

I get this error when trying to run an app on a device with Xcode 5
error: can't exec 'codesign' (No such file or directory)
I was googling for two days and find nothing.
I look at the question here too and nothing works for me.
here is the full error:
CodeSign /Users/chana/Library/Developer/Xcode/DerivedData/Help-drsymbthpuqglxbvcobnqddtsvep/Build/Products/Debug-iphoneos/Help.app
cd /Users/chana/Documents/xcode/Help
setenv CODESIGN_ALLOCATE /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin‭:‬‭/‬usr/bin‭:/‬bin‭:/‬usr/sbin‭:/‬sbin"
Using code signing identity "iPhone Developer: Yisroel Dov Schloss (NG5B48CCYR)" and provisioning profile "iOS Team Provisioning Profile: *" (9E06834D-2BA6-4C56-8FC7-DF3C4406C069)
codesign --force --sign DB496AB61FA79D8F561DAA41317A98234CB213BB --resource-rules=/Users/chana/Library/Developer/Xcode/DerivedData/Help-drsymbthpuqglxbvcobnqddtsvep/Build/Products/Debug-iphoneos/Help.app/ResourceRules.plist --entitlements /Users/chana/Library/Developer/Xcode/DerivedData/Help-drsymbthpuqglxbvcobnqddtsvep/Build/Intermediates/Help.build/Debug-iphoneos/Help.build/Help.xcent /Users/chana/Library/Developer/Xcode/DerivedData/Help-drsymbthpuqglxbvcobnqddtsvep/Build/Products/Debug-iphoneos/Help.app
error: can't exec 'codesign' (No such file or directory)

Continuous Integration Code Signing issue

I've been working on setting up a TeamCity continuous integration build agent for my iOS builds and I've run into a bit of a road block.
We're going to be making builds for different clients with different certificates and mobile provisioning profiles, so I figured I would write a build script that would create an unsigned archive, then sign it with the appropriate identity and mobileprovision. It seems like the xcrun command doesn't like that the .app file is not signed, and therefore won't sign it.
Am I doing something wrong, or is there some other, more elegant way of accomplishing what I'm trying to do?
Infodump follows...
I'm creating the unsigned build with the following command:
xcodebuild -workspace "[workspace].xcworkspace" -scheme "[scheme]" clean archive CODE_SIGN_ENTITY="" CODE_SIGNING_REQUIRED=NO
Then, I'm attempting to code sign and create the IPA with this command:
APP=[path to .app file in archive]
OUT_IPA=[desired location of .ipa]
IDENTITY=[CodeSigning Identity]
MOBILE_PROVISION=[path to .mobileprovision]
xcrun -sdk iphoneos PackageApplication -v "${APP}" -o "${OUT_IPA}" --sign "${IDENTITY}" --embed "${MOBILE_PROVISION}"
The xcrun command prints a bunch of debug info, then copies files around to temporary directories. Then it checks the original app
### Checking original app
+ /usr/bin/codesign --verify -vvvv /Users/jibanez/Library/Developer/Xcode/Archives/2012-09-14/[scheme] 9-14-12 12.02 PM.xcarchive/Products/Applications/[product].app
Program /usr/bin/codesign returned 1 : [/Users/jibanez/Library/Developer/Xcode/Archives/2012-09-14/[scheme] 9-14-12 12.02 PM.xcarchive/Products/Applications/[product].app: code object is not signed at all
In architecture: armv7
]
Codesign check fails : /Users/jibanez/Library/Developer/Xcode/Archives/2012-09-14/[scheme] 9-14-12 12.02 PM.xcarchive/Products/Applications/[product].app: code object is not signed at all
In architecture: armv7
Done checking the original app
This seems about right. After all, I didn't code sign the archive, that's what xcrun is supposed to do. Here's where things get weird:
### Embedding '/Users/jibanez/Documents/[projectdir]/codesign/[scheme]/842F2922-D0CB-46CE-81E5-B7362DD1D960.mobileprovision'
+ /bin/rm -rf /var/folders/hh/qhf8930s5hg8lwbp2j_zsdm822y1s1/T/NycIiYdEYe/Payload/[product].app/embedded.mobileprovision
Program /bin/rm returned 0 : []
+ /bin/cp -rp /Users/jibanez/Documents/[projectdir]/codesign/[scheme]/mobileProvision.mobileprovision /var/folders/hh/qhf8930s5hg8lwbp2j_zsdm822y1s1/T/NycIiYdEYe/Payload/[product].app/embedded.mobileprovision
Program /bin/cp returned 0 : []
+ /usr/bin/codesign -d --entitlements /var/folders/hh/qhf8930s5hg8lwbp2j_zsdm822y1s1/T/NycIiYdEYe/entitlements_rawwAdCadPV /var/folders/hh/qhf8930s5hg8lwbp2j_zsdm822y1s1/T/NycIiYdEYe/Payload/[product].app
Program /usr/bin/codesign returned 1 : [/var/folders/hh/qhf8930s5hg8lwbp2j_zsdm822y1s1/T/NycIiYdEYe/Payload/[product].app: code object is not signed at all
]
error: Failed to read entitlements from '/var/folders/hh/qhf8930s5hg8lwbp2j_zsdm822y1s1/T/NycIiYdEYe/Payload/[product].app'
Failed: PackageApplication

XCode cannot create IPA

My application compiles OK, and verifies.
But each of the Organizer options Validate..., Share..., Submit... just fail silently.
I'm using XCode version 3.2.5
I found the Console application had some information:
30/12/10 13:51:27 Xcode[8458] Running /usr/bin/xcrun with (
"-sdk",
iphoneos,
PackageApplication,
"-v",
"/Users/xxxxxx/Library/Application Support/Developer/Shared/Archived Applications/C201D5C0-2AB4-494B-A560-806AE36EF9A7.apparchive/Xxxxxx.app",
"-o",
"/var/folders/52/528Jj01wGtKYzlqffjXrck+++TI/-Tmp-/0610AAC0-E549-4F07-9496-08EFD6DFCAC3-8458-0000F00C5DE14F9F/Xxxxxx.ipa",
"--sign",
"iPhone Distribution: Xxxxxx",
"--embed",
"/Users/xxxxxx/Library/MobileDevice/Provisioning Profiles/66403280-7962-4A73-92D1-8FF34F65866C.mobileprovision"
)
30/12/10 13:51:27 [0x0-0x439439].com.apple.Xcode[8458] sh: /Developer/usr/bin/xcodebuild: No such file or directory
30/12/10 13:51:27 [0x0-0x439439].com.apple.Xcode[8458] /Developer/usr/bin/xcodebuild fails with 32512 - Unknown error: 32512
After searching around for a while, it appears that my install was missing the directory /Developer/usr/bin/.
In a Terminal shell, I linked the latest XCode version directory:
ln -s /Developer/XCode_3.2.5/usr/ /Developer/usr
and it fixed the problem.
You should try to package your IPA file through command line, so you can have full log in it. Here is a post I wrote, check it out.
http://www.nanaimostudio.com/blog/2011/4/17/xcode-build-and-archive-sharing-problem-and-solution.html

Resources