diff options
author | fischman@webrtc.org <fischman@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-08-01 18:29:45 +0000 |
---|---|---|
committer | fischman@webrtc.org <fischman@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-08-01 18:29:45 +0000 |
commit | 1bc19541748f0b10e7b7d0eda732fee5a4389547 (patch) | |
tree | a3326bbb62f88285531dae907138a49278af2299 /talk/app/webrtc/objc/README | |
parent | 6abb750993460cb181dc78b454f1a1d6910b4444 (diff) | |
download | webrtc-1bc19541748f0b10e7b7d0eda732fee5a4389547.tar.gz |
AppRTCDemo: builds using ninja on iOS for simulator and device!
Things included in this CL:
- updated READMEs to provide an exact/reproable set of steps for getting the app
running.
- gyp changes to build the iOS AppRTCDemo sample app using gyp+ninja instead of
the hand-crafted Xcode project (which has never worked in its checked-in
form), including a gyp action to sign the sample app for deployment to an iOS
device (the app can also be used in the simulator)
- deleted the busted hand-crafted Xcode project for the sample app
- updated the sample app to match the PeerConnection API that ended up landing
(in a surprising twist of fate, the API landed quite a bit later than the
sample app and this is the first time the CR-time changes in the API are
reflected in the sample app)
- updated the sample app to reflect apprtc.appspot.com HTML/JS changes (equiv to
the AppRTCClient.java changes in http://s10/47299162)
- picked up the iossim DEPS to enable launching the sample app in the simulator
from the command-line.
- renamed some files to match capitalization of the classes they contain (Ice ->
ICE) per ObjC naming guidelines.
- ran the files involved in this CL through clang-format to deal with xcode
formatting craxy.
BUG=2106
RISK=P2
TESTED=unittest builds with ninja and passes on OS=mac; sample app builds with ninja and runs on simulator and device, though no audio flows from simulator/device (will fix in a follow-up CL)
R=andrew@webrtc.org, justincohen@google.com, wu@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/1874005
git-svn-id: http://webrtc.googlecode.com/svn/trunk@4466 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'talk/app/webrtc/objc/README')
-rw-r--r-- | talk/app/webrtc/objc/README | 110 |
1 files changed, 72 insertions, 38 deletions
diff --git a/talk/app/webrtc/objc/README b/talk/app/webrtc/objc/README index cea2aae6af..39b0931d97 100644 --- a/talk/app/webrtc/objc/README +++ b/talk/app/webrtc/objc/README @@ -1,45 +1,79 @@ This directory contains the ObjectiveC implementation of the -webrtc::PeerConnection API. This can be built for Mac or iOS. +webrtc::PeerConnection API. This can be built for Mac or iOS. This +file describes building the API, unit test, and AppRTCDemo sample app. Prerequisites: - Make sure gclient is checking out tools necessary to target iOS: your .gclient file should contain a line like: target_os = ['ios', 'mac'] Make sure to re-run gclient sync after adding this to download the tools. -- Set up webrtc-related GYP variables: -- For Mac: - export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 OS=mac - target_arch=x64 libjingle_objc=1 libpeer_target_type=static_library - $GYP_DEFINES" -- For iOS: - export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 OS=ios - libjingle_enable_video=0 libjingle_objc=1 enable_video=0 $GYP_DEFINES" -- Finally, run "gclient runhooks" to generate iOS or Mac targeting Xcode - projects. - -Example of building & using the app: - -cd <path/to/libjingle>/trunk/talk -- Open libjingle.xcproj. Select iPhone or iPad simulator and build everything. - Then switch to iOS device and build everything. This creates x86 and ARM - archives. -cd examples/ios -./makeLibs.sh -- This will generate fat archives containing both targets and copy them to - ./libs. -- This step must be rerun every time you run gclient sync or build the API - libraries. -- Open AppRTCDemo.xcodeproj, select your device or simulator and run. -- If you have any problems deploying for the first time, check the project - properties to ensure that the Bundle Identifier matches your phone - provisioning profile. Or use the simulator as it doesn't require a profile. - -- In desktop chrome, navigate to http://apprtc.appspot.com and note the r=<NNN> - room number in the resulting URL. - -- Enter that number into the text field on the phone. - -- Alternatively, you can background the app and launch Safari. In Safari, open - the url apprtc://apprtc.appspot.com/?r=<NNN> where <NNN> is the room name. - Other options are to put the link in an email and send it to your self. - Clicking on it will launch AppRTCDemo and navigate to the room. + +- Set up webrtc-related $GYP_DEFINES; example shell functions that set + up for building for iOS-device, iOS-simulator, and Mac (resp) are: +function wrbase() { + cd /path/to/libjingle/trunk + export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 libjingle_objc=1" + export GYP_GENERATORS="ninja" +} + +function wrios() { + wrbase + export GYP_DEFINES="$GYP_DEFINES OS=ios target_arch=armv7" + export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_ios" + export GYP_CROSSCOMPILE=1 +} + +function wrsim() { + wrbase + export GYP_DEFINES="$GYP_DEFINES OS=ios target_arch=ia32" + export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_sim" + export GYP_CROSSCOMPILE=1 +} + +function wrmac() { + wrbase + export GYP_DEFINES="$GYP_DEFINES OS=mac target_arch=x64" + export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_mac" +} + +- Finally, run "gclient runhooks" to generate ninja files. + +Example of building & using the unittest & app: + +- To build & run the unittest (must target mac): + wrmac && gclient runhooks && \ + ninja -C out_mac/Debug libjingle_peerconnection_objc_test && \ + ./out_mac/Debug/libjingle_peerconnection_objc_test.app/Contents/MacOS/libjingle_peerconnection_objc_test + +- To build & launch the sample app on the iOS simulator: + wrsim && gclient runhooks && ninja -C out_sim/Debug iossim AppRTCDemo && \ + ./out_sim/Debug/iossim out_sim/Debug/AppRTCDemo.app + +- To build & sign the sample app for an iOS device: + wrios && gclient runhooks && ninja -C out_ios/Debug AppRTCDemo + +- To install the sample app on an iOS device: + ideviceinstaller -i out_ios/Debug/AppRTCDemo.app + (if installing ideviceinstaller from brew, use --HEAD to get support + for .app directories) +- Alternatively, use iPhone Configuration Utility: + - Open "iPhone Configuration Utility" (http://support.apple.com/kb/DL1465) + - Click the "Add" icon (command-o) + - Open the app under out_ios/Debug/AppRTCDemo (should be added to the Applications tab) + - Click the device's name in the left-hand panel and select the Applications tab + - Click Install on the AppRTCDemo line. + (If you have any problems deploying for the first time, check + the Info.plist file to ensure that the Bundle Identifier matches + your phone provisioning profile, or use a development wildcard + provisioning profile.) + +- Once installed: + - Tap AppRTCDemo on the iOS device's home screen (might have to scroll to find it). + - In desktop chrome, navigate to http://apprtc.appspot.com and note + the r=<NNN> room number in the resulting URL; enter that number + into the text field on the phone. + - Alternatively, background the app and launch Safari. In Safari, + open the url apprtc://apprtc.appspot.com/?r=<NNN> where <NNN> is + the room name. Other options are to put the link in an email/chat + and send it to yourself. Clicking on it will launch AppRTCDemo + and navigate to the room. |