LearnHouse

[Alljoyn] Build from source - iOS

繼上一篇build Linux之後,iOS的部分也是有些問題,但問題比較不大

主要是在Run sample code的project時,裡面所指向的openssl路徑不太對

只要按照你的build完後的openssl位置設定好,正常應該都可以 run

至於,為什麼我沒有寫Android的部分,主要是因為Android在Build code沒什麼問題

只要project import進來,就可以將程式佈到你的手機了。

Reference: https://allseenalliance.org/developers/develop/building/ios-osx

Setup

  1.  Download the following iOS SDKs:
  • Core SDK (release)
  • Onboarding SDK
  • Configuration SDK
  • Notification SDK
  • Control Panel SDK
  1. Extract the downloaded packages and setup the directory structure:
mkdir alljoyn-ios
mkdir alljoyn-ios/core
unzip alljoyn-14.06.00-osx_ios-sdk.zip
mv alljoyn-14.06.00-osx_ios-sdk alljoyn-ios/core/alljoyn
unzip alljoyn-config-service-framework-14.06.00-ios-sdk-rel.zip
unzip alljoyn-controlpanel-service-framework-14.06.00-ios-sdk-rel.zip
unzip alljoyn-notification-service-framework-14.06.00-ios-sdk-rel.zip
unzip alljoyn-onboarding-service-framework-14.06.00-ios-sdk-rel.zip

Set up OpenSSL dependencies

cd <parent directory of alljoyn-ios>
pushd alljoyn-ios
git clone git://git.openssl.org/openssl.git
git clone https://github.com/sqlcipher/openssl-xcode.git
cp -r openssl-xcode/openssl.xcodeproj openssl
pushd openssl
git checkout tags/OpenSSL_1_0_1f #replace this with a newer version as available
sed -ie 's/\(ONLY_ACTIVE_ARCH.*\)YES/\1NO/' openssl.xcodeproj/project.pbxproj
xcodebuild -configuration Release -sdk iphonesimulator
xcodebuild -configuration Release -sdk iphoneos
xcodebuild -configuration Release
xcodebuild -configuration Debug -sdk iphonesimulator
xcodebuild -configuration Debug -sdk iphoneos
xcodebuild -configuration Debug
launchctl setenv OPENSSL_ROOT `pwd`
popd
popd

Define environment variables

cd alljoyn-ios
launchctl setenv ALLJOYN_SDK_ROOT `pwd`
cd services
launchctl setenv ALLSEEN_BASE_SERVICES_ROOT `pwd`

Running The Basic Sample

alljoyn-ios/core/alljoyn/alljoyn_objc/samples/iOS/BasciClient

Project > Build
假如有出現有關於openssl的lib錯誤
ld: library not found for -lssl
直接修改Library Search Paths的$OPENSSL_ROOT路徑,指到你openssl實際的位置
posted by admin in 程式&軟體 and have No Comments

Place your comment

Please fill your data and comment below.
Name
Email
Website
Your comment