Including .dSYM file inside .ipa file - ios

For iOS builds with Xcode 8, is it possible to include a generated .dSYM file into the .ipa file?
I'm building my ipa files like this (in Jenkins but it shouldn't matter) ...
# Create xarchive
xcodebuild
-workspace /sourcepath/myapp.xcworkspace
-sdk iphoneos
-scheme 'Distribution Production'
-configuration 'Distribution Production'
-archivePath '/outputpath/Distribution Production-iphoneos/myapp.xcarchive'
'CODE_SIGN_IDENTITY=********'
'PROVISIONING_PROFILE=App Enterprise PRD'
DEBUG_INFORMATION_FORMAT=dwarf-with-dsym
archive
# Create IPA
xcodebuild
-exportArchive
-archivePath '/outputpath/Distribution Production-iphoneos/myapp.xcarchive'
-exportOptionsPlist '/outputpath/Distribution Production-iphoneos/export_options.plist'
-exportPath '/outputpath/Distribution Production-iphoneos'
This generates an xarchive and lastly an ipa file. The xarchive then contains the .dSYM file but I'd like to have the .dSYM in the IPA file instead. Is this possible?
I tried using these arguments in addition when creating the xarchive:
'DWARF_DSYM_FOLDER_PATH=/outputpath/Distribution Production-iphoneos'
'DWARF_DSYM_FILE_NAME=Distribution Production.dSYM'
... but then the xarchive doesn't contain the dSYM and it isn't being found anywhere else.

Related

Making IPA from command line xcode 9

i have many projects embedded in single main project, i am trying to automate the build process. but issue is that i cant make build using command line.
Clean project
xcodebuild clean -project TestingCommandLine.xcodeproj -configuration Debug -alltargets
Make Archive
xcodebuild archive -project TestingCommandLine.xcodeproj -scheme "TestingCommandLine" -configuration Debug -archivePath myApp.xcarchive
Build IPA
xcodebuild -exportArchive -archivePath myApp.xcarchive -exportPath myApp.ipa -exportOptionsPlist exportOptions.plist
the same process works with simple project which does not have any dependencies.
The following build commands failed:
Ld watchos/Watch\ Extension.appex/iskanWatch\ Extension normal armv7k
(1 failure)
This is the actual failure error comes when i try to build.
Any help will be appreciated.

IPA Export Using XCodebuild and shell script

I've been searching for long time for a way to export IPA using Xcodebuild and shell script , all i found was an old code and even XCodebuild error aren't understandable for me . Please if there's one who have tried to do this and found a solution for it , that will be awesome and helpfull
PS: In fact i've found a solution this script to generate IPA
THIS IS MY CODE
xcodebuild clean -workspace "${WORKSPACE_ABSOLUT_PATH}" -scheme "${SHEME_NAME}" -configuration Release
###Cleaning XCodeproj(Without Pods)
xcodebuild clean -project "${PROJECT_ABSOLUT_PATH}" -scheme "${SHEME_NAME}" -configuration Release
####Setting (Prod) Boolean value
#echo -n "" >"${PLIST_CONFIGURATION_NAME}"
##
#echo "Prod boolean value is $8"
##
#echo "<?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>Prod</key><${PROD_BOOLEAN_VALUE}/></dict></plist>" >> "${PLIST_CONFIGURATION_NAME}"
##
#head "${PLIST_CONFIGURATION_NAME}"
#
#
###Preparing Archive (Generate .xcarchive file)
##
xcodebuild archive -workspace "${WORKSPACE_ABSOLUT_PATH}" -scheme "${SHEME_NAME}" -archivePath "${ARCHIVE_ABSOLUT_PATH}"
##
#
##Export Archive file (.xcarchive) to (.ipa) file
#
xcodebuild -exportArchive -archivePath "${ARCHIVE_ABSOLUT_PATH}" -exportPath "${IPA_ABSOLUT_EXPORT_PATH}" -exportFormat ipa -exportProvisioningProfile "${PROVISIONING_PROFILE_NAME}"
Since Xcode 8.3 , you will not be able to select provision profile for the ipa...
see if this tool helps you
https://github.com/johnny77221/export-IPA

Exporting xcarchive and IPA in xcode 6.4

I want to make build scripts for my app to export xcarchive and ipa files.
I used following command to export xcarchive:
xcodebuild -scheme myscheme archive -archivePath path/appname.xcarchive
Which gave me an xcarchive file and I used following to export IPA file:
xcodebuild -exportArchive -exportFormat IPA -exportProvisioningProfile *** -archivePath path/appname.xcarchive -exportPath path/appname.ipa
And I got following error regardless of what I typed in front of exportProvisioningProfile.
no provisioning profile matches ***
** EXPORT FAILED **
What should I write insted of *** in front of exportProvisioningProfile?
The name of the provisioning profile. This is the same name as seen on the page (https://developer.apple.com/account/ios/profile/profileList.action). If you have spaces in that name you need to write the name with quotes. E.g.
xcodebuild -exportArchive -exportFormat IPA -archivePath
MyMobileApp.xcarchive -exportPath MyMobileApp.ipa
-exportProvisioningProfile 'MyMobileApp Distribution Profile'
It may also be that you have not downloaded the provisioning profile, try re-downloading it and opening it with Xcode to install it in the correct location.

Cannot generate adhoc IPA from command-line but it works in Xcode

I'm trying to generate an adhoc IPA from the command-line but I cannot get it to works.
I can however generate an adhoc IPA from Xcode doing Product -> Archive and Export... in Organizer.
Here is how I proceed to generate an IPA on the command-line
xcodebuild -project DemoApp.xcodeproj -scheme DemoApp archive -archivePath build/DemoApp.xcarchive -configuration Release
xcrun -sdk iphoneos PackageApplication -v build/DemoApp.xcarchive/Products/Applications/DemoApp.app -o build/DemoApp.ipa --sign "iPhone Distribution" --embed DemoApp_Adhoc.mobileprovision
When I install the generated IPA via iTunes, it doesn't install properly on the device. The icon is greyed out and the title says "Installing..." like here.
I've checked the provisioning profile, the UUID, etc.
I tried with shenzhen but got the same behavior.
Can you spot what I'm doing wrong?
Thanks!
Finally I did not find the problem with PackageApplication but as a workaround I used PROVISIONING_PROFILE and CODE_SIGN_IDENTITY environment variable with the xcodebuild step and it worked.
Here are the new commands:
xcodebuild -project DemoApp.xcodeproj -scheme DemoApp archive -archivePath build/DemoApp.xcarchive -configuration Release PROVISIONING_PROFILE="00000000-0000-0000-0000-000000000000" CODE_SIGN_IDENTITY="iPhone Distribution: Company Inc (XXXXXXXXXX)"
xcrun -sdk iphoneos PackageApplication -v build/DemoApp.xcarchive/Products/Applications/DemoApp.app -o build/DemoApp.ipa")

Build Project From Terminal throws Provisioning Profile error

I am trying to create ipa of my application using terminal.
I am able to successfully build my application, but when converting into an ipa, it throws the following error:
Check dependencies
Code Sign error: No matching provisioning profile found: Your build settings specify a provisioning profile with the UUID “/Users/xxxx/Downloads/Certificate/xxxx.mobileprovision”, however, no such provisioning profile was found.
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.0'
** ARCHIVE FAILED **
When I try to build the same application using X-Code, it works fine with the same provisioning profile.
The script I am running to build the ipa is
xcodebuild -verbose -project Build_Project_From_Terminal.xcodeproj -scheme nameOfProject -configuration Release -sdk iphoneos clean archive CONFIGURATION_BUILD_DIR="/Users/xxxx/Desktop/xxxx/Project Name/build" PROVISIONING_PROFILE="/Users/xxxxx/Downloads/Certificate/xxxxx.mobileprovision"
EDIT 1:
I have changed my script to
DEVELOPER_NAME="xxxxxxxxx" APP_NAME="xxxxxx"
xcodebuild archive -project $APP_NAME.xcodeproj -scheme $APP_NAME -archivePath ./$APP_NAME.xcarchive
xcodebuild -exportArchive -exportFormat APP -archivePath ./$APP_NAME.xcarchive -exportPath ./$APP_NAME.ipa
iphoneos PackageApplication -v ./$APP_NAME.app -o ./$APP_NAME.ipa --sign $DEVELOPER_NAME --embed ./*.mobileprovision
With this I am getting $APP_NAME.ipa.app as output. When I try to install this, it does not install at all.
Any help will be appreciated.
Please use an alternate method. This is a working example
DEVELOPER_NAME="Your apple developer name"
APP_NAME="application name"
xcodebuild archive -workspace $APP_NAME.xcworkspace -scheme $APP_NAME -archivePath ./$APP_NAME.xcarchive
xcodebuild -exportArchive -exportFormat APP -archivePath ./$APP_NAME.xcarchive -exportPath ./$APP_NAME.ipa
iphoneos PackageApplication -v ./$APP_NAME.app -o ./$APP_NAME.ipa --sign $DEVELOPER_NAME --embed ./*.mobileprovision
Save above shell script in a file (abc.sh) and save that file in your project folder along with your provision profile. Run this script using terminal will save ipa in the project directory.

Resources