share_my_apk 0.3.1
share_my_apk: ^0.3.1 copied to clipboard
Build and upload Flutter Android APKs to Diawi and Gofile.io faster than you can say 'It's compiling!' A fun and powerful CLI tool.
Share My APK
Tired of the build-and-drag-drop dance? πΊπ Is your mouse complaining about all the extra mileage?
Give your mouse a break! Share My APK is your new best friend, built with love and a sprinkle of magic to automate building and uploading your Flutter Android APKs. Share your builds faster than you can say "Why wasn't this a feature in the first place?!"
Note: This package is in its alpha stage. It's like a baby bird, learning to fly. It might wobble a bit, so use it with an adventurous spirit! π§ͺ
β¨ Features (The Fun Stuff) #
- π Build & Upload: Go from code to shareable link in one command. It's so fast, you'll have time for an extra coffee break.
- βοΈ Multiple Providers: Supports Diawi and Gofile.io. Why did the developer break up with the cloud? It was a stormy relationship.
- π Smart Configuration: Use a
share_my_apk.yamlfile. Because who wants to type the same thing over and over? Not you, that's who. - π¨ Customization Galore: Customize file names, directory structures, and build environments. Make it yours!
- π» User-Friendly CLI: A CLI so friendly, it might just ask you about your day.
- π§ Extensible Library: Want to build your own sharing empire? Use our core services in your Dart projects.
π¦ Installation #
Activate share_my_apk globally. It's like giving it a key to your terminal's heart.
dart pub global activate share_my_apk
Or, if you're the "keep your friends close" type, add it to your project's dev_dependencies:
dev_dependencies:
share_my_apk: ^0.3.1 # Always check for the latest version!
Then, run dart pub get.
π Usage #
1. Initialize (The Smart Move) #
Generate a share_my_apk.yaml config file. Your future self will thank you.
share_my_apk --init
This creates a share_my_apk.yaml file, your personal instruction manual for the tool.
2. Run from the Command Line #
Time to let the magic happen. Use share_my_apk --help if you need a reminder of its awesome powers.
share_my_apk [options]
Key Options:
| Option | Alias | Description |
|---|---|---|
--help |
-h |
Shows the help message. It's like a map to treasure. |
--init |
Generates the magical share_my_apk.yaml config file. |
|
--diawi-token |
Your Diawi API token. Keep it secret, keep it safe. | |
--gofile-token |
Your Gofile API token. Also a secret. | |
--path |
-p |
Path to your Flutter project. Defaults to wherever you are. |
--release |
Build in release mode (use --no-release for debug). |
|
--provider |
Upload provider: diawi or gofile. Choose your champion. |
|
--name |
-n |
Custom name for the APK file. Be creative! |
--environment |
-e |
Environment folder (e.g., dev, prod, staging). |
--output-dir |
-o |
Where to save the APK. Your treasure chest. |
Examples:
# Let's get started!
share_my_apk --init
# Unleash the power!
share_my_apk
# "I choose you, Gofile!"
share_my_apk --provider gofile
# For when you're feeling a bit buggy.
share_my_apk --no-release
3. Use as a Library #
Want to get your hands dirty? Integrate share_my_apk's services into your own code.
Example:
import 'package:share_my_apk/share_my_apk.dart';
import 'package:logging/logging.dart';
void main() async {
// Let's see what's happening under the hood.
Logger.root.level = Level.ALL;
Logger.root.onRecord.listen((rec) {
print('${rec.level.name}: ${rec.time}: ${rec.message}');
});
final logger = Logger('MyApp');
try {
// 1. Build the APK. Abracadabra!
final apkPath = await FlutterBuildService().build(
release: true,
projectPath: '.',
customApkName: 'MyApp_SuperCool_Beta',
environment: 'staging',
outputDir: 'build/my_apks',
);
logger.info('β
APK built! Find it at: $apkPath');
// 2. Send it to the cloud!
final uploader = UploadServiceFactory.create(
'gofile', // or 'diawi'
token: 'YOUR_DIAWI_TOKEN', // Only for Diawi, remember?
);
final downloadLink = await uploader.upload(apkPath);
logger.info('π Houston, we have a download link: $downloadLink');
} catch (e) {
logger.severe('π₯ Uh oh, something went wrong: $e');
}
}
π File Naming & Organization #
- Custom Naming:
--namegives you{customName}_{version}_{timestamp}.apk. - Default Naming: You get
{appName}_{version}_{timestamp}.apk. - Environments:
--environmenthelps you avoid mixing up yourdevandprodbuilds. Phew! - Custom Output:
--output-dirlets you be the boss of your file system.
π§ͺ Testing #
This package is in alpha. It's mostly house-trained, but please test it before introducing it to your production environment.
π€ Contributing #
Got a joke to add? Or maybe a feature? Contributions are welcome! File an issue or a pull request on our GitHub repo.
π License #
This project is licensed under the MIT License. See the LICENSE file for details. Don't worry, it's a friendly license.