| OLD | NEW | 
|   1 This directory contains the ObjectiveC implementation of the |   1 This directory contains the ObjectiveC implementation of the | 
|   2 webrtc::PeerConnection API.  This can be built for Mac or iOS.  This |   2 webrtc::PeerConnection API.  This can be built for Mac or iOS.  This | 
|   3 file describes building the API, unit test, and AppRTCDemo sample app. |   3 file describes building the API, unit test, and AppRTCDemo sample app. | 
|   4  |   4  | 
|   5 Prerequisites: |   5 Prerequisites: | 
|   6 - Make sure gclient is checking out tools necessary to target iOS: your |   6 - Make sure gclient is checking out tools necessary to target iOS: your | 
|   7   .gclient file should contain a line like: |   7   .gclient file should contain a line like: | 
|   8   target_os = ['ios', 'mac'] |   8   target_os = ['ios', 'mac'] | 
|   9   Make sure to re-run gclient sync after adding this to download the tools. |   9   Make sure to re-run gclient sync after adding this to download the tools. | 
|  10  |  10  | 
|  11 - Set up webrtc-related $GYP_DEFINES; example shell functions that set |  11 - Set up webrtc-related $GYP_DEFINES; example shell functions that set | 
|  12   up for building for iOS-device, iOS-simulator, and Mac (resp) are: |  12   up for building for iOS-device, iOS-simulator, and Mac (resp) are: | 
|  13 function wrbase() { |  13 function wrbase() { | 
|  14   cd /path/to/webrtc/trunk |  14   cd /path/to/webrtc/trunk | 
|  15   export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 libjingle_obj
    c=1" |  15   export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0" | 
|  16   export GYP_GENERATORS="ninja" |  16   export GYP_GENERATORS="ninja" | 
|  17 } |  17 } | 
|  18  |  18  | 
|  19 function wrios() { |  19 function wrios() { | 
|  20   wrbase |  20   wrbase | 
|  21   export GYP_DEFINES="$GYP_DEFINES OS=ios target_arch=armv7" |  21   export GYP_DEFINES="$GYP_DEFINES OS=ios" | 
|  22   export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_ios" |  22   export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_ios" | 
|  23   export GYP_CROSSCOMPILE=1 |  23   export GYP_CROSSCOMPILE=1 | 
|  24 } |  24 } | 
|  25  |  25  | 
 |  26 function wrios32() { | 
 |  27   wrios | 
 |  28   export GYP_DEFINES="$GYP_DEFINES target_arch=arm" | 
 |  29 } | 
 |  30  | 
 |  31 function wrios64() { | 
 |  32   wrios | 
 |  33   export GYP_DEFINES="$GYP_DEFINES target_arch=arm64" | 
 |  34 } | 
 |  35  | 
|  26 function wrsim() { |  36 function wrsim() { | 
|  27   wrbase |  37   wrbase | 
|  28   export GYP_DEFINES="$GYP_DEFINES OS=ios target_arch=ia32" |  38   export GYP_DEFINES="$GYP_DEFINES OS=ios target_subarch=arm32 target_arch=ia32" | 
|  29   export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_sim" |  39   export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_sim" | 
|  30   export GYP_CROSSCOMPILE=1 |  40   export GYP_CROSSCOMPILE=1 | 
|  31 } |  41 } | 
|  32  |  42  | 
|  33 function wrmac() { |  43 function wrmac() { | 
|  34   wrbase |  44   wrbase | 
|  35   export GYP_DEFINES="$GYP_DEFINES OS=mac target_arch=x64" |  45   export GYP_DEFINES="$GYP_DEFINES OS=mac target_subarch=arm64 target_arch=x64" | 
|  36   export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_mac" |  46   export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_mac" | 
|  37 } |  47 } | 
|  38  |  48  | 
|  39 - Finally, run "gclient runhooks" to generate ninja files. |  49 - Finally, run "webrtc/build/gyp_webrtc" to generate ninja files. | 
|  40  |  50  | 
|  41 Example of building & using the unittest & app: |  51 Example of building & using the unittest & app: | 
|  42  |  52  | 
|  43 - To build & run the unittest (must target mac): |  53 - To build & run the unittest (must target mac): | 
|  44   wrmac && gclient runhooks && \ |  54   wrmac && ./webrtc/build/gyp_webrtc && \ | 
|  45       ninja -C out_mac/Debug libjingle_peerconnection_objc_test && \ |  55       ninja -C out_mac/Debug libjingle_peerconnection_objc_test && \ | 
|  46       ./out_mac/Debug/libjingle_peerconnection_objc_test.app/Contents/MacOS/libj
    ingle_peerconnection_objc_test |  56       ./out_mac/Debug/libjingle_peerconnection_objc_test.app/Contents/MacOS/libj
    ingle_peerconnection_objc_test | 
|  47  |  57  | 
|  48 - To build & launch the sample app on OSX: |  58 - To build & launch the sample app on OSX: | 
|  49   wrmac && gclient runhooks && ninja -C out_mac/Debug AppRTCDemo && \ |  59   wrmac && ./webrtc/build/gyp_webrtc && ninja -C out_mac/Debug AppRTCDemo && \ | 
|  50       ./out_mac/Debug/AppRTCDemo.app/Contents/MacOS/AppRTCDemo |  60       ./out_mac/Debug/AppRTCDemo.app/Contents/MacOS/AppRTCDemo | 
|  51  |  61  | 
|  52 - To build & launch the sample app on the iOS simulator: |  62 - To build & launch the sample app on the iOS simulator: | 
|  53   wrsim && gclient runhooks && ninja -C out_sim/Debug iossim AppRTCDemo && \ |  63   wrsim && ./webrtc/build/gyp_webrtc && ninja -C out_sim/Debug iossim AppRTCDemo
     && \ | 
|  54       ./out_sim/Debug/iossim out_sim/Debug/AppRTCDemo.app |  64       ./out_sim/Debug/iossim out_sim/Debug/AppRTCDemo.app | 
|  55  |  65  | 
|  56 - To build & sign the sample app for an iOS device: |  66 - To build & sign the sample app for an iOS device (32 bit): | 
|  57   wrios && gclient runhooks && ninja -C out_ios/Debug-iphoneos AppRTCDemo |  67   wrios32 && ./webrtc/build/gyp_webrtc && ninja -C out_ios/Debug-iphoneos AppRTC
    Demo | 
|  58  |  68  | 
|  59 - To install the sample app on an iOS device: |  69 - To build & sign the sample app for an iOS device (64 bit): | 
|  60   ideviceinstaller -i out_ios/Debug-iphoneos/AppRTCDemo.app |  70   wrios64 && ./webrtc/build/gyp_webrtc && ninja -C out_ios/Debug-iphoneos AppRTC
    Demo | 
|  61   (if installing ideviceinstaller from brew, use --HEAD to get support |  | 
|  62   for .app directories) |  | 
|  63 - Alternatively, use iPhone Configuration Utility: |  | 
|  64   - Open "iPhone Configuration Utility" (http://support.apple.com/kb/DL1465) |  | 
|  65   - Click the "Add" icon (command-o) |  | 
|  66   - Open the app under out_ios/Debug-iphoneos/AppRTCDemo (should be added to the
     Applications tab) |  | 
|  67   - Click the device's name in the left-hand panel and select the Applications t
    ab |  | 
|  68   - Click Install on the AppRTCDemo line. |  | 
|  69       (If you have any problems deploying for the first time, check |  | 
|  70       the Info.plist file to ensure that the Bundle Identifier matches |  | 
|  71       your phone provisioning profile, or use a development wildcard |  | 
|  72       provisioning profile.) |  | 
|  73 - Alternately, use ios-deploy: |  | 
|  74   ios-deploy -d -b out_ios/Debug-iphoneos/AppRTCDemo.app |  | 
|  75  |  | 
|  76 - Once installed: |  | 
|  77   - Tap AppRTCDemo on the iOS device's home screen (might have to scroll to find
     it). |  | 
|  78   - In desktop chrome, navigate to http://apprtc.appspot.com and note |  | 
|  79     the r=<NNN> room number in the resulting URL; enter that number |  | 
|  80     into the text field on the phone. |  | 
| OLD | NEW |