Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add xcodebuild command destination flag #147

Merged
merged 12 commits into from
Jan 28, 2022
Merged

Conversation

shams-ahmed
Copy link
Contributor

@shams-ahmed shams-ahmed commented Jan 26, 2022

Without a destination flag xcodebuild fails when running on M1 machine since it always had the mac device.

Only affects Apple project for scan and uitest command

fixes #144 and #131

Resolves issues with M1 as well as adds additional options for -sdk and -destination :
-sdk: If a value is specified for this flag it'll be passed to xcodebuild as the value of the -sdk flag. For more info about the values please see xcodebuild's -sdk flag docs. Example value: iphoneos")

-destination: The xcodebuild -destination option takes as its argument a destination specifier describing the device (or devices) to use as a destination i.e generic/platform=iOS.

See release notes for instructions. Some M1 machines do not have certain folders so you may need to use a custom folder to run curl script

xcodeuitest/xcodeuitestcmd.go Outdated Show resolved Hide resolved
xcode/xcodecmd.go Outdated Show resolved Hide resolved
cmd/xcode.go Outdated Show resolved Hide resolved
cmd/xcode.go Outdated Show resolved Hide resolved
cmd/xcode.go Outdated Show resolved Hide resolved
cmd/xcode.go Outdated Show resolved Hide resolved
cmd/xcode.go Outdated Show resolved Hide resolved
cmd/xcodeUITests.go Outdated Show resolved Hide resolved
}

// OpenArchivableProject ...
func OpenArchivableProject(pth, schemeName, configurationName string) (*xcodeproj.XcodeProj, *xcscheme.Scheme, string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you do not need a separate OpenArchivableProject and OpenArchivableWorkspace.

schemeint.Scheme accepts both a workspace and project path, whatever is provided, it figures out the correct root project (which is connected to the scheme).

The issue with the current implementation is at the OpenArchivableWorkspace: In the case of a workspace project, a given scheme can be located both under the .xcworkspace or under one of the included .xcproject files, this is handled correctly by the schemeint.Scheme, but OpenArchivableWorkspace is not aware of the schemes under the .xcworkspace.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2022-01-28 at 10 10 57

@shams-ahmed shams-ahmed changed the title Add destination flag to xcodebuild command Add xcodebuild command destination flag Jan 28, 2022
@shams-ahmed shams-ahmed merged commit de280f5 into master Jan 28, 2022
@shams-ahmed shams-ahmed deleted the defaultProfileM1Patch branch January 28, 2022 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Xcode Archive failed.
2 participants