Swift和终端:在iOS客户端中使用Google终端

时间:2016-08-19 12:15:42

标签: terminal google-cloud-endpoints

我正在关注

的教程

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路径:

/用户/ barrymadej /库/开发商/ Xcode中/ DerivedData / ServiceGenerator-avaeguyitgyhxpcnaejpgzvxezei /建造/产品/调试/ ServiceGenerator 错误:有一个或多个错误;检查完整输出以获取详细信息。 Barrys-MacBook-Pro:~barrymadej $ --outputDir -bash: - outputDir:找不到命令 Barrys-MacBook-Pro:~barrymadej $ / Users / barrymadej / Documents / AndroidStudioProjects / StudentProgressTrackerDatabaseAndCloud / API

1 个答案:

答案 0 :(得分:0)

您应该生成REST发现文档并使用the new Objective C client代替。无论如何,您尝试使用的客户端库已被弃用。看起来它没有用,因为你指定了没有其余命令的标志。