How can I deploy (create .ipa) iphone application using 'cordova build ios --release'?

I created an iOS app for helloworld with cordova using the documentation . The application starts successfully when I start cordova emulate ios . What I cannot do while deploying when starting cordova build --release . It does not create any .ipa files. All I find is the Helloworld.build file in the PROJECT_ROOT/platforms/ios/build directory. Did I miss something?

+45
deployment cordova ipa
Jun 05 '14 at
source share
4 answers

I found this command that worked for me:

 cordova build ios --device cd platforms/ios/build/device /usr/bin/xcrun -sdk iphoneos PackageApplication "$(pwd)/$PROJECT_NAME.app" -o "$(pwd)/$PROJECT_NAME.ipa" 

Source: http://www.splinter.com.au/xcode-4-command-line-builds-of-iphone-apps/

I ran @MD. First a Mohiuddin Ahmed Ruby script that would modify my xcodeproj file. I’m not sure if this was necessary, but I don’t think so.

Edited to refine the process by adding the cordova build , as suggested by the comments.

+58
Jul 29 '14 at
source share

If you are using cordova ios 3.9.0 or later, you can use this command to create .ipa directly from the CLI without additional commands:

 cordova build ios --device --release 

You will need the build.json file in the root directory of your project

 { "ios": { "debug": { "codeSignIdentity": "iPhone Developer", "provisioningProfile": "your-dev-provisioning-profile-UUID-here" }, "release": { "codeSignIdentity": "iPhone Distribution", "provisioningProfile": "your-distribution-provisioning-profile-UUID-here" } } } 

To get the UUID, I open the .mobileprovision file in a text editor and look for the 'UUID', not sure if there is an easier way to find it.

If, with Xcode 8, build.json requires the developmentTeam and packageType , but no more provisioning profiles are required, codeSignIdentity must also be iPhone Developer for debugging and release:

 { "ios": { "debug": { "codeSignIdentity": "iPhone Developer", "developmentTeam": "FG35JLLMXX4A", "packageType": "development" }, "release": { "codeSignIdentity": "iPhone Developer", "developmentTeam": "FG35JLLMXX4A", "packageType": "app-store" } } } 

http://cordova.apache.org/docs/en/6.x/guide/platforms/ios/index.html#using-buildjson

+32
Feb 04 '16 at
source share

I finally found a way to automate this using xcodeproj , xcode and this ruby ​​script:

 require 'xcodeproj' xcproj = Xcodeproj::Project.open("HelloWorld.xcodeproj") xcproj.recreate_user_schemes xcproj.save 

And then in the PROJECT_ROOT/platforms/ios/ directory, this command helped me generate my *.ipa :

 xcodebuild -project HelloWorld.xcodeproj -exportArchive -exportFormat ipa -archivePath $(pwd)/HelloWorld.xcarchive -exportPath $(pwd)/HelloWorld.ipa CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -alltargets -configuration Release 

The thought that we can sign ours. ipa later :)

+5
Jun 08 '14 at 11:20
source share

You can try the new tool from http://fir.im .

They have a fir cli tool written in ruby. You can install it with the following command:

 sudo gem install fir-cli --no-ri --no-rdoc 

Sign an account (everything is free, like a good old test) and get a token from your profile. At the command prompt, do:

 fir login 

Provide your token.

CD to your directory where your .xcodeproj is located.

 fir build_ipa . 

After a while (if the build is successful), you will find your ipa in your ./build_ipa folder.

0
Jul 25 '15 at 16:13
source share



All Articles