Building complete SDL apps for iOS from the command line |
Ardillas del Monte
Guest
|
Hi,
My build environment is highly automatized (with a Make-derived custom environment), so that I build all executables for all my target platforms (and even their installers) by just issuing a "make" invocation. When using a Mac, by invoking "make", I cross-compile for Win32, for Win64, get a Win32 and Win64 installer (with all app icons properly set, etc..), and at the same time I build it for several OSX versions (and several architectures), getting the complete OSX app bundles, DMGs, etc... This is very convenient for me, because I just concentrate on writing the multiplatform code and doing the graphical design for icons, splash logos, etc... I don't need to waste time starting a graphical IDE, setting up a project, defining its resources, etc, etc, and repeating that task all over again for each target platform. Now I'm adding Android and iOS as another target platforms, and I wish to integrate them with such a convenient build system, so that when running on a Mac I also get Android and iOS app bundles. My main worry now is iOS, because its development is very tied to the Xcode IDE. I know you can build SDL for iOS from the command-line, by using "iosbuild.sh". However, that builds the library only, so I don't see how to build complete apps. Now I found this (very) useful blog post about building iOS apps from the command-line: http://commandlinefanatic.com/cgi-bin/showarticle.cgi?article=art024 But unfortunately it doesn't build the app bundle, just the executable. Is it possible to also generate the app bundle from the command line, and even code-sign the app with my Developer membership ID? And, last, if it would be possible to upload the app to iOS devices from the command line, that would be awesome because I would integrate app upload on my build system, but I understand I might need to start Xcode for this last step. If you know of any document or web page explaining everything I need, please tell!! ardi |
|||||||||||
|
Building complete SDL apps for iOS from the command line |
Alexander Szpakowski
Guest
|
Xcode comes with a suite of command-line tools (xcodebuild, codesign, etc.) which should do what you want.
SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
Building complete SDL apps for iOS from the command line |
Ardillas del Monte
Guest
|
Yes. However xcodebuild expects a project file AFAIK. I prefer to avoid project files because they're platform-dependent, and, for example, whenever I add a new C++ file, I'd have to modify the system-dependent projects for each platform.
In the link that I posted it's described how to build an iOS executable from the command-line, and also how to launch the iOS simulator from the command-line, so such important steps are already solved. The only remaining point AFAIK would be to generate the app bundle and code-sign it. I know how to generate OSX app bundles from the command-line (my make-derived build system does it automatically), but I suppose iOS bundles will be different. Is there any example I could follow? Thanks! ardi On Friday, July 4, 2014, Alexander Szpakowski wrote:
|
|||||||||||||||
|
Building complete SDL apps for iOS from the command line |
JetForMe
|
iOS development requires Xcode. it might be possible to build a Makefile that invokes all the same tools, but that'll be platform-dependent. Cmake can build Xcode projects and then invoke xcodebuild on them. But you're asking for a lot of pain trying to reproduce everything Xcode does to build an iOS executable. It's more than just building the binary. You have to create the bundle and put all the pieces in the right place, PNGs have to be processed (not strictly necessary), NIB files have to be compiled and put in the right place, plists, etc. And to top it all off, it has to be signed (which is also possible from the command line, IIRC. Also, not necessary just for running in the sim). But you'll be duplicating a lot of work, and it'll probably break with subsequent Xcode releases. And no matter what, you'll only be able to build on OS X with Xcode installed (the command line tools are required). And you probably won't be able to put it onto a device.
On Jul 5, 2014, at 00:24 , Ardillas del Monte wrote:
-- Rick _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||||
|
Building complete SDL apps for iOS from the command line |
Jeffrey Carpenter
Guest
|
Ardillas,
Hello, there! In short, no, there are no concise examples or documentation on how to do this; you will surely have to do as I have, and spend many hours of piecing together bits of information that are dug up in man pages & online articles (most times with out-dated steps). My experimentation thus far with automation of iOS builds from command line relies on CMake [1] that you might find some use in looking at (see also: CMakeLists.txt & dist dir). I am assuming XCode generated project files via CMake, though, in my use case. At any rate, using CMake conveniently resolves the issue of creating the app bundle for me, along with the code signing and so forth, ultimately leaving me with the sole task of compiling the software with xcodebuild (see dist/cmake.sh & dist/xcode.sh). (Admittedly, I do not wish to replace XCode entirely, mostly for reasons that Rick Mann has mentioned). You should be able to manually code sign the generated app bundle with the following command: codesign -s 'Developer Distribution Name' ./bundle.app As far as generating an app bundle, although I rely on CMake its XCode generated project files to do the majority of the work for me, you might well get away with a simple script that creates the directory hierarchy, a copy of the app binary generated with the compiler (xcodebuild & clang in my case...), resource files, and appropriate Info.plist file you make for the project. (This process definitely works with OS X binaries.. and maybe it will for iOS binaries, too?) I've had success with installing the resulting app bundle via iPhone Simulator with [2]. Although I am not aware of a *direct* means of uploading the app to the iOS device, you may consider using a service like TestFlight [3] and helper scripts like the ones in my repo [4] and [5]. (The archival of the app bundle is for TestFlight...) In short, this allows one to build the iOS app & then upload to TestFlight's servers, where you can then quickly access the app installation from your iOS device via the web. Admittedly, this may be a bit too tedious / slow for continuous building & testing of an app, but perhaps you can improve upon this! 1. https://github.com/i8degrees/hello-sdl2-ios-cmake/ 2. https://github.com/i8degrees/hello-sdl2-ios-cmake/blob/master/dist/iphone.sh 3. https://www.testflightapp.com/ 4. https://github.com/i8degrees/hello-sdl2-ios-cmake/blob/master/dist/testflightapp.sh 5. https://github.com/i8degrees/hello-sdl2-ios-cmake/blob/master/dist/archive.sh I'd be happy to try answering any questions that you may have, if you find this information of any use! :-) I'm hoping / assuming you are comfortable w/ basic CMake usage... Cheers, Jeffrey Carpenter On 2014/07/ 04, at 16:21, Ardillas del Monte wrote:
_______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
Building complete SDL apps for iOS from the command line |
slvn
|
Ardillas,
As you said xcodebuild helps to build stuff from command line. there a script to use xcodebuild to build SDL libs, https://bugzilla.libsdl.org/show_bug.cgi?id=2302 (similar to iosbuild.sh) As you have said also, it's possible to generate the xcode app projet from cmake, and (surely) to build also the executable. Maybe there is target "archive" to build the app bundle ? Also, it would be nice to share your automatic script for creating bundle for MacOSX ! Cheers, Sylvain On Wed, Jul 9, 2014 at 6:25 AM, Jeffrey Carpenter wrote:
-- Sylvain Becker _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||||
|
Building complete SDL apps for iOS from the command line |
Jeffrey Carpenter
Guest
|
Sylvain,
Thanks for sharing that script -- it's much cleaner than the one I use! :-) The only addition I'd add to it is the convenience of using lipo to combine multiple architectures together, so that you are able to then refer to the same library file for both iOS and iPhoneSimulator builds. I did it in mine like so: $ lipo -create /private/tmp/SDL2/Debug-iphoneos/libSDL2.a /private/tmp/SDL2/Debug-iphonesimulator/libSDL2.a -output "${HOME}/Projects/hello-sdl2-ios-cmake.git/third-party/ios/SDL2/libs/libSDL2.a" # rinse and repeat for libSDL2_image.a, libSDL2_ttf.a, etc My complete script can be found here: http://pastebin.com/Raqdv4hS Cheers, Jeffrey Carpenter On 2014/07/ 09, at 1:48, Sylvain Becker wrote:
_______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||||||
|
Building complete SDL apps for iOS from the command line |
Ardillas del Monte
Guest
|
Lots of very useful information in your post, Jeffrey!
Thanks a lot. I think I've now all (or almost all) everything I need to build complete iOS app bundles from the command line. Thanks! ardi On Wed, Jul 9, 2014 at 6:25 AM, Jeffrey Carpenter wrote:
|
|||||||||||||||||
|
Building complete SDL apps for iOS from the command line |
Ardillas del Monte
Guest
|
I think xcodebuild requires project files, and I avoid project files (I never use xcodebuild for creating complete OSX app bundles).
Regarding my automatic Makefile-derived build system, it's not easy to redistribute, because it's too tied to my (very huge) source code hierarchy. It's complex. Anyway, if you're interested in just creating OSX app bundles, my advice is to download wxWidgets and compile it yourself for OSX from the command line. Then build also some demos from the command line. The wxWidgets Makefiles create a complete app bundle for each demo (even with the icon, and everything). I learnt from wxWidgets most (or all) the info I needed for creating OSX apps from the command line. ardi On Wed, Jul 9, 2014 at 8:48 AM, Sylvain Becker wrote:
|
|||||||||||||||||
|
Building complete SDL apps for iOS from the command line |
slvn
|
Jeffrey, thanks also for your script which looks more complete, as it
use lipo to merge all arch! Ardillas, I have had a quick look at wxWidgets and there is a quite big amount of files. It would be nice if you could point me to the few files that do the osx bundle thing! thanks On Thu, Jul 10, 2014 at 1:53 PM, Ardillas del Monte wrote:
-- Sylvain Becker _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||||||||
|
Building complete SDL apps for iOS from the command line |
Jeffrey Carpenter
Guest
|
On 2014/07/ 15, at 13:40, Sylvain Becker wrote:
:-)
1. http://wiki.wxwidgets.org/WxMac_Issues#Building_a_MacOSX_application_bundle
_______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||||||||||||||
|