I want to compile my IOS appication from linux terminal(command line)....
Is it possible to do so, if yes, then how?
Yes, it's possible.
At least you need:
Assembler and Linker: cctools and ld64 from apple opensource.
Compiler: Clang/LLVM
SDK, include headers and libraries.
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
Build it:
$ 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 iOS 4.2: https://ios-toolchain-based-on-clang-for-linux.googlecode.com/files/iPhoneOS4.2.sdk.tar.xz
For iOS 5.0: https://ios-toolchain-based-on-clang-for-linux.googlecode.com/files/iPhoneOS5.0.sdk.tar.xz
For iOS 6.0: https://ios-toolchain-based-on-clang-for-linux.googlecode.com/files/iPhoneOS6.0.sdk.tar.xz
For other iOS versions, You may need follow these steps to get the SDK for your self.
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
Build and install it:
$./configure --prefix=/usr
$make
$make install
Build App
Now you can build and install your project simply doing:
$cd ProjectDir
$make
$make install IPHONE_IP=<your own device IP
Complete info you can find here — https://code.google.com/p/ios-toolchain-based-on-clang-for-linux/wiki/HowTo_en
The above solution given by Barjomet is correct incase if its not mavericks, but if it is Maverics then following is the solution:
1) Install the appropriate command line tool
2) for building :a)xcodebuild -list -project .xcodeproj
b)- xcodebuild -scheme build
For detail reference you can refer the following link:
https://developer.apple.com/library/ios/technotes/tn2339/_index.html.
Related
Is there a good esp8266 simulator software that can be used to automate testing? Is it possible to get code written on Arduino IDE to run on these simulators?
I think that you could simulate esp8266 using the xtensa-esp8266 branch of OSLL/qemu-xtensa which you have to compile yourself.
Compiled binary can be called with the command:
qemu-system-xtensa -machine esp8266 -nographic -kernel <your-project>/sketch/app.out -S -s
As of Jan 2023...
The docs for the RIOT OS (an IoT OS) explain how to compile and use an ESP8266 version of QEMU for Xtensa. The docs contain the compile instructions:
cd /my/source/dir
git clone https://github.com/gschorcht/qemu-xtensa
cd qemu-xtensa/
git checkout xtensa-esp8266
export QEMU=/path/to/esp/qemu
./configure --prefix=$QEMU --target-list=xtensa-softmmu --disable-werror
make
make install
Actually, the gschorcht/qemu-xtensa repo (last updated 2018) is a fork of the original OSLL/qemu-xtensa project, so you could use the original repo:
cd /my/source/dir
git clone https://github.com/OSLL/qemu-xtensa
cd qemu-xtensa/
git checkout xtensa-esp8266
export QEMU=/path/to/esp/qemu
./configure --prefix=$QEMU --target-list=xtensa-softmmu --disable-werror
make
make install
Unfortunately, that branch hasn't been updated since 2019 so it may not compile on very recent OS versions. For instance, I got an error: expected unqualified-id error while trying to compile on macOS 12.14. So, someone probably needs to fix those compile errors.
I download the linphone SDK, installed MacPorts and then when writing following command in terminal, i got 'Xcode not installed properly....' and then I follow their rules to install left XCode's software, that are also done on my terminal screen.
sudo port install automake autoconf libtool pkgconfig intltool wget cunit \
antlr3 speex readline sqlite3 openldap libupnp \
ffmpeg-devel -gpl2
But here problem persists...
Please help me to get out from this problem.
Thanks in advance
Actually there's few Steps of compiling the Linphone SDK.
Install dependencies
Install Antlr 3
Install gas-preprosessor.pl
Symlink libtoolize to glibtoolize
Link host strings to simulator SDK
Link /opt/local/bin to /usr/local/bin
Then Build
git clone git://git.linphone.org/linphone-iphone.git --recursive
Set the SDK version
./prepare.py && make(The link below use "make" instead which is deprecated)
Detailed steps as:Building linphone SDK using Homebrew
I currently have to do the same thing and you don't have to get through this steps.....been there done that...
Instead you can download instead this the SDK by searching this on google liblinphone-iphone-sdk-2.2.5.zip
And, of course check the latest news from Linphone, to be updated.
Best Approach would be to clone and start this:
https://github.com/BelledonneCommunications/linphone-iphone
And very important use a Xcode 6 version. Xcode 7 gives you some errors as they introduced some new features and depracated old stuff.
If you don't know how to use git, please pause what you are doing and dedicate some time to do it because will have to do it multiple time during your career.
Hope this helps! Good luck
I have an xcode project which uses xmppframework.
the KissXML module of this framework needs libxml2, according to https://github.com/robbiehanson/KissXML/wiki/GettingStarted.
I followed these instructions, and downloaded libxml2 from ftp://xmlsoft.org/libxml2/.
Specifically, I downloaded and extracted LATEST_LIBXML2, which turns out to be libxml2-2.9.2.
I then added the relevant header search path to my xcode project, and
-l "lxml2"
to my linker flags.
However, when I build my project, it gives the following linker error:
ld: library not found for -llxml2
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I suspect this is because I need to build libxml2 myself, in order to get the library binary. However, I can't find specific instructions for doing this on OS X Yosemite, xcode 6.
Does anyone have any instructions on building libxml2-2.9.2 on OS X Yosemite, Xcode 6, so that I can link to it in my project?
Alternatively, if someone can provide a binary for libxml2-2.9.2, that might also work. I did find http://www.explain.com.au/oss/libxml2xslt.html#id2658905, but this guy only seems to offer binaries for older versions of libxml2, not the current version.
Thanks!
Best regards,
Chris
Well firstly, the library is called libxml2, so the link should be -lxml2 and not -llxml2.
Secondly, there is already a libxml2 built-in to OSX/iOS, and you can actually reference that library in the link libraries section for the project. You generally don't need to build the library unless you really want newer features of the newer version.
In the General tab of the project, use the Linked frameworks and Libraries to add a reference to libxml2.dylib.
The instructions on the page you reference are using the version of libxml2 that is available on OSX/iOS already. You do not need to download libxml2 to get it to work.
The location that's mentioned /usr/include/libxml2 on the page will work for you also if you install the command line developer tools - at a terminal prompt do xcode-select --install.
I have built LibXML2 (latest version 2.9.2) on Solaris SPARC, Linux and Windows. I have never use MacOS (poor =)) ).
Here's my brief instruction. You can try the similar way.
cd /opt/mydir/libxml2
mkdir linux-gcc3
gunzib -c libxml2-2.9.2.tar.gz | tar xvf –
cd libxml2-2.9.2
./configure --prefix=/opt/mydir/libxml2/linux-gcc3 --enable-static --disable-shared 2>&1 | tee conf.log
## 64 bit
## ./configure CC="cc -m64" --prefix=/opt/mydir/libxml2/linux-gcc3 --enable-static --disable-shared 2>&1 | tee conf.log
make 2>&1 | tee make.log
make install
I'm currently trying to install the lib++.1.dylib on my mac. I followed the instructions here http://libcxx.llvm.org/ and downloaded the source. When I tried to ./buildit I encountered a clang++: command not found error.
So I went here http://clang.llvm.org/get_started.html and installed clang. Unfortunately now when I went back to installing libcxx, I still got the clang++ error. Clang itself works as clang --help brings up the help menu.
Installing Xcode isn't an option as I am runnning 10.6.8.
How do I proceed i.e. get the clang++ command to work?
There is an instruction for build libc++ on 10.6 in github
https://github.com/llvm-mirror/libcxx/tree/apple
To build on Mac OS X 10.6, you need a helper library and header found
here. cp cxxabi.h to /usr/include, and cp libc++abi.dylib to /usr/lib.
Next:
cd libcxx/lib
export TRIPLE=-apple-
./buildit
That should result in a libc++.1.dylib. To install it I like to use
links instead of copying, but either should work:
cd /usr/lib
sudo ln -sf path-to-libcxx/lib/libc++.1.dylib libc++.1.dylib
sudo ln -sf libc++.1.dylib libc++.dylib
cd /usr/include/c++
sudo ln -sf path-to-libcxx/include v1
Link in instruction not work.
The libcppabi for 10.6 You can download on this link http://www.mediafire.com/download/2aq37hc97n4f47c/libcppabi.zip
It is a fairly complex process to build libc++ on Mac 10.6, as it needs libc++abi to be present, which didn't ship with 10.6. So the working steps are as follow:
Build Clang.
Use this Clang to build libc++abi.
You have to make sure libc++abi and its header are properly placed so that in the next step in can be found.
Then use this Clang to build libc++ and link to this libc++abi.
Also note if you are using Clang 3.3 instead of the latest development trunk, you will also need this patch (http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/unwind.h?r1=172666&r2=189535&view=patch) to unwind.h so that libc++abi can be built properly.
I have tested a working process and updated the homebrew-version formula so it works in homebrew out-of-the-box. You can check the details at https://github.com/Homebrew/homebrew-versions/blob/master/llvm33.rb. Hope this helps.
I'm trying to compile Qt for the iOS simulator, as explained in this article.
At first I ran into this problem but after it (kinda) solved itself I had some more.
First I kept getting this error after executing the first command, which is supposed to build qmake (../qt/configure ... etc etc):
The OpenGL ES 2.0 functionality test failed!
You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in /Qt/qt/mkspecs/qpa/macx-iphonesimulator-g++.
Since I knew that I had the 4.3 SDK, I delved into it some more, analyzed the configure script, and after some tracing I saw that the Makefile generated by qmake, required g++-4.2 (which I didn't have), so I just ln -s g++ g++-4.2 and ln -s gcc gcc-4.2 in /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/.
I'm not sure if the aforementioned steps matter, that's why I'm writing about them. Anyway, with that, the configure step was successful. Now I ran make. After some successfully compiled files I got this:
In file included from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/WebServicesCore.framework/Headers/WebServicesCore.h:15,
from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:37,
from ../../include/QtCore/private/../../../../qt/src/corelib/kernel/qcore_mac_p.h:83,
from ../../include/QtCore/private/qcore_mac_p.h:1,
from /Qt/qt/src/corelib/tools/qlocale_mac.mm:49:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/WebServicesCore.framework/Headers/WSMethodInvocation.h:759:
error: 'CFXMLTreeRef' has not been declared
The same error appears several more times, from several different lines of WebServicesCore.h. So, basically, here's where I'm stuck now.
Any help? Again?...
Edit: Absolutely, 100% the same thing happens when I configure and try to make Qt for the device (as opposed to the simulator)
Additional info:
gcc --version : i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
iOS SDK: I have both 4.3 and 5
OS X version: 10.7.2
Xcode version (if it matters): 4.2.1
Didn't you forget to add -nomake tools and other -nomake ... to your configure ?
Try poking this guys: http://labs.qt.nokia.com/2011/08/09/update-on-uikit-lighthouse-platform/