21

Is it possible? If so, I would like to try this if only to learn more. Xcode seems to do so much automatically I would like to know what it really takes to make an iPhone app without all the setup being done for me in advance.

I realize this may be asking a lot, so if you feel like painting with broad stokes go ahead. I would like to just get an initial grasp of what would be needed to do this.

Ideally I would want to keep the option of running the app in the simulator or on my phone. (How else would I be able to test and debug?).

Thanks!


EDIT 1

From some of the responses we've got I see my intention needs to be clarified. The idea is to learn more about what Xcode provides in the process of developing iPhone apps. I don't want to necessarily circumvent Xcode, I just want to know what it actually does.

Maybe a list of some sort could be a place to start. Something like: to avoid using Xcode you would need to figure out how to create targets, code sign, etc.

I hope this helps.

3
  • 1
    Comment not an answer: Xcode just makes a boatload of plists for everything, and then some files that I have idea what they are. I would start investigating/learning what all that stuff is for. Starting from scratch really doesn't make sense for this platform, but there are opportunities. For instance, delete all targets and try to make 'em from scratch. But use git (or something), because many times you will not be able to move forwards :) Commented Jan 3, 2012 at 18:15
  • 1
    What about building using xcodebuild? Commented Mar 10, 2013 at 22:25
  • I want to circumvent. Commented Sep 22, 2017 at 19:03

11 Answers 11

17

All wrong...Xcode simply builds a binary plist of the nibs and allows you to call them as objects...you can do the same thing using GCC alone...

  1. Create a main.m, RootControlViewer.h, RootControlViewer.m, and AppNameApplication.h
  2. delegate...
  3. Create a makefile...
  4. include the necessary compiler flags, destinations to the frameworks and needed include files...
  5. And from the shell enter "make" and you have application.app generated...

  6. Place them in a payload folder...

  7. zip and rename zip to IPA...
  8. then use the sign command to sign the package...

I've been working on an XCODE clone for windows, Mac, and Linux... :-) all controls are generated in pure code (no nibs) and I've already completed the interface builder and can create working installable apps...am currently writing an "interpreter" to be used so that the syntax will be more "BASIC" like and when you press build..all code is converted to obj-c...built using gcc...and ready for deployment :-)

Sign up to request clarification or add additional context in comments.

3 Comments

And do you ever plan on releasing this little gem? :)
Your project sounds fascinating. Have you released it?
10 years and we're still waiting for this, dont give up @matthew-combatti the world needs this!
4

The limitations of life without Xcode

It really depends on what level of pain and what compromises you want to make. Essentially there is no iOS development for the AppStore without a Mac and Xcode.

Some problems and examples without Xcode

  • Codesigning codesign
  • AppStore upload
  • Libraries UIKit
  • Toolchain clang

This isn't to say the problems can't be overcome to some extent, but it starts to push you out of the AppStore and into the world of jailbreaks. So if you still want to develop for the device, simulator and AppStore proper there is a lot you can do without Xcode projects.

Choice of debugger and IDE

You can use vi or AppCode. Any text editor will do. You'll still want to install Xcode on your computer for the purposes of having the compiler toolchain and the necessary libraries. Really no getting around that. Then to debug you can use lldb at the command-line. Installing and managing apps can be handled via ios-deploy.

A Hello World of Sorts - Untitled.app

Github Project

I'm going to build a (extremely) basic app for iPhone Simulator. The basic idiom of an app is a folder with the .app extension containing an Info.plist and a binary compiled for the target. The Info.plist contains the display name, bundle identifier and binary name.

Makefile

Building the app is probably the hardest part. The Makefile is unnecessary, but it helps keep you sane.

default: main

.PHONY: clean

clean:
    rm main

SYSROOT:=$(shell xcrun --sdk iphonesimulator --show-sdk-path)
main: main.m
    clang -isysroot $(SYSROOT) -framework Foundation -framework UIKit -lobjc -o Untitled.app/$@ $<

Untitled.app folder and Info.plist

Create a folder called Untitled.app and add an Info.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
    <string>Untitled</string>
    <key>CFBundleExecutable</key>
    <string>main</string>
    <key>CFBundleIdentifier</key>
    <string>com.cameronpalmer.Untitled</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>Untitled</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>1</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
</dict>
</plist>

main.m

#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(id)options {
    NSLog(@"%s", __PRETTY_FUNCTION__);
    CGRect mainScreenBounds = [[UIScreen mainScreen] bounds];
    self.window = [[UIWindow alloc] initWithFrame:mainScreenBounds];
    UIViewController *viewController = [[UIViewController alloc] init];
    viewController.view.backgroundColor = [UIColor whiteColor];
    viewController.view.frame = mainScreenBounds;
    self.window.rootViewController = viewController;

    [self.window makeKeyAndVisible];

    return YES;
}

@end

int main(int argc, char *argv[]) {
    NSLog(@"%s", __PRETTY_FUNCTION__);
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

Build and install it on the simulator

# Build
make
# Boot
xcrun simctl boot <UUID_OF_DESIRED_SIMULATOR>
# Install
xcrun simctl install <UUID_OF_BOOTED_SIMULATOR> ./Untitled.app
# Open Simulator app
XCODE_PATH=$( xcode-select --print-path )
open "${XCODE_PATH}/Applications/Simulator.app"

Now just launch the app and you'll get a white box in the simulator.

Comments

2

Have a look at this.

I haven't used it myself but looks like does whatever Xcode does.

3 Comments

It requires Mac system thou. But otherwise then that it's great :-)
yes it sure does(he didn't mention that he wanted to run that on other platforms). And it looks like it uses the iOS simulator app of the iOS sdk itself.
IntelliJ does not require a Mac.
2

If you jailbreak your iOS device you can install the gcc toolchain from Cydia and develop and compile apps directly on your device. You will not be able to put these apps on the appstore but it is a fine way to learn Apple's APIs.

If you're interested please comment and I will expand this post with a how-to and a small example.

2 Comments

hmmmm... this sounds interesting. I wouldn't want to jailbreak my device though. Using Cydia, could I run apps on the simulator?
Do you mean whether you can still run other applications developed using Xcode or do you want to run apps on the simulator that are developed using the GCC toolchain I mentioned above? The former is possible and the latter is not.
1

You can basically create 2 kinds of apps on the iPhone : a)Web Apps b)Native Apps

a) Web Apps can be created by using only Javascript and then saved onto the homescreen of the iOS device. On clicking them they run in the browser.

b) Native Apps are also of two kinds.

  1. Purely native : Made completely using Xcode. Can have templates, plugins, calls to other applications, etc.

  2. Apps that start out as Web Apps/SAP based apps/etc and then can be MADE INTO NATIVE apps. In this category you have Sencha Touch, JQuery Mobile, etc. These apps run natively on the phone, generally use a phonegap or like plugin in Xcode and can be put onto the AppStore.

You can follow this tutorial on creating a simple XCode app from scratch. http://techtalktone.wordpress.com/2011/11/26/hello-world/

If you want something that will NOT require you to make an ADC account or sign up as a developer and still create stunning apps, try this tutorial : http://techtalktone.wordpress.com/2011/12/05/testing-your-ios-apps-on-a-jailbroken-device-2/

Hope this helps :)

Comments

0

It is possible if you choose to write the code in other languages than Objective-C.

You can use some cross-platform SDK to develop apps such as

Corona or Unity or PhoneGap as listed above post.

2 Comments

At least with PhoneGap, you still need Xcode to compile for iOS.
You have option to build it on the server of the provider
0

It isn't possible to develop native iOS apps without Xcode. Apple would not allow this, you even need apple's OS te develop native apps! It is however possible to create mobile applications with frameworks and platforms such Phonegap. With them you can create mobile applications with HTML, CSS and Javascript instead of native objective c. If you use the frameworks you can use your own software of choice.

Edit:

You could even use MonoTouch of you are willing to pay. I've developed a test application with Mono and i'm impressed by the possibilities.

5 Comments

I think he wants to build an application 'from scratch' without depending on all the heavy lifting that xcode does WRT .xib files, debugging, etc. I've done this with palm os development in the past, but the level of complexity on the iphone is so much larger that it would be a lot of work, for very little benefit
@Petesh I would say "level of exposed complexity." Is iOS really more complex than other platforms?
@Yar Doing the work 'from scratch' is significantly more complex than I could expand upon in a comment. You need to compile for different platforms when building for the simulator vs. the phone, you need to sign the code for use in the device. I have no idea how to run a debugger from the command line to connect to the device/simulator (remote gdb?). I have no idea how to get the app to the device/simulator from outside xcode. Designing the UI without Interface Builder??
@Petesh, in essence you're right. The way the platform is constructed, other players like AppCode actually rely on Xcode for most things, like targets (but not schemes).
With MonoTouch/Xamarin, you still need Xcode to build for iOS
0

You can use a tool called theos which allows you to create apps that can be run on a /jailbroken/ device. It allows you to create native apps that can be run on the device (not using html or anything else). You also do not have to have a code signing identity to run these apps on your device.

Heres a link on how to install, unfortunately there is little to no documentation.

Comments

-1

It's not. Emulating what Xcode does would involve reverse engineering a good deal of Apple's technology and would undoubtfully incur Apple's wrath, and possibly legal action.

1 Comment

Xamarin MonoTouch seems to do that quite well allowing coding in c#/.Net. It won't be Objective-C coding but it can produce working apps for iPhone using this technology.
-1

You may want to try Xamarin MonoTouch who claims to allow creating native iOS apps in C#/.NET. Although it's not entirely the same thing but it gives you an option to create iOS native apps in C# (or so they claim).

I haven't tested it but people seem to believe it works (I have seen few articles about it).

How good in comparision to XCode development in normal way? And will it blow back in your face some day? I don't know. But it seems like a nice project.

1 Comment

hmm, If I'm reading this page correctsly (developer.xamarin.com/guides/ios/getting_started/installation/…) it looks like xarmarin is a library, but requires xcode to compile native ios apps.
-3

If you really want to know how everything works, you might want to start by studying the format of the binary executable and the actual processor machine code used. Then learn how to create an array of hex or octal opcodes for both armv7 or armv64, and x86 machine code. Then you might be able to create an app without using Xcode's LLVM compiler or code generator.

Added: But you would still need XCode tools to codesign the app bundle before it could be installed on an unmodified iOS device.

1 Comment

This seems like a very good start. If you have any other thoughts, please feel free :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.