Skip to content
Snippets Groups Projects
Select Git revision
  • master
  • ecma_2015
  • gulp_v4
  • upgrade_js_libs
  • Vivakvo/cesium-patch-8
  • issue_4
  • issue_780
  • gitlab_migration_1
  • dev
  • rml8
  • v1.6.7
  • v1.6.6
  • v1.6.5
  • v1.6.4
  • v1.6.3
  • v1.6.2
  • v1.6.2-alpha
  • v1.6.1
  • v1.6.0
  • v1.5.12
  • v1.5.11
  • v1.5.10
  • v1.5.9
  • v1.5.8
  • v1.5.7
  • v1.5.6
  • v1.5.5
  • v1.5.4
  • v1.5.3
  • v1.5.2
30 results

build_ios.md

Blame
  • Forked from clients / Cesium-grp / Cesium
    384 commits behind the upstream repository.

    Build Cesium for iOS

    Cesium can be build as desktop application for iOS. .

    Prerequisites

    Install an OSx VM

    Cesium comes with ready to use Vagrantfile, used to start a OSx VM easily.

    1. Install VirtualBox

    2. Install Vagrant

    3. Make sure Cesium-desktop has been checkout inside the path /platforms/desktop/ (or anywhere else). This should have been done, if you followed the installation steps.

    4. On a terminal, go inside platforms/desktop/arch/osx/, then start the VM:

    cd platforms/desktop/arch/osx/
    vagrant up --provision
    1. Connect to the VM:
    vagrant ssh
    1. Execute the build
    ./build-osx.sh

    This should download Cesium sources in Downloads/cesium_src and binaries web artifact in Downloads/cesium.

    Installing XCode 8 (XIP file)

    1. Download Xcode (8.2.1) : https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_8.2.1/Xcode_8.2.1.xip

    2. Copy the .xip file into directory platforms/desktop/arch/osx/

    3. Make sure to restart the VM (this is required to copy the XIP file)

    vagrant halt
    vagrant up
    vagrant ssh
    1. Unpack the XIP file
    unxip Xcode*.xip
    1. Install Xcode into /Applications, then configure xcode-select
    sudo mv Xcode.app /Applications 
    1. Configure xcode-select:
    sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

    Install Node JS

    1. Install NVM (node.js version manager) :
    2. Install node.js v5
    3. Install common node.js dependencies
    # NVM (Node version manager
    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
    export NVM_DIR="$HOME/.nvm"
    [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
    
    # Node.js
    nvm install 6
    
    # node-pre-gyp
    npm install -g nw-gyp node-pre-gyp

    Build from source

    1. Checkout Cesium source, from git, inside the directory /Users/vagrant/Downloads/cesium_src

    2. Install global dependencies (see Development Guide for versions to used) :

    npm install -g yarn gulp@3.9.1 cordova @ionic/cli@6.6.0
    1. Install project dependencies :
    cd cesium_src
    npm install
    1. Prepare ionic, to build on ios:
    ionic platform add ios
    ionic state reset
    1. Run cesium:
    ionic run ios
    1. Build binaries for emulator :
    ionic build ios

    Publishing to Apple store

    Pre-requisite

    Ensure you have a valid Certificate (with your private key) and Distribution Provisioning Profile associated to it in the OSX Keychain.

    See: https://help.apple.com/developer-account/#/devbfa00fef7

    Archive and upload to Apple Store Connect

    1. Prepare for iOS in release mode:
    ionic prepare ios --release --prod
    1. Generate archive for iOS generic device
    cd platforms/ios
    mkdir build
    xcodebuild -workspace Cesium.xcworkspace -scheme Cesium -sdk iphoneos -configuration AppStoreDistribution archive -archivePath $PWD/build/Cesium.xcarchive
    1. Create an export.plist file with the following content
    <?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>app-store</string>
        <key>teamID</key>
        <string>YOUR_TEAM_ID</string>
    </dict>
    </plist>

    Replace YOUR_TEAM_ID by the Team ID associated to your Apple Developer Account (see Membership section on https://developer.apple.com/account/)

    1. generate IPA for Apple Store
    xcodebuild -exportArchive -archivePath $PWD/build/Cesium.xcarchive -exportOptionsPlist $PWD/export.plist -exportPath $PWD/build
    1. Upload to Apple Store Connect:
    /Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool --upload-app -f $PWD/build/Cesium.ipa -u YOUR_APPLE_ID

    The command will prompt for your password, if you use two-factor authentication, you'll need to generate an application specific password for this command (see: https://appleid.apple.com/account/manage)

    1. Go to https://appstoreconnect.apple.com/, then My Apps and publish your App from there.