Skip to main content

Userful xcodebuild command lines

I setup Jenkins jobs to build iOS project for QA and release. Here are some useful xcodebuild commands that I use. Tested with XCode 9.

Create a xcarchive file
xcodebuild -project ${APPNAME}.xcodeproj -scheme ${APPSCHEME} -configuration Release clean -archivePath "${WORKSPACE}/${APPNAME}.xcarchive" archive

Create an IPA from xcarchive file with exportOptions.
xcodebuild -exportArchive -archivePath "${APPNAME}.xcarchive" -exportPath "${WORKSPACE}" -exportOptionsPlist exportOptions.plist -allowProvisioningUpdates

If the above command doesn't create an IPA, try putting xcrun in front. To generate an IPA with the correct certificate and provision profile, you must set them correctly in exportOptions.plist. See example below.

Create an APP file for simulator
xcodebuild -project ${APPNAME}.xcodeproj -scheme ${APPSCHEME} -configuration Debug -sdk iphonesimulator clean build


Sample exportOptions.plist
<?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>method</key>
 <string>enterprise</string> //app-store, enterprise, ad-hoc or development
 <key>signingCertificate</key>
 <string>iPhone Distribution</string> //Certificate name
 <key>teamID</key>
 <string>T7L12345678</string> //The development program team identifier.
 <key>uploadBitcode</key>
 <false>
 <key>uploadSymbols</key>
 <false>
 <key>provisioningProfiles</key>
 <dict>
  <key>com.sample</key>
  <string>fe26f4e4-11d0-4054-898c-144a8se030a1</string> //Provision profile UUID
 </dict>
</dict>
</plist>

Update build version in Info.plist
/usr/libexec/Plistbuddy -c "Set CFBundleVersion ${BUILD_NUMBER}" "${WORKSPACE}/${APPNAME}/Info.plist"

Comments

Popular posts from this blog

Bose TV Speaker vs Sonos Beam

I have been searching a compact soundbar for my living room. The Bose TV Speaker (2020 model) and Sonos Beam (2018 model) are my final contenders.  Size and Build Bose 23.5 w x 2.2 h x 4.1 d. Sonos 25.6 w x 2.6 h x 4.0 d. Height is an important factor here considering lots of TVs have very low bottom clearance. For example, LG OLED is only 1.5 inches. Build quality on both soundbars is solid. I personally like the Bose better because it has metal grills instead of cloth on Sonos. Sound rtings.com's technical review is spot on. I'm not going to have an in-deep review here, but just to point out a few things I found that are important.  The sound profiles are very similar. Sonos has a little bit wider stage and able to fill the room with music better thanks to its extra side speakers. It's also more neutral sounding. Bose has a noticeable clearer dialogue. They both have a dialogue enhance feature, but I find the result is poor. For Bose, it makes the dialogue harsh and hurts

KML Collection iOS App

I often create apps I need that are not available in the app store. This is one of them. I usually plan my travel trip using Google My Maps to store all the interesting places I want to go. I needed an app that can import KML map files exported by Google and show all the places. I also want an easy way for me to open the place in my favorite navigation app. So, I created KML Collection using swift. App Store link