Code Monkey home page Code Monkey logo

kitura-helloworld-ios's Introduction

Kitura Builder for iOS

Kitura/iOS Hello World

Build Status macOS iOS Apache 2 codebeat badge Ā Slack Status

Simple Hello World Kitura Application (Server Side) embedded in an iOS app (Client Side). The app demonstrates starting and stopping Kitura server, and presents Kitura log on the screen.

Publications

Quick Instructions

(Last tested on macOS Mojave 10.14 and Xcode 10.1)

  1. Setup (run in a terminal). The following commands install Xcode command line tools, Ruby Xcodeproj gem, download curl 7.43.0 source code and compile it. You may want to download and compile some other version of curl or to compile it using some other script, for example https://github.com/gcesarmza/curl-android-ios.
xcode-select --install
sudo gem install xcodeproj

git clone https://github.com/IBM-Swift/Kitura-HelloWorld-iOS.git
cd Kitura-HelloWorld-iOS
make Builder/Makefile

curl -O https://curl.haxx.se/download/curl-7.43.0.tar.bz2
bzip2 -d curl-7.43.0.tar.bz2; tar xopf curl-7.43.0.tar; rm -r curl-7.43.0.tar
bash ./Builder/Scripts/buildCurlStaticLibrary.sh curl-7.43.0

Troubleshooting on Mojave: if the last command above fails, follow the instructions in curl/curl#3189 (comment).

  1. The following command will fetch the submodules, update them, generate an Xcode project for the Server Side part and generate an Xcode workspace for the End-to-End project.

For 64Bit (example, iPhone 5s or newer, iPad Air or newer, iPad Mini 2 or newer, iPad Pro or newer)

make openXcode

For 32Bit (example, iPhone 5, 5c, iPad 4)

make openXcode32
  1. Open EndToEnd.xcworkspace
  2. Change scheme to "ClientSide"
  3. Load on iPhone or iPhone simulator
  4. On the running app, turn on the toggle switch above the QR code
  5. On another device, connect to the listed URL

Quick Instructions for Updating the Project

  1. git pull to get the latest version of Kitura
  2. Remove the Builder directory
  3. run make openXcode or make openXcode32

Command Line Tests

Run make test

kitura-helloworld-ios's People

Contributors

nacho4d avatar rodedz avatar shanecowherd avatar vadimeisenbergibm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kitura-helloworld-ios's Issues

How about tvOS? :)

First of all, thank you for setting this up to work embedded in iOS.

I had been experimenting with several very basic embedded iOS HTTP servers, but none that could also run server-side or that were as robust as Kitura.

Are there any plans to have Kitura run on tvOS? It seems like a logical progression, especially since an AppleTV seems to be well-suited to be a serve devices in a home.

'ERROR: Building /Curl failed' macOS Catalina 10.15 Beta

Hi, we are trying to start to experiment with the project.
We are have thorboling to install the example project in macOS Catalina 10.15 with Xcode 11.
We tried to solved it with this solution: 'curl/curl#3189 (comment).' but it doesn't succeed.

We tried to deleting all the dependence of Xcode too and run the code from Quick Instruction - Setup, but nothing.
The first error is:
Building /Users/Kitura-HelloWorld-iOS/iOSStaticLibraries/Curl failed.

Checking the ./CurlBuildLogs directory appiers this error:
libtool: compile: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -DHAVE_CONFIG_H -I../include/curl -I../include -I../include -I../lib -I../lib -DBUILDING_LIBCURL -DCURL_STATICLIB -DCURL_HIDDEN_SYMBOLS -fvisibility=hidden -arch arm64 -pipe -Os -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -fembed-bitcode -Qunused-arguments -MT libcurl_la-url.lo -MD -MP -MF .deps/libcurl_la-url.Tpo -c url.c -o libcurl_la-url.o
url.c:55:2: error: "We can't compile without socket() support!"
#error "We can't compile without socket() support!"
^
1 error generated.
make[1]: *** [libcurl_la-url.lo] Error 1
make: *** [install-recursive] Error 1

We are doing thonging wrong?

Improving README.md

Description

The Prerequisites seems useless. I tried following it to configure but nothing worked properly here.
Also, the link to Enable Server-Side Swift with Kitura doesn't work =(

Suggestion

After failing the configuration described in Prerequisites, I delete the project and tried only the Quick Instruction - Setup (run in a terminal) it has the same results as Prerequisites, but it's much easier to execute (just copy all the code and paste on terminal).
Ps: I had the same problem and could not execute the project hahaha

My suggestion is to delete Prerequisites and put Quick Instructions on the top of the page.

Ps: if you agree with my suggestion about removing the Prerequisites can I update it with a PR? I'm working on my Hacktoberfest progress. If there is any other suggestion that I can work on, just let me know.

missing required module CHTTPParser on Xcode 8.3.3

on
Xcode 8.3.3 (8E3004b)
MacOS Sierra 10.12.4
DEPLOYMENT_TARGET 10.3
iphone simulator : 6s

I follow quick instructions, but when I build ClientSide, I get Swift compile error:
:0: error: missing required module 'CHTTPParser'

also follow: de48561
but it is the same.
Thanks!

stamp1

Getting this error on Xcode 8.3.2

error

Note: I have modified this file: fix_xcode_project.rb at line no: 78,
updated line is: server_project.products.each {|p| frameworks_to_add_references.push(p) if (p.path) && (p.path.include? 'framework')}, i was getting error without modifying this error

UtilityScripts dir is not found.

The prereqs specify UtilityScripts path but what Iā€™m seeing is Builder/Scripts instead. Also in the buildCurlStaticLibrary.sh file there is the same dir path of UtilityScripts. Is there a step that I'm missing?

Problems setting up the project

Description

After running the code from Quick Instruction - Setup, it takes a while, prints a lot of things and finishes with a curl error. This is the end of the execution:

+ rm -rf /Users/maisa/Documents/Lab_de_bagunca/Hacktoberfest/Kitura-HelloWorld-iOS/iOSStaticLibraries/Curl
+ echo 'ERROR: Building /Users/maisa/Documents/Lab_de_bagunca/Hacktoberfest/Kitura-HelloWorld-iOS/iOSStaticLibraries/Curl failed.'
ERROR: Building /Users/maisa/Documents/Lab_de_bagunca/Hacktoberfest/Kitura-HelloWorld-iOS/iOSStaticLibraries/Curl failed.
+ echo 'See the logs in ./CurlBuildLogs directory'
See the logs in ./CurlBuildLogs directory
+ echo 'Try curl version 7.43.0 from https://curl.haxx.se/download/ - it worked for us.'
Try curl version 7.43.0 from https://curl.haxx.se/download/ - it worked for us.
+ echo 'Also, remember to run xcode-select --install each time you update your Xcode'
Also, remember to run xcode-select --install each time you update your Xcode
+ exit 1

I'm using MacOS Mojave v10.14. When executing curl --version this is the message:

curl 7.54.0 (x86_64-apple-darwin18.0) libcurl/7.54.0 LibreSSL/2.6.4 zlib/1.2.11 nghttp2/1.24.1
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy 

Problem

I'm not able to execute make openXcode or make openXcode32:

make NUMBER_OF_BITS="64" prepareXcodeAll
Please download a curl source, uncompress it and run Builder/Scripts/buildCurlStaticLibrary.sh <the uncompressed curl directory>
You can download curl source from https://curl.haxx.se/download/
exit 1
make[1]: *** [iOSStaticLibraries/Curl] Error 1
make: *** [prepareXcode] Error 2

Am I doing something wrong?

Doesn't load on iPhone

The instructions seem redundant. I followed them both (one under "building under Xcode and one under Quick Instructions").
Let's say one follows Quick Instructions. All versions are matching.

The problem: 3 curl 'issues' - two are "curl_rule_01 declared as an array with negative size" and one says could not build Objective-C module CCurl.

Since I am new to the project, I am not sure where to begin investigation or ways to resolve.

Would it make sense to put the entire build under swift_package process and do way with shell scripts?

I will add, "targeting the simulator deploys as designed - it works". The problem appears when targeting a physical phone. I don't have trouble targeting this test phone with other apps - and its odd that the link fails. I also tried downloading CCurl and pushing the binary library into the right system folder (using suggested build instructions) - that didn't help here.

Cannot run make Builder/Makefile

When I run the command above I get the following message: *** [setDeploymentVersionOfSharedServerClient] Error 1
ruby Builder/Scripts/set_deployment_version.rb SharedServerClient/SharedServerClient.xcodeproj 11.2
ruby: No such file or directory -- Builder/Scripts/set_deployment_version.rb (LoadError)***

Any idea why please?

Guide on how to integrate with non-example app

Hi,

I have a production app, and I would like to do some POC regarding client-side server.
As the sample makefile and scripts are hardcoded for the sample xcodeproj,
is there any way the integration to be simpler?

Thank you

Running build shell script produces error

During the build script step

bash Builder/Scripts/buildCurlStaticLibrary.sh curl-7.43.0

I keep getting

cp: /Users/nstein/Swift/Kitura-HelloWorld-iOS/iOSStaticLibraries/Curl/.build/curl-i386/include/curl: No such file or directory
cp: /Users/nstein/Swift/Kitura-HelloWorld-iOS/iOSStaticLibraries/Curl/.build/curl-x86_64/include/curl: No such file or directory
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: /Users/nstein/Swift/Kitura-HelloWorld-iOS/iOSStaticLibraries/Curl/.build/curl-armv7/lib/libcurl.a (No such file or directory)
ERROR: Building /Users/nstein/Swift/Kitura-HelloWorld-iOS/iOSStaticLibraries/Curl failed.
Try curl version 7.43.0 from https://curl.haxx.se/download/ - it worked for us.

Any ideas would be greatly appreciated!

UPDATE: My directory structure is as follows

drwxr-xr-x@ 13 nstein  staff    442 Mar 15 10:16 ..
-rw-r--r--@  1 nstein  staff   6148 Mar 15 14:08 .DS_Store
drwxr-xr-x  14 nstein  staff    476 Mar 15 10:28 .git
-rw-r--r--   1 nstein  staff    443 Mar 15 10:16 .gitignore
-rw-r--r--   1 nstein  staff    217 Mar 15 10:16 .gitmodules
drwxr-xr-x   9 nstein  staff    306 Mar 15 12:02 Builder
drwxr-xr-x   6 nstein  staff    204 Mar 15 10:16 ClientSide
drwxr-xr-x   3 nstein  staff    102 Mar 15 10:16 Documentation
-rw-r--r--   1 nstein  staff  10174 Mar 15 10:16 LICENSE.txt
-rw-r--r--   1 nstein  staff    762 Mar 15 10:16 Makefile
-rw-r--r--   1 nstein  staff   2966 Mar 15 10:16 README.md
drwxr-xr-x  15 nstein  staff    510 Mar 15 13:15 ServerSide
drwxr-xr-x  39 nstein  staff   1326 Mar 15 10:58 curl-7.43.0

Unable to compile with Xcode 8.3.1

macOS 10.12.4
Xcode 8.3.1

After running quick instructions.

Swift Compiler Error
KituraTableViewController.swift - Module file's minimum deployment target is ios10.3.

After changing the deployment target to 10.3.

Swift Compiler Error
<unknown>:0: error: missing required modules: 'CCurl', 'CHTTPParser'

I have tried recompiling Curl with Min version 10.3.
I have tried looking at header paths.

Is this something upstream in KituraNet?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.