Contentsquare CLI
A Dart plugin that offers a command-line interface for users of the Contentsquare package.
Installation
Section titled InstallationAdd contentsquare_cli
as a dev dependency.
then run
Usage
Section titled Usageupload-debug-files command
Section titled upload-debug-files commandThis command enables you to upload debug files generated by the flutter build
command to Contentsquare. This allows you to read the Flutter errors generated in an obfuscated or de-symbolized app.
Configuration
Section titled ConfigurationTo use the command, provide the following identification elements. These can be passed directly as arguments each time you run the command or set up in a configuration file within your project for a more streamlined command usage.
The required information includes:
-
The targeted platform
ios
orandroid
, corresponding to theflutter build
command. -
The project ID
- Login to the Contentsquare platform on https://app.contentsquare.com ↗
- Make sure to be on the right project
- The project ID can be found in the URL query parameter
project
:https://app.contentsquare.com/#/{MODULE_NAME}?project={PROJECT_ID}&hash={HASH}]
-
Valid API credentials
Follow the dedicated documentation from the Help Center to get the client ID and client Secret: How to create API credentials ↗.
-
The debug info directory
Provided to the
--split-debug-info
option during build command -
The obfuscation map path (optional)
If you use the
--obfuscate
option during the build process, you can specify the path for the obfuscation map by adding the build option--extra-gen-snapshot-options=--save-obfuscation-map=[YOUR DESIRED FILE PATH]
.
Using the YAML configuration file
Section titled Using the YAML configuration fileYou can supply this information by adding a contentsquare_cli.yaml
file to the root of your project.
Using the command line arguments
Section titled Using the command line argumentsAlternatively, this information can be provided directly as arguments on the command line.
Option | Description |
---|---|
—platform | The target platform for which the debug files are uploaded |
—client-id | The client ID of API credentials ↗ |
—client-secret | The client SECRET of API credentials ↗ |
—project-id | The contentsquare project ID |
—debug-info-dir | The path from --split-debug-info option |
—obfuscation-mapping-file | The generated obfuscation map path |
Examples
Section titled ExamplesLet’s take the case of debug files generated by this flutter build
command:
Using this configuration file:
You can invoke the upload-debug-files command as follows:
If you prefer using the command line only:
Changelog
Section titled Changelog1.0.0 - 2024.11.05
Section titled 1.0.0 - 2024.11.05- Introduce the
upload-debug-files
command