Wednesday, May 6, 2015

[iOS]Generice Xcode Archive vs iOS App Archive

The type of Generice Xcode Archive can't be submit to Apple store or Crashlytics, but you directly debug running on device and simulator, it's in the Other Items rather than iOS Apps in Archives(Xcode > Window > Organizer) window.

Check the settings below when this happened:

  1. Skip install is NO for the main project target
  2. Skip install is YES for framework (sub-projects) targets
  3. In Build Phases for sub-projects, Copy Headers needs to be in Project, not Public (does not apply if building static library)
  4. Installation Directory under Deployment is valid (/Applications for example)

NOTE: since Xcode 7, the solution above doesn't work, what you have to do is to remove all the reference library sources from app target > Build Phases > Target Dependencies & Linked Binary with Libraries

Thursday, April 30, 2015

[iOS]Appledoc Shell Script Example

It's very easy to generate objc documentation for you with AppleDoc, here are the steps to setup in Xcode:

  1. Select you project name
  2. Try add add a target, and in the popped window select iOS > Other > Aggregate to create target named PROJECTDocs
  3. Then select new added target, to add "New Run Script Shell" to add the script like the below:
    export HOMEDIR=`pwd`
    echo "Generating AppleDocs!"
    echo "Current directory is $HOMEDIR"
    
    /usr/local/bin/appledoc \
    --project-name "$PROJECT_NAME" \
    --project-company "Company, Inc." \
    --company-id "com.company" \
    --output "${HOMEDIR}/build_products/" \
    --logformat xcode \
    --keep-undocumented-objects \
    --keep-undocumented-members \
    --keep-intermediate-files \
    --no-repeat-first-par \
    --no-warn-invalid-crossref \
    --ignore "*.m" \
    --ignore "*Private.h" \
    "$SOURCE_ROOT/$PROJECT_NAME"