user2185363 user2185363 - 1 year ago 65
iOS Question

ios application generation ipa from termminal

I am trying to build IPA from terminal. I tried the following steps:
Step 1:

/usr/bin/xcodebuild -target "appname" -sdk "iphoneos" -configuration Release

Step 2:

/usr/bin/xcrun -sdk iphoneos PackageApplication -v "appname" -o "/Users/Pictures/" -sign "iPhone Developer:xxxxx" --embed /Users//Library/MobileDevice/Provisioning\ Profiles/xxxxxx.mobileprovision"

I didn't get any error but I am not getting any response. I have been waiting for more than 30 minutes. What am I missing here?

Answer Source
I have given a brief description of steps to follow, and parameters to pass while generating an ipa using terrminal below:

1) Go to the folder which contains the MyApp.xcodeproject file in terminal

2) By using the command given below you will get all the Targets of the application

/usr/bin/xcodebuild -list 

3) After the above command is executed, you will get a list of targets of which you should select a specific target you need to generate .ipa

/usr/bin/xcodebuild -target $TARGET -sdk iphoneos -configuration Release

4) The above command builds the project and creates a .app file.The path to locate the .app file is"./build/Release-iphoneos/"

5) After Build gets succeeded then execute the following command to generate .ipa of the application using Developer Name and Provisioning Profile using the syntax below:

/usr/bin/xcrun -sdk iphoneos PackageApplication -v “${TARGET}.app” -o “${OUTDIR}/${TARGET}.ipa” –sign “${IDENTITY}” –embed “${PROVISONING_PROFILE}”

Explanation of each Parameter in the above syntax:

${TARGET}.app == Target path (ex :/Users/XXXXXX/desktop/Application/build/Release-iphoneos/ ${OUTDIR} == Select the output directory(Where you want to save .ipa file) ${IDENTITY} == iPhone Developer: XXXXXXX (XXXXXXXXXX)(which can be obtained from Keychain access) ${PROVISONING_PROFILE} == Path to the provisioning profile(/Users/XXXXXX/Library/MobileDevice/Provisioning Profiles/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.mobileprovision”) 

6)ipa will be generated at selected output directory "${OUTDIR}"