I try to follow this guide:
http://code.google.com/p/iphone-dev/wiki/Building
it wants me to build LLVM from source, but I already have one installed in Ubuntu using apt-get, why they want me to compile from source? can I use the one provided by Ubuntu community? if not, how will they coexist? should I uninstall apt-installed llvm first?
The guide you're looking at is several years out of date, and will most likely not work. (In fact, there are a ton of frustrated comments suggesting that it hasn't worked since at least 2011, as the Mac OS X 10.4u SDK is no longer available for download.)
The only supported platform for iOS development is Mac OS X. I would strongly recommend that you use that platform if you want to do iOS development, as basically all tutorials you will find online will assume that's what you're using.
That all being said, if the instructions were otherwise correct, you would still need to build LLVM separately from the version provided by Ubuntu, as iOS devices use ARM CPUs, and the distribution's LLVM will only compile binaries for your system (probably either x86 or x86-64).
Related
OK, putting aside the obvious packaging and signing issues, would it be possible to compile IOS/iPhone compatible executables, by using correctly constructed LLVM bitcode (IR) from a non-Apple operating system, such as Linux or Windows, i.e. by utilising some combination of Open Source compiler infrastructure such as LLVM, Clang or GCC?
Basically, what I'm contemplating is
Compile a pre-existing cross-platform SDK (IOS-compatible) to LLVM Intermediate Representation (IR/bitcode).
Analyse and identify the IOS-specific LLVM (IR) function calls within this layer, using LLVM analysis tools.
After the compilation of the SDK to LLVM IR on the non-Apple system, replace the Apple/IOS-generated-LLVM-bitcode-SDK-representation within the corresponding LLVM IR function calls generated by the non-Mac host.
[possibly] employ the build flags emitted by the Mac's XCode/Clang/LLVM infrastructure, in order to build the IOS-compatible executable on the non-Apple host compilation machine (e.g. Linux or Windows).
If this is at all feasible, I would later investigate the creation of an iPhone/IOS bundle (the construction of IPA is documented, ask Google) and use the open-source Apple code-signing routines, already in use within other cross-platform IOS SDK's
RoboVM doesn't support cross-compiling iOS apps from OSes other than Mac OS yet but we plan on supporting that in the future. Here's an iOS cross-compilation toolchain which runs on Linux that may be of interest to you: https://code.google.com/p/ios-toolchain-based-on-clang-for-linux/.
Looks like Java-to-IOS is being taken care of by the RoboVM project:
Java to Native
The RoboVM compiler translates Java bytecode into native ARM or x86
code. Apps run directly on the CPU. No interpreter or virtual machine
involved.
It makes use of LLVM, as my question suggested.
Also of note is the Avian JVM project. It to can be used to compile to native and IOS binaries (by bundling the JVM), however, I'm uncertain as to the status or completeness of its user interface (UI) layer(s).
Both project appear to be in current and constant development.
I was reading some sort of article stating you need Mac OS X to develop iPhone apps.
Is there really such a restriction?
Can't you just download the SDK (and the iOS developer program) IDE to Windows?
Yes, you do need Mac OS X for that. Xcode (SDK) will only work on Mac OS X.
However, if the legal part for you is not really important you can install Mac OS X on your normal PC. Just google "Hackintosh".
You don't need an actual Mac, just Mac OSX. If you don't feel like buying a mac than you can get a hold of the image of Mac OSX and install it onto your PC using Virtual Machine software. I use VMWare to run MacOSX from my Windows 7 x64 machine. VM's are a great way to go, the driers can take a bit to setup, but once everything is working it's perfect. VM's even support ethernet so from within the VM you can browse the web, download mac apps. Install things like XCode or GameSalad. I suggest researching how to use Virtual Machines.
One near-solution is to run OS X in a Virtual Machine on a Windows platform.
You're then developing on XCode on OS X, in a VM on Windows.
This way, you don't have to buy a Mac, or dedicate the hardware to a "Hackintosh".
Of course, this may not be legal by the license terms; I'm only speaking about the technical possibility.
You absolutely need Intel Macintosh hardware to develop iOS apps. The iOS SDK requires Xcode and Xcode only runs on Macintosh machines. I think that any Intel Mac will work, but with how fast things are changing a newer machine will get you longer time before you are forced to upgrade the machine.
Nope, you need an Intel-based Mac to develop apps for iOS. There is no iOS SDK for Windows.
That being said, there might be a way to use something like PhoneGap to develop your app "elsewhere" and then create a suitable package for iOS as well as other mobile platform. I am not familiar enough with PhoneGap and similar tools to know about this angle with any more certainty though.
You can't, there is no iOS SDK for Windows, it only has a Mac version. However, there are various emulators for Mac out there that you can try to install onto Windows. I've tried this before and it did work, however the performance was really poor. If you really wanted to do iOS development. I would strongly suggest you to actually purchase a Mac.
One year later...
I am not familiar with the prerequisites for developing native iOS apps, but wanted to add the possibility of creating a hybrid mobile application. Usually even then one needs the native tools and SDKs for building the wrapper application. But PhoneGap provide a cloud-based build service, which seems to do the job:
"What about developer accounts and SDKs? Do I need to set those up
before starting with PhoneGap Build?
No! But you might want to install some of the SDK emulators if you
don’t own a particular device that you want to test a build for."
Source: PhoneGap Build service
I have not tested the service myself. Just wanted to give an additional path to consider.
To be clear for iPhone apps development required Mac Computers. Xcode and iOS SDK to lead through the app development.Objective-C is the programming language which is most required for iOS app development to build apps. And to be frank, there is a difference between iOS and OS X. iOS and OS X share more framework. So porting app works from OS X to iOS is possible with a little work. If you are a cocoa developer you would be adapt to these frameworks easier.
Check for more information: developer.apple.com/library/ios/documentation/Miscellaneous/Conceptual/iPhoneOSTechOverview/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007898
You can just install MacOS X on windows platform with the help of VMWare which you can use both of operating systems simultaneously side by side.
If you try develop iOS app with cordova like tools, you can simply build with the required SDK and compile it as iOS app then test it on your iPhone or any virtual emulators.
So this is an old question but also the first to appear for me in Google and I finally found a legal way. In 2020 you can go with MacInCloud, costs one dollar an hour for a basic plan. You can code everything elsewhere and then just use the cloud service to deploy the final steps in Xcode. Don't know about installing on your own ipad for testing, haven't gotten there yet.
Yes, you´re gonna need a MacBook or alike to develop for iOS. In my opinion, one of the biggest problems of developing apps for iOS is that you regularly have to buy a new MacBook (or another Mac based technology computer), since over time the most current version available of xCode for your already recently outdated OS X becomes incompatible with the newest iOS.
Is it possible to use newer headers with an older version of gcc ?
I have gcc 4.2.1 on my ipod (which I learned has a compiler that can be installed with cydia) but I have gcc 4.4.3 on my distro. I was wondering if I need to get the original headers (if thats even possible, I know gnu likes to phase way older versions out) or if I can just use the ones from my distro?
In particular, I'm talking about g++.
EDIT: just found this going to follow it.
jeremyg:Building c/c++ applications using gcc/g++ on iphone
NEW EDIT:
Found this Trying to compile Hello World example but can't find objc library?
antirez iphone-gcc tutorial
Edit: Well I'm in one hell of a spot lmao I've got full C support and an almost usable g++ compiler and the open toolchain(torrented a "working version") that needs minor modifications.
if i could just get objc working on my ipod I wouldn't mind using objc the whole purpose is to of course is to make apps :D
one quick question the toolchain was compiled on an amd64 machine but for i686 so that makes it intel compatible? I'm not sure the whole amd64 thing is throwing me off ;P
You shouldn't need to, there's no reason for the gcc on your PC and on your iPod to be the same. What are you trying to do?
I have a development Mac running 10.5. This causes my apps to not work in 10.4 (Google "_nsdefaultrunloopmode tiger"). I read the solution is to install the 10.4 SDK and compile against that. I have it installed (at least I have /Developer/SDKs/MacOSX10.4u.sdk)
Now I can't find a way to actually use that - I'm doing two things:
1) Compiling a library (SDL) using Makefiles
2) Compiling the program using Eclipse
I can't find a way to specify the SDK version in either of these two scenarios. Documentation doesn't seem to mention how to do it, so I'm thinking I'm overlooking something obvious. Any help?
If you look at the commands issued by Xcode for a build with the 10.4 SDK selected you will see that gcc/g++ flags include:
-isysroot /Developer/SDKs/MacOSX10.4u.sdk
and
-mmacosx-version-min=10.4
With the latest Xcode and SDK 3.0 beta when you create a new iPhone project, Xcode creates an SDK 3.0 project. If I want to revert to SDK 2.2.1 after the project has been created, I need to change something in the generated source code files since some of the APIs have changed. Is there a simple way to specify at project creation time the SDK I want to use explicitly?
Thank you in advance
I can't comment specifically on iPhone SDK 3.0 as it's covered under NDA; there's a forum for disclosed developers at devforums.apple.com. But Roger Nolan is half right and half wrong. He's half right in that when any SDK is updated, the examples and templates in that SDK are updated to exploit it. That is, the templates may specifically use the new APIs in that SDK, and the code might plain just not work with earlier SDKs.
That said, you can save project templates from earlier SDKs and install them in a local directory (like ~/Library/Application Support/Developer/Shared/Xcode/Project Templates) for use with later versions of Xcode. The project template format itself hasn't changed; templates should be forwards and backwards compatible, but the content of the templates is usually locked to the SDK version it ships with and later.
Mr. Nolan is half wrong about building against earlier OS versions with later SDKs. That's why the earlier SDK packages are provided with the later distributions (they're not there just to make the downloads take longer). You can deploy against older OS versions with a newer SDK by setting the Deployment Target build setting.
There is the minor detail in that you probably shouldn't deploy production applications produced by a pre-production toolchain. But once version N is officially released, you should be able to use its toolchain to build for N-1, N-2, etc.
Provided that you're not using any new features in the 3.0 API, you should be able to select the Active SDK from the dropdown menu on the upper left corner of your Xcode project window. Simply select "Device - 2.2.1" or "Simulator - 2.2.1"
Xcode defaults to the newest SDK installed, and I'm not aware of any method to change that behavior.
I made it a habit to set the base SDK to 2.0 in the project properties right after I create the project.
When using a Beta toolchain, you should install it alongside the latest released toolchain, not in place of it. Create your projects in the production toolchain, then open them with the beta toolchain to to do compatibility testing.
You will need the released toolchain anyway in order to do distribution builds. You should not build for distribution with a beta toolchain.
There is not according to Apple. Comments to my posting from Can Berk Güder say otherwise. I would not suggest following his example - it's a lottery hoping Apple can't see what you are doing or that you do not fall foul of a 3.0 defect.
You can use Xcode to build for earlier versions of the OS but if you need to build with multiple SDKs you should install them. Xcode supports multiple installations on a single machine and the install instructions document how to do it.
If you want to use the 3.0 SDK you can't built for OS 2.2.1 and submit that application to the app store - according to Apple's guidelines. They say that you must also install the 2.2.1 SDK and build with that. You can build 2.2 compatible apps but you are using beta tools which might introduce bugs.
It's one of those things that you can do as an intellectual exerxcise but, it's just not worth the risk for a real app.