Can't generate release build for Cordova iOS App
The problem is that you do not have proper schemes. When phonegap project is generated it does not contain any schemes and thus linking to the phonegap files is incorrect.
Go to the phonegap generated project in console and put 'xcodebuild -list' in the output you will get that there is no schemes in the project.
Open generated by phonegap project in the xcode - this will generate schemes.
Now you can build this using xcodebuild(Remember to fill up the proper scheme name):
xcodebuild -scheme YOURSCHEMENAME -project MyApp.xcodeproj -alltargets -sdk iphoneos7.0 PROVISIONING_PROFILE="PROFILE_UUID.mobileprovision" -configuration Release
For continous integration this is bad solution because you have to launch the xcode GUI to generate the schemes but I did not found any other solution for this problem. If someone know how to generate scheme using command line it would be nice of him to write it down.
Related videos on Youtube
Aarush
Developed Mobile Applications using Phonegap(Cordova) for Android and iOS platform.
Updated on September 16, 2022Comments
-
Aarush over 1 year
I am using Phonegap CLI 3.1 and XCode5. I want to generate the release build for iPhone Application through command line, I have valid distribution certificate and mobile provisioning profile. I want to generate the release build totally through command and don't want to use XCode GUI or Phonegap Build. I have tried too much with xcodebuild, xcrun and even corodva build command but none of them provide me the release build file (either in .app format or .ipa).
Method 1 (Use xcodebuild)
a) xcodebuild -project MyApp.xcodeproj -alltargets -sdk iphoneos7.0 PROVISIONING_PROFILE="PROFILE_UUID.mobileprovision" -configuration Release
** BUILD FAILED **
The following build commands failed:CompileC build/MyApp.build/Release-iphoneos/MyApp.build/Objects-normal/armv7/AppDelegate.o MyApp/Classes/AppDelegate.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC build/MyApp.build/Release-iphoneos/MyApp.build/Objects-normal/armv7/MainViewController.o MyApp/Classes/MainViewController.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC build/MyApp.build/Release-iphoneos/MyApp.build/Objects-normal/armv7s/AppDelegate.o MyApp/Classes/AppDelegate.m normal armv7s objective-c com.apple.compilers.llvm.clang.1_0.compiler
(3 failures)
Method 2 (Use corodova build and xcrun to sign the app)a) cordova build ios -release
Compiling app on platform "ios" via command "/Users/Macuser/Desktop/MyApp/platforms/ios/cordova/build" --release Platform "ios" compiled successfully.
b) xcrun -sdk iphoneos PackageApplication -v "build/Release-iphoneos/MyApp.app" -o "build/Release-iphoneos/MyApp.ipa" --sign "iPhone Distribution: NAME (ID)" --embed "PROFILE_UUID.mobileprovision"
error: Failed to read entitlements from '/tmp/iyibGn3aUv/Payload/MyApp.app
-
Aarush over 10 yearsAs i have mentioned already i don't want to use xcode gui features. I know how to build app for release and Adhoc using XCode GUI. I don't want to open the xcode. I want to do the same using command line. like use xcodebuild, xcrun or cordova build command.
-
msrameshp almost 10 yearsdid you figure out a solution for this ?. I am facing the same issue. Any help is highly appreciated.
-
Captain Obvious almost 10 years@coolphon is there a way to generate the schemes using commandline? I'm trying to automate the building so i can't really do something like 'open en close xcode'..
-
ssmith over 9 yearsYou can generate the schemes automatically by using the
xcodeproj
Ruby gem (ie: gem install xcodeproj) and the following tiny script gist.github.com/shanesmith/8b88720c19b910cc9900 -
escapedcat over 9 years
-
Raghav over 9 yearsI have project where the schemes are created from GUI and shared, when I run the xcodebuild command its not working showing the coredova is not found.Is there any solution for coredova projects?
-
Alon Amir almost 9 yearsI wasted HOURS of my life realising the xcodebuild process is stuck in my jenkins just because I didn't open it up to generate the schemes. Thank you, and @ssmith !
-
Marc about 8 yearsApparently you can't use
-alltargets
when specifying a-scheme
on the command line.