1

I'm trying to build the PhoneRTC demo on IOS after managing to get it to work on Android and web browser (OS X 10.10.2 Yosemite, XCode 6.1.1, Cordova 4.2.0 and my iPad is running iOS 8.1). My iPad is plugged in. I followed the installation steps for IOS:

  1. In General, change Deployment Target to 7.0 or above
  2. Go to Build Settings and change:

    • a. Valid Architectures => armv7
    • b. Build Active Architecture Only => No
    • c. Runpath Search Paths => $(inherited) @executable_path/Frameworks
    • d. Objective-C Bridging Header => [ProjectName]/Plugins/com.dooble.phonertc/Bridging-Header.h
    • e. Embedded content contains Swift Code => yes

I repeated steps 4a. - 4c. for the CordovaLib project as well.

When I run cordova build ios, the build fails. In the console, I see this:

Build settings from command line:
ARCHS = i386
CONFIGURATION_BUILD_DIR = /Users/Francis/Desktop/PhoneRTC/PhoneRTC/platforms/ios/build/emulator
SDKROOT = iphonesimulator8.1
SHARED_PRECOMPS_DIR = /Users/Francis/Desktop/PhoneRTC/PhoneRTC/platforms/ios/build/sharedpch
VALID_ARCHS = i386

This seems to indicate that cordova is ignoring the valid architectures I just specified. I tried rebooting my PC and my iPad also but that didn't help. cordova build ios --archs="armv7" doesn't work either.

Buiding from within XCode works, but that's not what I want since it skips the cordova build process.

Any idea how to tell/force Cordova to build against the architecture (armv7) I specified?

Francis BF
  • 13
  • 1
  • 4

3 Answers3

2

Use an xcconfig configuration file

During automated build, I create the file after my build script adds the iOS platform:

echo 'ARCHS=armv7 arm64' >> ${CURR_DIR}/platforms/ios/cordova/build-release.xcconfig

An excerpt from build logs:

> cordova build ios --device --release 

...
Build settings from configuration file '/Users/xxx/git/xxx/platforms/ios/cordova/build-release.xcconfig':
        ARCHS = armv7 arm64
        CODE_SIGN_IDENTITY = XXXX
        ENABLE_BITCODE = true
        PROVISIONING_PROFILE = XXXX
        VALID_ARCHS = armv7 arm64
e_ph
  • 31
  • 6
0

My suggestion is to use cordova prepare and then build from Xcode.

cordova prepare copies files and config settings but does not modify the native code or try to run the standard build process.

This is a common build path that I have used with all of my iOS/Cordova projects and seems to work well.

Dawson Loudon
  • 6,029
  • 2
  • 27
  • 31
0

According to this SO answer this is the solution (worked for me)

When you build you can specify what type of build to do:

cordova compile --device

or for i386:

cordova compile --emulator
Community
  • 1
  • 1
Ido Ran
  • 10,584
  • 17
  • 80
  • 143