test_plugin_ios.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/bash -eu
  2. export LIBWEBRTC_DOWNLOAD_URL=https://github.com/Unity-Technologies/com.unity.webrtc/releases/download/M92/webrtc-ios.zip
  3. export SOLUTION_DIR=$(pwd)/Plugin~
  4. # Install cmake
  5. brew install cmake
  6. # Download LibWebRTC
  7. curl -L $LIBWEBRTC_DOWNLOAD_URL > webrtc.zip
  8. unzip -d $SOLUTION_DIR/webrtc webrtc.zip
  9. # Install googletest
  10. git clone https://github.com/google/googletest.git
  11. cd googletest
  12. git checkout 2fe3bd994b3189899d93f1d5a881e725e046fdc2
  13. cmake . \
  14. -G Xcode \
  15. -D CMAKE_SYSTEM_NAME=iOS \
  16. -D "CMAKE_OSX_ARCHITECTURES=arm64;x86_64" \
  17. -D CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO \
  18. -D CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE=YES \
  19. -D CMAKE_IOS_INSTALL_COMBINED=YES \
  20. -D CMAKE_INSTALL_PREFIX=. \
  21. -B build
  22. cmake --build build --config Debug --target install
  23. # Build webrtc Unity plugin for test
  24. cd "$SOLUTION_DIR"
  25. cmake . \
  26. -G Xcode \
  27. -D CMAKE_SYSTEM_NAME=iOS \
  28. -D "CMAKE_OSX_ARCHITECTURES=arm64;x86_64" \
  29. -D CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO \
  30. -D CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE=YES \
  31. -B build
  32. xcodebuild build \
  33. -sdk iphonesimulator \
  34. -project build/webrtc.xcodeproj \
  35. -scheme WebRTCLibTest \
  36. -configuration Debug
  37. # todo(kazuki): testing app on the iOS simulator
  38. #xcodebuild test \
  39. # -project build/webrtc.xcodeproj \
  40. # -scheme WebRTCLibTest \
  41. # -destination 'platform=iOS Simulator,name=iPhone 8,OS=13.3'