Code Monkey home page Code Monkey logo

Comments (11)

ffried avatar ffried commented on June 19, 2024 1

Thanks for the xcodebuild command. I think we can make this work for you.

First, we need to distinguish between the Info.plist and the Xcode project. xcodebuild can't update your Info.plist. xcodebuild itself usually does not even modify the project file. It does what it says on the tin - it builds the project 😉

What I don't understand yet, is why you need to re-create the project on every update? Even if you need to do this, I'd recommend having a look at xcconfig files. Most dependency managers (like Swift Package Manager, CocoaPods and Carthage) and many other projects use them to manage build settings outside of the Xcode project - thus not loosing them if the project has to be recreated for some reason.

Again, the Info.plist is a separate file, that should usually have even less reasons to be re-generated. Modifying the Info.plist is also something that we very likely won't ever do in this action. It's not too complicated using e.g. PlistBuddy (which comes with macOS), however. So I'd recommend doing this in a simple shell script.

Back to your command: While the points I just raised are still valid, the following snippet should do the same as your current command (you should only need to specify the project in the snippet):

- uses: sersoft-gmbh/xcodebuild-action@v1
  with:
    project: path/to/your/project.xcodeproj
    configuration: Debug
    action: build
    sdk: iphonesimulator14.0
    build-settings: -target AdMob -arch x86_64 -allowProvisioningUpdates OTHER_LDFLAGS="-ObjC" FRAMEWORK_SEARCH_PATHS="/Users/runner/work/Godot-AdMob-Android-iOS/Godot-AdMob-Android-iOS/AdMob/GoogleMobileAdsSdkiOS-7.68.0/GoogleMobileAds.xcframework/ios-i386_x86_64-simulator"
        OTHER_LIBTOOLFLAGS="/Users/runner/work/Godot-AdMob-Android-iOS/Godot-AdMob-Android-iOS/AdMob/GoogleMobileAdsSdkiOS-7.68.0/GoogleMobileAds.xcframework/ios-i386_x86_64-simulator"

from xcodebuild-action.

gumaciel avatar gumaciel commented on June 19, 2024 1

@ffried , i'm currently working for Android, when i finish i will try it for XCode, thank you so much i will close the issue here, if some error continue to appear i will tell her

from xcodebuild-action.

ffried avatar ffried commented on June 19, 2024

First of all, a lot of this sounds like you should be extending your Xcode project and schemes with what you need. The advantage would be that it's very easy to reproduce locally what the CI does, without having to put together a whole lot of parameters for a command.

Apart from that:
You can currently work around any missing parameters to xcodebuild by using the build-settings parameter of this action. We currently also use this for example here.

Please give this a shot. Do you think you could also provide me with an xcodebuild invocation that you use? If we find that a particular parameter to xcodebuild is frequently used but not yet supported by this action, we're happy to extend the action with that parameter.

from xcodebuild-action.

gumaciel avatar gumaciel commented on June 19, 2024

@ffried , thanks for your qucikly response, this is my xcodebuild workflow command: https://github.com/Poing-Studios/Godot-AdMob-Android-iOS/blob/master/.github/workflows/export_ios_project.yml#L72

I am quite new to iOS development, this project is part of a module for Godot, the module is for AdMob iOS and Android, for iOS I need to make these settings in the XCode project:

https://developers.google.com/admob/ios/quick-start#import_the_mobile_ads_sdk

I can download the SDK, but I can't import the frameworks into the XCode project, I also don't know how to add the -ObjC Other Linker Flags and Update the app's Info.plist file to add two keys along with xcodebuild

(it needs to be done entirely by xcodebuild or something, because whenever an update arrives on the module, the project needs to be exported from the beginning and loses the settings)

Thanks

from xcodebuild-action.

gumaciel avatar gumaciel commented on June 19, 2024

Thanks, i will try right now

from xcodebuild-action.

ffried avatar ffried commented on June 19, 2024

I have good news for you! 🙂
I've just released version 1.3.0, which contains a whole bunch of new options that can be passed. This means, that you can use build-settings for what it was originally designed and the workaround is no longer necessary:

- uses: sersoft-gmbh/xcodebuild-action@v1
  with:
    project: path/to/your/project.xcodeproj
    configuration: Debug
    action: build
    sdk: iphonesimulator14.0
    arch: x86_64
    target: AdMob
    allow-provisioning-updates: true
    build-settings: OTHER_LDFLAGS="-ObjC" FRAMEWORK_SEARCH_PATHS="/Users/runner/work/Godot-AdMob-Android-iOS/Godot-AdMob-Android-iOS/AdMob/GoogleMobileAdsSdkiOS-7.68.0/GoogleMobileAds.xcframework/ios-i386_x86_64-simulator" OTHER_LIBTOOLFLAGS="/Users/runner/work/Godot-AdMob-Android-iOS/Godot-AdMob-Android-iOS/AdMob/GoogleMobileAdsSdkiOS-7.68.0/GoogleMobileAds.xcframework/ios-i386_x86_64-simulator"

Another hint: be careful with absolute paths. GitHub might change the path where actions are executed and your action will break. It's better to use relative paths, or (for the build settings) project variables
The one you might need is actually PROJECT_DIR (which is not documented unfortunately). Here's an answer on stackoverflow which lists it though.

from xcodebuild-action.

gumaciel avatar gumaciel commented on June 19, 2024

@ffried i guess it worked, i removed the admob because was saying was not found arch for "x86_64"

but its building without: https://github.com/Poing-Studios/Godot-AdMob-Android-iOS/actions/runs/375472869

from xcodebuild-action.

gumaciel avatar gumaciel commented on June 19, 2024

Oops, gives a error: https://github.com/Poing-Studios/Godot-AdMob-Android-iOS/runs/1434417315?check_suite_focus=true

xcodebuild: error: The test action requires that the name of a scheme in the project is provided using the "-scheme" option. The "-list" option can be used to find the names of the schemes in the project.

from xcodebuild-action.

gumaciel avatar gumaciel commented on June 19, 2024

Did some changes and it's working: https://github.com/Poing-Studios/Godot-AdMob-Android-iOS/runs/1434564626?check_suite_focus=true

But have one error, I guess it's fault mine of exporting the game project from Godot, ty so much

from xcodebuild-action.

gumaciel avatar gumaciel commented on June 19, 2024

Do you know if there's a way to build a project for 64bits without being x86_64?

from xcodebuild-action.

ffried avatar ffried commented on June 19, 2024

@gustavottc I think the issue is here:
ld: directory not found for option '-F/Users/runner/work/Godot-AdMob-Android-iOS/Godot-AdMob-Android-iOS/AdMob/GoogleMobileAdsSdkiOS-7.68.0/GoogleMobileAds.xcframework/ios-i386_x86_64-simulator'

The directory doesn't exist, thus the linker can't find the binaries to link against.

Do you know if there's a way to build a project for 64bits without being x86_64?

There's also arm64, but this only works with Simulators on Apple Silicon Macs. Intel Macs still need x86_64

from xcodebuild-action.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.