Building ios apps linux

Compile IOS program from linux commandline

I want to compile my IOS appication from linux terminal(command line). Is it possible to do so, if yes, then how?

2 Answers 2

At least you need:

  1. Assembler and Linker: cctools and ld64 from apple opensource.
  2. Compiler: Clang/LLVM
  3. SDK, include headers and libraries.
  4. Utilities: such as ldid codesign tool.

Step 1 : The compiler

Clang/llvm >= 3.2 is highly recommended and tested.

If you want to build clang/llvm from scratch, Please refer to this link to build a svn version for your linux distribution.

If your distribution already provides clang/llvm packages,make sure it is 3.2 release or above. Lower version may work but isn’t tested.

for Ubuntu 13.04 and later, clang/llvm already provided in repos, please run:

$sudo apt-get install gcc g++ clang libclang-dev uuid-dev libssl-dev libpng12-dev libicu-dev bison flex libsqlite3-dev 

to install some dev packages, other dev packages related to llvm/llvm-dev should be installed automatically.

Step 2 : The assembler and linker

The latest cctools-855 and ld64-236.3 had been ported from Apple opensource to linux. the porting process is a little bit complicated, also with a lot of codes modified for linux, let’s just skip it.

please check out the codes from:

svn checkout http://ios-toolchain-based-on-clang-for-linux.googlecode.com/svn/trunk/cctools-porting 
$ sed -i 's/proz -k=20 --no-curses/wget/g' cctools-ld64.sh $ ./cctools-ld64.sh $ cd cctools-855-ld64-236.3 $ $ ./configure --target=arm-apple-darwin11 --prefix=/usr $ make $ make install 

For Ubuntu 13.04, since the clang/llvm 3.2 package use a customized libraries/headers path. please setup CFLAGS and CXXFLAGS first before run configure.

$export CFLAGS="-I/usr/include/llvm-c-3.2" $export CXXFLAGS="-I/usr/include/llvm-c-3.2" 

Step 3: The iPhoneOS SDK.

The old iPhone SDK with ARC support extracted from xcode had been provided in Download Sections. You can directly download it and extract it to /usr/share

For other iOS versions, You may need follow these steps to get the SDK for your self.

Читайте также:  Операционная система linux h 264

Step 4: The utilities

iphonesdk-utils is a utility collection for iOS development, provides below utilities:

NOTE: (Some of them are collected from internet with some modifications.)

ldid : codesign tool, with armv7/armv7s support and other changes from orig version. it will be involked by ld64 after link complete. ios-clang-wrapper : automatically find SDK and construct proper compilation args. ios-switchsdk : switch sdk when multiple version of SDK exist. ios-pngcrush: png crush/de-crush tool, like Apple’s pngcrush. ios-createProject : project templates ios-genLocalization : iOS app localization tool based on clang lexer. ios-plutil : plist compiler/decompiler. ios-xcbuild : convert xcode project to makefile, build xcode project directly under linux. Download the source tarball from: https://ios-toolchain-based-on-clang-for-linux.googlecode.com/files/iphonesdk-utils-2.0.tar.gz

$./configure --prefix=/usr $make $make install 

Now you can build and install your project simply doing:

$cd ProjectDir $make $make install IPHONE_IP= 

Источник

How to build and distribute iOS apps without Mac with Flutter & Codemagic

In this post, you can learn how to build and publish iOS apps even if you’re working on Linux or Windows by using Flutter and Codemagic.

While it is possible to build your Flutter app for iOS using Codemagic and the process in this article, you will still need a Mac if you need to do any debugging of your app on a iOS Simulator or real device.

It’s hard to imagine developing apps for iOS without a Mac computer. There is no sign of this changing any time soon, but there are still ways for app developers to build the app for iOS and release it to the App Store even if you don’t have a Mac. With Flutter and Codemagic, you can build and distribute iOS apps without buying a Mac computer yourself.

In this post, we will walk you through how you can create a Flutter app on Linux or Windows and use Codemagic CI/CD to set up code signing for your iOS project and release the application to the App Store. We will be using the Flutter iOS app from Codemagic sample projects in this example.

REQUIREMENTS

  • You need to buy the Apple Developer Program licence to code sign and publish the app
  • You should also have an iOS device to smoke test the application

If you are new to iOS app signing and publishing to the Apple AppStore, we have a step by step tutorial available that can guide you through the process of publishing your first app to the AppStore.

Before getting started, it’s important to articulate which problem are we going to solve. You cannot develop apps for iPhone or iPad without a Mac computer. This article is about how to build an iOS app and release it to your users. But what’s the difference?

Let’s take a closer look at the problem statement and example use cases before going into the possible solution. Consider this a user story to understand the context before starting feature development.

When can you not use Linux or Windows machine to develop iOS applications?

As you probably may have guessed, having an iOS simulator or debugging iOS specific issues on macOS is invaluable. Moreover, when a user logs a bug, you need to be able to reproduce the issue and it is likely that the problems that are reported are platform-specific.

I would say one of the most notorious features that is ubiquitous across all apps that you will have to deal with is push notifications. While iOS simulator will be enough in most cases, there are some scenarios where you should also test your application on a real device and push notifications are one of them.

When can you build and publish iOS applications without a Mac computer?

One big advantage of Flutter is not having to build a whole new application for just iOS or any other OS for that matter, but using the existing project to ship for all platforms.

You can buy a second-hand Mac and set up your development environment or you can use a free service like Codemagic to build the iOS binary that you can smoke test on an iOS device or share with your first users. This is a great way to move quickly and get your app out.

Try to turn the tables if you are a macOS user and considering releasing a desktop version of your app to Microsoft Partner Center. You could go out and buy a Windows machine to build the application or you can use your existing CI/CD tool and switch the instance type to Windows.

The second most common case I have seen is when you are working in a team and some team members have Mac computers and others have Linux or Windows machines. It would be great once you are ready to merge a PR that the CI will build for all platforms and automatically share the binaries with the QA team rather than asking others to build the binaries or having QA do it.

Developing Flutter apps on Linux or Windows

Flutter is a multi-platform application development framework that enables you, among other platforms, to develop iOS and Android apps from the same source code. However, you need to use Xcode to build an iOS app and Xcode will only work on macOS. You cannot get away with Linux or Windows. We can, however, build and distribute the apps to Google Play Store or Apple App Store using a CI/CD product like Codemagic.

Flutter together with Codemagic makes it possible to release iOS apps for developers using Linux or Windows.

Setting up development environment for Flutter

Let’s get started by installing Android SDK and Flutter. After that you can clone the Codemagic sample projects repository from GitHub and we can start working on it right away. We will be using the Flutter Android and iOS demo project. Getting started with Flutter guides are also available on the official website of Flutter docs.

Keep in mind that we can use Linux or Windows to only develop for Android not iOS. We will still get an iOS app by the end of this article that can be deployed to the App Store, but we will use Codemagic CI/CD with a macOS environment to achieve this.

Источник

Оцените статью
Adblock
detector