【问题标题】:Swift and terminal: Using Google Endpoints in an iOS ClientSwift 和终端:在 iOS 客户端中使用 Google Endpoints
【发布时间】:2016-08-19 12:15:42
【问题描述】:

我在学习教程

https://cloud.google.com/appengine/docs/java/endpoints/calling-from-ios

当我进入第 5 步并打开一个新的终端窗口以调用 ServiceGenerator 时。我在终端中收到错误消息说..

Barrys-MacBook-Pro:~ barrymadej$ /Users/barrymadej/Library/Developer/Xcode/DerivedData/ServiceGenerator-avaeguyitgyhxpcnaejpgzvxezei/Build/Products/Debug/ServiceGenerator \

/Users/barrymadej/Documents/AndroidStudioProjects/StudentProgressTrackerDatabaseAndCloud/backend/build/discovery-docs/myApi-v2-rpc.discovery/ 错误:需要输出目录。

用法:ServiceGenerator [FLAGS] [ARGS]

必需的标志:

--outputDir PATH
    The destination directory for writing the generated files.

可选标志:

--discoveryService URL
    Instead of discovery's default URL, use the specified URL as the
    location to send the JSON-RPC requests. This is useful for running
    against a custom or prerelease server.

--gtlFrameworkName NAME
    Will generate sources that include GTL's headers as if they are in a
    framework with the given name. If you are using GTL via CocoaPods,
    you'll likely want to pass "GoogleAPIClient" as the value for this.

--apiLogDir DIR
    Write out a file into DIR for each JSON API description processed. These
    can be useful for reporting bugs if generation fails with an error.

--httpLogDir PATH
    Turn on the HTTP fetcher logging and set it to write to PATH. This can
    be useful for diagnosing errors on discovery fetches.

--generatePreferred
    Causes the list of services to be collected, and all preferred services
    to be generated.

--httpHeader NAME:VALUE
    Causes the given NAME/VALUE pair to be added as an HTTP header on *all*
    HTTP requests made by the generator. Can be used repeatedly to provide
    additional header pairs.

--formattedName SERVICE:VERSION=NAME
    Causes the given SERVICE:VERSION pair to override its service name in
    files, classes, etc. with NAME. If :VERSION is omitted the override is
    for any version of the service. Can be used repeatedly to provide
    several maps when generating a few things in a single run.

--addServiceNameDir yes|no  Default: no
    Causes the generator to add a directory with the service name in the
    outputDir for the files. This is useful for generating multiple
    services.

--generatedDir yes|no  Default: no
    Causes a directory in outputDir called "Generated" to be created and
    used to contain the generated files.

--removeUnknownFiles yes|no  Default: no
    By default, the generator will report unknown files in the output
    directory, as commonly happens when classes go away in a new API
    version. This option causes the generator to also remove the unknown
    files.

--rootURLOverrides yes|no  Default: yes
    Causes any API root URL for a Google sandbox server to be replaced with
    the googleapis.com root instead.

--verbose
    Generate more verbose output. Can be used more than once.

参数:

Multiple arguments can be given on the command line.

service:version
    The description of the given [service]/[version] pair is fetched and the
    files for it are generated. When using --generatePreferred version can
    be '-' to skip generating the name service.

http[s]://url/to/rpc_description_json
    A URL to download containing the description of a service to generate.

path/to/rpc_description.json
    The path to a text file containing the description of a service to
    generate.

ServiceGenerator 路径:

/Users/barrymadej/Library/Developer/Xcode/DerivedData/ServiceGenerator-avaeguyitgyhxpcnaejpgzvxezei/Build/Products/Debug/ServiceGenerator ERROR:有一个或多个错误;检查完整输出以获取详细信息。 Barrys-MacBook-Pro:~ barrymadej$ --outputDir -bash:--outputDir:找不到命令 Barrys-MacBook-Pro:~ barrymadej$ /Users/barrymadej/Documents/AndroidStudioProjects/StudentProgressTrackerDatabaseAndCloud/API

【问题讨论】:

  • 感谢您指出这一点。希望我的标签现在更合适。

标签: terminal google-cloud-endpoints


【解决方案1】:

您应该生成一个 REST 发现文档并改用 the new Objective C client。无论如何,您尝试使用的客户端库已被弃用。看起来它不起作用,因为您在没有命令其余部分的情况下指定了标志。

【讨论】:

  • 谢谢,据我所知,我已经生成了 REST 发现文档。我将尝试使用客观 C 客户端。
猜你喜欢
  • 1970-01-01
  • 2014-05-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-06-01
相关资源
最近更新 更多