Creating buildable Xcode project for iOS AppRTCDemo

2,031 views
Skip to first unread message

Raja Kantamaneni

unread,
Oct 23, 2013, 5:37:35 PM10/23/13
to discuss...@googlegroups.com

Hi all. I'm trying to generate a buildable Xcode project for the iOS AppRTCDemo (/trunk/talk/examples/ios) from the webrtc reference code. I'm new to gyp + ninja, so please bear with me.

Following the instructions in /trunk/talk/app/webrtc/objc/README and using ninja -> I was successfully able to build and run the AppRTCDemo on the iOS simulator + on an actual device. However, I'd like to setup an Xcode project so that I expand upon the sample app.

There is no Xcode project for the AppRTCDemo by default. To generate it with gyp, I changed GYP_GENERATORS from "ninja" to "xcode" in the the wrbase shell function (see the README above). I then ran "wrsim && gclient runhooks". This generated a libjingle_examples.xcodeproj in /trunk/talk/.

When opening the project in xCode and trying to build the AppRTCDemo target for the iPhone simulator, I get 1 build error:

Build target libvpx_obj_int_extract
target specifies product type 'com.apple.product-type.tool', but there's no such product type for the 'iphonesimulator' platform

Before looking deeper into fixing this, has anyone dealt with this before? Is the approach above the correct procedure to generate an Xcode project for the AppRTCDemo sample? 

Thanks,
 Raja

TJ Grant

unread,
Oct 23, 2013, 9:24:37 PM10/23/13
to discuss...@googlegroups.com
AppRTCDemo build-able xcode project:

1. Build the ninja version (simulator version and device version)
2. Find the following files from the ninja build, and copy them to trunk/third_party/libvpx/
  * vp8_asm_enc_offsets.asm
  * vpx_scale_asm_offsets.asm
  * bilinearfilter_v6.S
3. In trunk/third_party/libvpx/libvpx.gyp, comment out the "rules" section for the targets "copy_enc_offsets_obj" and "gen_asm_offsets_vpx_scale"
4. Regenerate the AppRTCDemo xcodeproject with gyp
5. In your xcodeproject, delete the "libvpx_obj_int_extract" target
6. Add libstdc++.dylib to AppRTCDemo's linked libraries

You should then be able to build and run from within Xcode for either device or simulator.
You may need to the "sse" and "mmx" libraries from the simulator version to build for the simulator though.
I believe you also have to change the build architecture to "armv7", but I don't remember.

Best regards,
--TJ Grant

--
 
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Message has been deleted

TJ Grant

unread,
Oct 29, 2013, 11:57:30 PM10/29/13
to Mike K, discuss...@googlegroups.com
It's in the original email:

There is no Xcode project for the AppRTCDemo by default. To generate it with gyp, I changed GYP_GENERATORS from "ninja" to "xcode" in the the wrbase shell function (see the README above). I then ran "wrsim && gclient runhooks". 



On Tue, Oct 29, 2013 at 2:30 PM, Mike K <mikek...@gmail.com> wrote:
How do you regenerate AppRTCDemo demo xcode project? I dont have it as the target in the libjingle_examples.xcodeproj? Ninja build is working ok. But how to get the demo project on iOS?

 

Mike K

unread,
Oct 30, 2013, 3:13:57 AM10/30/13
to discuss...@googlegroups.com, Mike K, tjg...@tatewake.com
Thx i got this working already that why i deleted the post
. The next problem i have is in taget genmacro: target specifies product type 'com.apple.product-type.tool' but there is no such product type for the 'iphonesimulator' platform. Its same error as in  libvpx_obj_int_extract.
Basicly every target with gen... has this problem.
Did anyone managed to solve this?



Dne sreda, 30. oktober 2013 04:57:30 UTC+1 je oseba TJ Grant napisala:

TJ Grant

unread,
Oct 30, 2013, 7:33:15 AM10/30/13
to Mike K, discuss...@googlegroups.com
From my first reply:

> 5. In your xcodeproject, delete the "libvpx_obj_int_extract" target



--
To:   
       



--TJ Grant
tjg...@tatewake.com

Mike K

unread,
Oct 30, 2013, 8:26:29 AM10/30/13
to discuss...@googlegroups.com, Mike K, tjg...@tatewake.com
Yes i deleted the the target libvpx_obj_int_extract. This error is now part of the yasm project target genmacro.
I folowed you steps, in deleting the target. Did i miss something? Im using the latest sync.

Dne sreda, 30. oktober 2013 12:33:15 UTC+1 je oseba TJ Grant napisala:
Dne sreda, 30. oktober 2013 12:33:15 UTC+1 je oseba TJ Grant napisala:
Dne sreda, 30. oktober 2013 12:33:15 UTC+1 je oseba TJ Grant napisala:
Dne sreda, 30. oktober 2013 12:33:15 UTC+1 je oseba TJ Grant napisala:
Dne sreda, 30. oktober 2013 12:33:15 UTC+1 je oseba TJ Grant napisala:
Message has been deleted

Raja Kantamaneni

unread,
Oct 30, 2013, 10:54:24 PM10/30/13
to discuss...@googlegroups.com, Mike K, tjg...@tatewake.com
[Posting again. Deleted last message because it included a very long email chain that was making viewing difficult in Google Groups.]

Sorry for the delay in reporting back. Thanks for the assistance TJ, much appreciated. After following your instructions, I ultimately saw the same behavior that Mike K is reporting where more targets would have the "target specifies product type 'com.apple.product-type.tool' but there is no such" error, as well as some other target architecture related issues I can't recall off the top of my head (will have to go back and retry). Tried to workaround these matters but kept leading to more issues. 

Worth noting that my environment at the time was Mac OS X 10.8 Mountain Lion and Xcode 5.0. What version of Xcode are you using on your side? 

Getting the gyp generated Xcode project working was an exercise in getting familiar with everything and ensuring my environment was correct. I put this task on hold for now, but am still interested in figuring out what was going wrong.

My goal is to ultimately have:
- A separate Xcode project including the necessary WebRTC binaries/libs to develop upon.
- Have that project be easily updateable with latest WebRTC work.

Planning to create this separate Xcode project along with a script that will compile webrtc using ninja and copy over relevant compiled binaries. Some other priorities came up though but hopefully I'll get back to this soon.

- Raja

Scott Wang

unread,
Oct 31, 2013, 12:03:11 AM10/31/13
to discuss...@googlegroups.com, Mike K, tjg...@tatewake.com
I've successfully create a Xcode project from scratch that works with WebRTC libraries.

1. Build WebRTC libraries following the steps from talk/app/webrtc/objc/README
2. Add the webrtc source directory into header search path in [build settings]->[search paths]
3. Choose libstdc++ for C++ standard library under [build settings] -> [Apple LLVM compiler language]
4. In [build phases]->[link binary with libraries], add AudioToolbox.framework, CodeMedia.framework, CoreVideo.framework, AVFoundation.framework, libsqlites3.dylib, UIKit.framework, Foundation.framework, CoreGraphics.framework, OpenGLES.framework, and QuartzCore.framework
5. Drag the WebRTC static libraries built by ninja (libxxxx.a) into the project as references (no need to copy them, so that when the libraries are updated, your project can link against the newest ones)
6. Select all of the WebRTC libraries, in file inspector change their file type to Mach-O Object Code

That's it. I hope that the ninja script has a target that can create a bundle of the WebRTC libraries and headers as a framework so that it can be easy to integrate with other projects (or is there?)

- Scott

TJ Grant

unread,
Nov 1, 2013, 4:19:42 PM11/1/13
to discuss...@googlegroups.com
This will be my final follow up in this thread.
This target is not a currently supported target by WebRTC, so if you want it to build, you'll have to put in some effort on your own.

1. "com.apple.product-type.tool"
WebRTC builds command line tools, then tries to execute them.
Any item that's of type "com.apple.product-type.tool" will build for Mac OS X targets, but not iOS.
Ninja will build these (as Mac OS X targets), and you need the output of these tools, which is why I said in step one, run the ninja version first.
You can't build these targets via Xcode when you regenerate after step 4, so you need to delete these targets.
And like I said in step 2, you need to copy those files that were output from the ninja build

2. "unsupported architecture"
In trunk/build/common.gypi , find the string $(ARCHS_STANDARD_32_64_BIT) and change it to 'armv7', then re-run starting at step 4 in my original reply.

Again, this will be my final follow up in this thread.
This will get you 90% if not 100% there. Any issues beyond that you'll have to put in some effort on your own.
Good luck.

--TJ Grant

Matthew Robertson

unread,
May 27, 2014, 12:54:45 PM5/27/14
to discuss...@googlegroups.com, tjg...@tatewake.com
Sorry to bring this up again. I am just trying to get it working. Can you please expand on what you mean by:

3. In trunk/third_party/libvpx/libvpx.gyp, comment out the "rules" section for the targets "copy_enc_offsets_obj" and "gen_asm_offsets_vpx_scale"

It seems to me there are no "rules" for those targets. Has that gyp file changed since this was posted or am I missing something?

thanks,
Matthew
Reply all
Reply to author
Forward
0 new messages