I wanted to try tuist previews finally. Here’s some of the issues I ran into.
AppNameMobile for the Debug configuration was not found. You can build it by running tuist build AppNameMobile
Why does the output recommend tuist build if it’s deprecated over xcodebuild? I was wondering if release builds aren’t supported as the documentation only shows debug builds also. But later I found the —configuration flag so this was just a temporary confusion.
I was wondering, if caching should be used for these previews. Or standard advice applies debug yes, release not?
Then I had a target vs product name issue. I figured this out because passing a derived data app path worked. I did some debugging by running tuist share locally in Xcode. But the product name is used. The problem was that my product name was somehow wrong in the Graph even though it’s correct in the generated workspace. The root cause is that I didn’t know about the productName argument in the Target init. That init is very long. In hindsight I should have just copied and formatted to read it. I configured all my Tuist projects with a product name in the base settings dictionary e.g. base: [ “PRODUCT_NAME”: “App”]. Because that worked when I first learned how to use Tuist and I adapted my Project.swift from my first converted project.
Tuist could try to consider applying settings from the manifest for tuist share so it just works. It could also warn / inform the user to use this superior productName API.
The problem is also that these generated Swift API files don’t do formatting out of the box. I guess we can’t change that?
public static func target(name: String, destinations: ProjectDescription.Destinations, product: ProjectDescription.Product, productName: String? = nil, bundleId: String, deploymentTargets: ProjectDescription.DeploymentTargets? = nil, infoPlist: ProjectDescription.InfoPlist? = .default, sources: ProjectDescription.SourceFilesList? = nil, resources: ProjectDescription.ResourceFileElements? = nil, buildableFolders: [ProjectDescription.BuildableFolder] = , copyFiles: [ProjectDescription.CopyFilesAction]? = nil, headers: ProjectDescription.Headers? = nil, entitlements: ProjectDescription.Entitlements? = nil, scripts: [ProjectDescription.TargetScript] = , dependencies: [ProjectDescription.TargetDependency] = , settings: ProjectDescription.Settings? = nil, coreDataModels: [ProjectDescription.CoreDataModel] = , environmentVariables: [String : ProjectDescription.EnvironmentVariable] = [:], launchArguments: [ProjectDescription.LaunchArgument] = , additionalFiles: [ProjectDescription.FileElement] = , buildRules: [ProjectDescription.BuildRule] = , mergedBinaryType: ProjectDescription.MergedBinaryType = .disabled, mergeable: Bool = false, onDemandResourcesTags: ProjectDescription.OnDemandResourcesTags? = nil, metadata: ProjectDescription.TargetMetadata = .default) → ProjectDescription.Target
I also struggled a lot to login to the Tuist iOS app, because automatic password fill in or 1Password somehow breaks the Tuist login page. I posted a video in Slack.
Now that this works I’ll continue try using previews and report back, if I encounter anymore issues.
