Application for creating Xcode for ipa from the command line

I can not create ipa signed file from command line. First, a few words about my environment:

1. Application I prepared a simple application for the iPad from the "Master-detailed application" template. Nothing has changed in the code, nothing has changed. Just a new project.

2. Build a script. Here is my assembly <script "

cd /Users/admin/Desktop/signtest/signtest/

xcodebuild -target signtest -configuration Debug -sdk iphonesimulator4.3 clean build

/usr/bin/xcrun -sdk iphoneos PackageApplication -v /Users/admin/Desktop/signtest/signtest/build/Debug-iphonesimulator/signtest.app -o /Users/admin/Desktop/binaries/signtest.ipa --sign "iPhone Developer: Marcin Zyga (CLJR93MXJ6)" --embed "/Users/admin/Library/MobileDevice/Provisioning\ Profiles/94D99766-0268-4E0E-B8D1-053063BB2DA1.mobileprovision"

3. The problem

The application is built, and then I try to make an ipa file from the assembly. But I have this:

** BUILD SUCCEEDED **

Packaging application: '/Users/admin/Desktop/signtest/signtest/build/Debug-iphonesimulator/signtest.app'
Arguments: embed=/Users/admin/Library/MobileDevice/Provisioning\ Profiles/94D99766-0268-4E0E-B8D1-053063BB2DA1.mobileprovision  verbose=1  output=/Users/admin/Desktop/binaries/signtest.ipa  sign=iPhone Developer: Marcin Zyga (CLJR93MXJ6)  
Environment variables:
HOME = /Users/admin
SUDO_GID = 20
DISPLAY = /tmp/launch-vj2zx7/org.x:0
VERSIONER_PERL_PREFER_32_BIT = no
MAIL = /var/mail/root
SSH_AUTH_SOCK = /tmp/launch-YPyQMl/Listeners
PWD = /Users/admin/Desktop/signtest/signtest
LANG = pl_PL.UTF-8
USER = root
LOGNAME = root
__CF_USER_TEXT_ENCODING = 0x0:29:42
USERNAME = root
SHLVL = 1
OLDPWD = /SMT/ci_shell_scripts
_ = /usr/bin/xcrun
PATH = /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
LSCOLORS = GxFxCxDxBxegedabagaced
SUDO_USER = admin
SHELL = /bin/bash
TERM = xterm-256color
SUDO_COMMAND = ./sign_test_ipa.sh
VERSIONER_PERL_VERSION = 5.12
SUDO_UID = 502

Output directory: '/Users/admin/Desktop/binaries/signtest.ipa'
Temporary Directory: '/tmp/eiJTk08At3'  (will NOT be deleted on exit when verbose set)
+ /bin/cp -Rp /Users/admin/Desktop/signtest/signtest/build/Debug-iphonesimulator/signtest.app /tmp/eiJTk08At3/Payload
Program /bin/cp returned 0 : []
### Checking original app
+ /usr/bin/codesign --verify -vvvv /Users/admin/Desktop/signtest/signtest/build/Debug-iphonesimulator/signtest.app
Program /usr/bin/codesign returned 1 : [/Users/admin/Desktop/signtest/signtest/build/Debug-iphonesimulator/signtest.app: object file format unrecognized, invalid, or unsuitable
]
error: Codesign check fails : /Users/admin/Desktop/signtest/signtest/build/Debug-iphonesimulator/signtest.app: object file format unrecognized, invalid, or unsuitable

The important part is here:

  Program /usr/bin/codesign returned 1 : [/Users/admin/Desktop/signtest/signtest/build/Debug-iphonesimulator/signtest.app: object file format unrecognized, invalid, or unsuitable
    ]
    error: Codesign check fails : /Users/admin/Desktop/signtest/signtest/build/Debug-iphonesimulator/signtest.app: object file format unrecognized, invalid, or unsuitable

I can not find a solution.

4. , . , , , , , , , (, - ).

  • 1 ( ifile) - ​​ ,
  • Xcode - Sharing - 1 - Code Signing Resource Rules $(SDKROOT)/ResourceRules.plist
  • iPhone Codesign -

    sudo mv/usr/bin/codesign_allocate/usr/bin/codesign_allocate_old sudo ln -s/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate/usr/bin

5. , ipa, , ipa iTunes, .

6.

  • :

    xcodebuild -target signtest -configuration Debug -sdk iphoneos clean build

:

=== BUILD NATIVE TARGET signtest OF PROJECT signtest WITH CONFIGURATION Debug ===
Check dependencies
[BEROR]Code Sign error: Provisioning profile '94D99766-0268-4E0E-B8D1-053063BB2DA1' can't be found


** BUILD FAILED **

xcode . , . ? , , , iPad.

+5
1

SDK iPhone Simulator script. SDK.

+2

All Articles