我想通过终端将Xcode Project安装到iOS设备中。我知道如何使用来构建应用程序xcodebuild clean install 这个命令。我想在设备中启动应用程序。

我已经尝试了一些可以成功执行的命令,但是现在当我尝试执行以下命令时遇到以下错误。

xcodebuild -target“GoldenGate” -sdk“iOS 6.1”-配置发布

导出DEVELOPER_DIR = / Applications / Xcode.app / Contents / Developer /

PROJECT =“GoldenGate”
SIGNING_IDENTITY =“iPhone开发人员:Deepak Shukla”
PROVISIONING_PROFILE =“$ {WORKSPACE} /E6FD2816-7827-41AA-AC7E-2DC4833E637C.mobileprovision”

ARCHIVE =“$(ls -dt〜/ Library / Developer / Xcode / Archives // $$ PROJECT} .xcarchive | head -1)”

IPA_DIR =“$ {WORKSPACE}”
DSYM =“$ {ARCHIVE} / dSYMs / $ {PROJECT} .app.dSYM”
APP =“$ {ARCHIVE} / Products / Applications / $ {PROJECT} .app”

/ bin / rm -f“$ {IPA_DIR} / $ {PROJECT} .ipa”

/ usr / bin / xcrun -sdk iphoneos PackageApplication \
-o“$ {IPA_DIR} / $ {PROJECT} .ipa” \
-详细“$ {APP}” \
签名“$ {SIGNING_IDENTITY}” \
--embed“$ {PROVISIONING_PROFILE}”

嵌入'/E6FD2816-7827-41AA-AC7E-2DC4833E637C.mobileprovision'

  • / bin / rm -rf /var/folders/wv/kv98qhfj6v36b2h0fkf_l66w0000gn/T/ouA93u702I/Payload/GoldenGate.app/embedded.mobileprovision
    程序/ bin / rm返回0:[]
  • / bin / cp -rp /E6FD2816-7827-41AA-AC7E-2DC4833E637C.mobileprovision /var/folders/wv/kv98qhfj6v36b2h0fkf_l66w0000gn/T/ouA93u702I/Payload/GoldenGate.app/嵌入式。
    程序/ bin / cp返回1:[cp:/E6FD2816-7827-41AA-AC7E-2DC4833E637C.mobileprovision:没有这样的文件或目录
    ]
    错误:无法将'/E6FD2816-7827-41AA-AC7E-2DC4833E637C.mobileprovision'复制到'/var/folders/wv/kv98qhfj6v36b2h0fkf_l66w0000gn/T/ouA93u702I/Payload/GoldenGate.app/embedd.mobileprovision'

    请帮助我完成此任务。

    最佳答案

    #!/bin/sh
    
    # build.sh
    #
    # Created by iOSRider on 27/01/2014.
    
    APPLICATION_NAME=MyApp
    
    PROJDIR=/Users/iOSRider/Desktop/MyApp
    
    PROJECT_NAME= MyApp
    
    TARGET_SDK="iphoneos"
    
    PROJECT_BUILDDIR="${PROJDIR}/build/Release-iphoneos"
    
    TARGET_TEST_NAME="MyApp"
    
    BUILD_HISTORY_DIR="/Users/iOSRider/Desktop/MyApp"
    
    DEVELOPPER_NAME="iPhone Distribution: iOSRider India Limited (R8UAKS2M7L)"
    
    PROVISONNING_PROFILE="/Users/iOSRider/Desktop/MyApp/iOS.mobileprovision"
    # compile project echo Building Project cd "${PROJDIR}" xcodebuild -target "${PROJECT_NAME}" -sdk "${TARGET_SDK}" -configuration Release
    
    #Check if build succeeded
    
    if [ $? != 0 ] then   exit 1 fi
    
    /usr/bin/xcrun -sdk iphoneos PackageApplication -v "${PROJECT_BUILDDIR}/${APPLICATION_NAME}.app" -o "${BUILD_HISTORY_DIR}/${APPLICATION_NAME}.ipa" --sign "${DEVELOPPER_NAME}" --embed "${PROVISONNING_PROFILE}"
    

  • 10-05 20:22
    查看更多