packwise-skills 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursorrules +23 -23
- package/CLAUDE.md +25 -25
- package/LICENSE +21 -0
- package/README.md +404 -295
- package/audit.md +224 -224
- package/bin/packwise.js +322 -155
- package/install.sh +123 -0
- package/package.json +32 -31
- package/skill.md +944 -719
- package/sub-skills/ai/local-llm.md +183 -183
- package/sub-skills/ai/python-ml.md +164 -164
- package/sub-skills/backend/go-server.md +184 -184
- package/sub-skills/backend/java-spring.md +241 -241
- package/sub-skills/backend/node-server.md +164 -164
- package/sub-skills/backend/php-laravel.md +175 -175
- package/sub-skills/backend/python-server.md +164 -164
- package/sub-skills/backend/rust-backend.md +118 -118
- package/sub-skills/cli/python-cli.md +236 -236
- package/sub-skills/cli/sdk-library.md +497 -497
- package/sub-skills/cloud/ci-cd-pipelines.md +350 -350
- package/sub-skills/cloud/docker.md +191 -191
- package/sub-skills/cloud/kubernetes.md +277 -277
- package/sub-skills/cloud/payment-integration.md +307 -307
- package/sub-skills/cross-platform/multiplatform.md +252 -252
- package/sub-skills/desktop/electron.md +783 -783
- package/sub-skills/desktop/game-dev.md +443 -443
- package/sub-skills/desktop/native-app.md +123 -123
- package/sub-skills/desktop/scenarios.md +443 -443
- package/sub-skills/desktop/smart-platforms.md +324 -324
- package/sub-skills/desktop/tauri.md +428 -428
- package/sub-skills/desktop/vr-ar.md +252 -252
- package/sub-skills/desktop/web-to-desktop.md +153 -153
- package/sub-skills/embedded/car-infotainment.md +129 -129
- package/sub-skills/embedded/esp32.md +184 -184
- package/sub-skills/embedded/ros.md +150 -150
- package/sub-skills/embedded/stm32.md +160 -160
- package/sub-skills/mobile/android.md +322 -322
- package/sub-skills/mobile/capacitor.md +232 -232
- package/sub-skills/mobile/flutter-mobile.md +138 -138
- package/sub-skills/mobile/harmonyos.md +150 -150
- package/sub-skills/mobile/ios.md +245 -245
- package/sub-skills/mobile/react-native.md +443 -443
- package/sub-skills/mobile/wearables.md +230 -230
- package/sub-skills/plugins/browser-extension.md +308 -308
- package/sub-skills/plugins/jetbrains-plugin.md +226 -226
- package/sub-skills/plugins/vscode-extension.md +204 -204
- package/sub-skills/security/security-tools.md +174 -174
- package/sub-skills/web/monorepo.md +274 -274
- package/sub-skills/web/pwa.md +220 -220
- package/sub-skills/web/serverless-edge.md +295 -295
- package/sub-skills/web/spa.md +266 -266
- package/sub-skills/web/ssr.md +228 -228
- package/sub-skills/web/wasm.md +243 -243
|
@@ -1,138 +1,138 @@
|
|
|
1
|
-
# Flutter Mobile Build Sub-Skill
|
|
2
|
-
|
|
3
|
-
Build cross-platform mobile applications with Flutter (Android + iOS + Web + Desktop from single codebase).
|
|
4
|
-
|
|
5
|
-
**Current version**: Flutter 3.44.x / Dart 3.12.x (2025-2026)
|
|
6
|
-
|
|
7
|
-
## When to Use
|
|
8
|
-
|
|
9
|
-
- Single codebase for Android + iOS (+ Web + Desktop)
|
|
10
|
-
- Custom UI with high-performance rendering (Impeller engine)
|
|
11
|
-
- Team willing to learn Dart
|
|
12
|
-
- Apps requiring smooth animations and custom designs
|
|
13
|
-
|
|
14
|
-
## Build
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
# Android
|
|
18
|
-
flutter build apk --release # APK (direct install)
|
|
19
|
-
flutter build appbundle --release # AAB (Google Play required)
|
|
20
|
-
flutter build apk --release --split-per-abi # Separate APK per architecture (smaller)
|
|
21
|
-
|
|
22
|
-
# iOS (requires macOS)
|
|
23
|
-
flutter build ios --release
|
|
24
|
-
flutter build ipa --release # IPA for App Store / TestFlight
|
|
25
|
-
|
|
26
|
-
# Web
|
|
27
|
-
flutter build web --release
|
|
28
|
-
|
|
29
|
-
# Desktop
|
|
30
|
-
flutter build windows --release
|
|
31
|
-
flutter build macos --release
|
|
32
|
-
flutter build linux --release
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Signing
|
|
36
|
-
|
|
37
|
-
### Android
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
# key.properties (project root, DO NOT commit)
|
|
41
|
-
storePassword=your-store-password
|
|
42
|
-
keyPassword=your-key-password
|
|
43
|
-
keyAlias=your-key-alias
|
|
44
|
-
storeFile=../key/my-release-key.jks
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
```groovy
|
|
48
|
-
// android/app/build.gradle.kts
|
|
49
|
-
def keystoreProperties = new Properties()
|
|
50
|
-
def keystorePropertiesFile = rootProject.file('key.properties')
|
|
51
|
-
if (keystorePropertiesFile.exists()) {
|
|
52
|
-
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
android {
|
|
56
|
-
signingConfigs {
|
|
57
|
-
release {
|
|
58
|
-
keyAlias keystoreProperties['keyAlias']
|
|
59
|
-
keyPassword keystoreProperties['keyPassword']
|
|
60
|
-
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
|
61
|
-
storePassword keystoreProperties['storePassword']
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
buildTypes {
|
|
65
|
-
release {
|
|
66
|
-
signingConfig signingConfigs.release
|
|
67
|
-
minifyEnabled true
|
|
68
|
-
shrinkResources true
|
|
69
|
-
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### iOS
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
# Open Xcode workspace
|
|
79
|
-
open ios/Runner.xcworkspace
|
|
80
|
-
|
|
81
|
-
# In Xcode:
|
|
82
|
-
# 1. Signing & Capabilities → Team → Select your team
|
|
83
|
-
# 2. Bundle Identifier → Set unique ID
|
|
84
|
-
# 3. Product → Archive → Distribute → App Store Connect
|
|
85
|
-
|
|
86
|
-
# Command line (requires fastlane)
|
|
87
|
-
cd ios && fastlane beta # TestFlight
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## Flavor / Build Variants
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
# Define flavors in android/app/build.gradle.kts
|
|
94
|
-
# Then build specific flavor:
|
|
95
|
-
flutter build apk --release --flavor production
|
|
96
|
-
flutter build appbundle --release --flavor production
|
|
97
|
-
flutter build ios --release --flavor staging
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
```dart
|
|
101
|
-
// lib/flavors.dart
|
|
102
|
-
enum Flavor { dev, staging, production }
|
|
103
|
-
|
|
104
|
-
class F {
|
|
105
|
-
static Flavor? appFlavor;
|
|
106
|
-
static String get apiBaseUrl => switch (appFlavor) {
|
|
107
|
-
Flavor.dev => 'http://localhost:3000',
|
|
108
|
-
Flavor.staging => 'https://staging.example.com',
|
|
109
|
-
Flavor.production => 'https://api.example.com',
|
|
110
|
-
_ => 'http://localhost:3000',
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
## Impeller Rendering Engine (Default since Flutter 3.16)
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
# Impeller is default on iOS, macOS, Android (Vulkan)
|
|
119
|
-
# Verify: check logs for "Using Impeller rendering backend"
|
|
120
|
-
|
|
121
|
-
# Disable Impeller (if issues):
|
|
122
|
-
flutter run --no-enable-impeller
|
|
123
|
-
# AndroidManifest.xml: <meta-data android:name="io.flutter.embedding.android.EnableImpeller" android:value="false" />
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## Common Pitfalls
|
|
127
|
-
|
|
128
|
-
| Issue | Fix |
|
|
129
|
-
|-------|-----|
|
|
130
|
-
| Android signing error | Check `key.properties` path; ensure keystore exists |
|
|
131
|
-
| iOS build failure | Requires Mac + Xcode 15+; run `cd ios && pod install` |
|
|
132
|
-
| Blurry icons | Provide all required icon sizes (use `flutter_launcher_icons` package) |
|
|
133
|
-
| Platform differences | Use `Platform.isIOS` / `Platform.isAndroid` for conditional code |
|
|
134
|
-
| App size too large | Use `--split-per-abi`; enable `shrinkResources`; remove unused plugins |
|
|
135
|
-
| Impeller rendering glitches | Disable Impeller for specific platform; file Flutter issue |
|
|
136
|
-
| `flutter build` hangs | Run `flutter clean && flutter pub get` |
|
|
137
|
-
| CocoaPods error | `cd ios && pod deinstall && pod install`; check Ruby version |
|
|
138
|
-
| Web build: CORS issues | Use `flutter run -d chrome --web-browser-flag=--disable-web-security` (dev only) |
|
|
1
|
+
# Flutter Mobile Build Sub-Skill
|
|
2
|
+
|
|
3
|
+
Build cross-platform mobile applications with Flutter (Android + iOS + Web + Desktop from single codebase).
|
|
4
|
+
|
|
5
|
+
**Current version**: Flutter 3.44.x / Dart 3.12.x (2025-2026)
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
- Single codebase for Android + iOS (+ Web + Desktop)
|
|
10
|
+
- Custom UI with high-performance rendering (Impeller engine)
|
|
11
|
+
- Team willing to learn Dart
|
|
12
|
+
- Apps requiring smooth animations and custom designs
|
|
13
|
+
|
|
14
|
+
## Build
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Android
|
|
18
|
+
flutter build apk --release # APK (direct install)
|
|
19
|
+
flutter build appbundle --release # AAB (Google Play required)
|
|
20
|
+
flutter build apk --release --split-per-abi # Separate APK per architecture (smaller)
|
|
21
|
+
|
|
22
|
+
# iOS (requires macOS)
|
|
23
|
+
flutter build ios --release
|
|
24
|
+
flutter build ipa --release # IPA for App Store / TestFlight
|
|
25
|
+
|
|
26
|
+
# Web
|
|
27
|
+
flutter build web --release
|
|
28
|
+
|
|
29
|
+
# Desktop
|
|
30
|
+
flutter build windows --release
|
|
31
|
+
flutter build macos --release
|
|
32
|
+
flutter build linux --release
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Signing
|
|
36
|
+
|
|
37
|
+
### Android
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# key.properties (project root, DO NOT commit)
|
|
41
|
+
storePassword=your-store-password
|
|
42
|
+
keyPassword=your-key-password
|
|
43
|
+
keyAlias=your-key-alias
|
|
44
|
+
storeFile=../key/my-release-key.jks
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```groovy
|
|
48
|
+
// android/app/build.gradle.kts
|
|
49
|
+
def keystoreProperties = new Properties()
|
|
50
|
+
def keystorePropertiesFile = rootProject.file('key.properties')
|
|
51
|
+
if (keystorePropertiesFile.exists()) {
|
|
52
|
+
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
android {
|
|
56
|
+
signingConfigs {
|
|
57
|
+
release {
|
|
58
|
+
keyAlias keystoreProperties['keyAlias']
|
|
59
|
+
keyPassword keystoreProperties['keyPassword']
|
|
60
|
+
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
|
61
|
+
storePassword keystoreProperties['storePassword']
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
buildTypes {
|
|
65
|
+
release {
|
|
66
|
+
signingConfig signingConfigs.release
|
|
67
|
+
minifyEnabled true
|
|
68
|
+
shrinkResources true
|
|
69
|
+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### iOS
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Open Xcode workspace
|
|
79
|
+
open ios/Runner.xcworkspace
|
|
80
|
+
|
|
81
|
+
# In Xcode:
|
|
82
|
+
# 1. Signing & Capabilities → Team → Select your team
|
|
83
|
+
# 2. Bundle Identifier → Set unique ID
|
|
84
|
+
# 3. Product → Archive → Distribute → App Store Connect
|
|
85
|
+
|
|
86
|
+
# Command line (requires fastlane)
|
|
87
|
+
cd ios && fastlane beta # TestFlight
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Flavor / Build Variants
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Define flavors in android/app/build.gradle.kts
|
|
94
|
+
# Then build specific flavor:
|
|
95
|
+
flutter build apk --release --flavor production
|
|
96
|
+
flutter build appbundle --release --flavor production
|
|
97
|
+
flutter build ios --release --flavor staging
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
```dart
|
|
101
|
+
// lib/flavors.dart
|
|
102
|
+
enum Flavor { dev, staging, production }
|
|
103
|
+
|
|
104
|
+
class F {
|
|
105
|
+
static Flavor? appFlavor;
|
|
106
|
+
static String get apiBaseUrl => switch (appFlavor) {
|
|
107
|
+
Flavor.dev => 'http://localhost:3000',
|
|
108
|
+
Flavor.staging => 'https://staging.example.com',
|
|
109
|
+
Flavor.production => 'https://api.example.com',
|
|
110
|
+
_ => 'http://localhost:3000',
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Impeller Rendering Engine (Default since Flutter 3.16)
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Impeller is default on iOS, macOS, Android (Vulkan)
|
|
119
|
+
# Verify: check logs for "Using Impeller rendering backend"
|
|
120
|
+
|
|
121
|
+
# Disable Impeller (if issues):
|
|
122
|
+
flutter run --no-enable-impeller
|
|
123
|
+
# AndroidManifest.xml: <meta-data android:name="io.flutter.embedding.android.EnableImpeller" android:value="false" />
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Common Pitfalls
|
|
127
|
+
|
|
128
|
+
| Issue | Fix |
|
|
129
|
+
|-------|-----|
|
|
130
|
+
| Android signing error | Check `key.properties` path; ensure keystore exists |
|
|
131
|
+
| iOS build failure | Requires Mac + Xcode 15+; run `cd ios && pod install` |
|
|
132
|
+
| Blurry icons | Provide all required icon sizes (use `flutter_launcher_icons` package) |
|
|
133
|
+
| Platform differences | Use `Platform.isIOS` / `Platform.isAndroid` for conditional code |
|
|
134
|
+
| App size too large | Use `--split-per-abi`; enable `shrinkResources`; remove unused plugins |
|
|
135
|
+
| Impeller rendering glitches | Disable Impeller for specific platform; file Flutter issue |
|
|
136
|
+
| `flutter build` hangs | Run `flutter clean && flutter pub get` |
|
|
137
|
+
| CocoaPods error | `cd ios && pod deinstall && pod install`; check Ruby version |
|
|
138
|
+
| Web build: CORS issues | Use `flutter run -d chrome --web-browser-flag=--disable-web-security` (dev only) |
|
|
@@ -1,150 +1,150 @@
|
|
|
1
|
-
# HarmonyOS Build Sub-Skill
|
|
2
|
-
|
|
3
|
-
Build and publish Huawei HarmonyOS / OpenHarmony applications.
|
|
4
|
-
|
|
5
|
-
**Current version**: HarmonyOS NEXT 5.0 / DevEco Studio 5.x (2025-2026)
|
|
6
|
-
|
|
7
|
-
## When to Use
|
|
8
|
-
|
|
9
|
-
- Huawei ecosystem apps (phones, tablets, watches, smart screens, cars)
|
|
10
|
-
- HarmonyOS NEXT (no longer Android-compatible, uses ArkTS/ArkUI)
|
|
11
|
-
- OpenHarmony (open-source base for other OEMs)
|
|
12
|
-
- Smart home / IoT integration with HiLink
|
|
13
|
-
|
|
14
|
-
## Prerequisites
|
|
15
|
-
|
|
16
|
-
- DevEco Studio 5.x (Huawei official IDE, based on IntelliJ)
|
|
17
|
-
- Huawei developer account (free): developer.huawei.com
|
|
18
|
-
- HarmonyOS NEXT SDK (API 12+)
|
|
19
|
-
- Huawei device or emulator
|
|
20
|
-
|
|
21
|
-
## Key Architecture
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
HarmonyOS NEXT (API 12+)
|
|
25
|
-
├── ArkTS (TypeScript-like language) ← Primary language
|
|
26
|
-
├── ArkUI (declarative UI framework) ← UI framework
|
|
27
|
-
├── ArkCompiler ← AOT compilation
|
|
28
|
-
├── AbilityKit ← App lifecycle
|
|
29
|
-
├── ArkData ← Data management
|
|
30
|
-
└── HarmonyOS Design System ← UI components
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
**Important**: HarmonyOS NEXT is **NOT** Android-compatible. Existing Android APKs will NOT run. Apps must be rebuilt with ArkTS/ArkUI.
|
|
34
|
-
|
|
35
|
-
## Project Structure
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
entry/
|
|
39
|
-
├── src/main/
|
|
40
|
-
│ ├── ets/ ← ArkTS source code
|
|
41
|
-
│ │ ├── entryability/
|
|
42
|
-
│ │ │ └── EntryAbility.ets ← App entry point
|
|
43
|
-
│ │ ├── pages/
|
|
44
|
-
│ │ │ └── Index.ets ← Main page
|
|
45
|
-
│ │ └── common/
|
|
46
|
-
│ ├── resources/ ← Resources (images, strings)
|
|
47
|
-
│ └── module.json5 ← Module configuration
|
|
48
|
-
├── oh-package.json5 ← Package configuration
|
|
49
|
-
└── build-profile.json5 ← Build configuration
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Build
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
# DevEco Studio: Build → Build Hap(s)/APP(s)
|
|
56
|
-
# Command line:
|
|
57
|
-
hvigorw assembleHap --mode module -p module=entry
|
|
58
|
-
|
|
59
|
-
# Build APP (multi-module bundle)
|
|
60
|
-
hvigorw assembleApp --mode project
|
|
61
|
-
|
|
62
|
-
# Output:
|
|
63
|
-
# entry/build/default/outputs/default/entry-default-signed.hap
|
|
64
|
-
# build/default/outputs/default/MyApp-default-signed.app
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Signing
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
# 1. Generate signing key in DevEco Studio:
|
|
71
|
-
# File → Project Structure → Signing Configs → Add
|
|
72
|
-
# 2. Or generate manually:
|
|
73
|
-
keytool -genkeypair -alias myAppKey -keyalg RSA -keysize 2048 \
|
|
74
|
-
-keystore myApp.p12 -storetype PKCS12 -validity 36500
|
|
75
|
-
|
|
76
|
-
# 3. Configure in build-profile.json5
|
|
77
|
-
{
|
|
78
|
-
"signingConfigs": [{
|
|
79
|
-
"name": "default",
|
|
80
|
-
"material": {
|
|
81
|
-
"storeFile": "myApp.p12",
|
|
82
|
-
"storePassword": "***",
|
|
83
|
-
"keyAlias": "myAppKey",
|
|
84
|
-
"keyPassword": "***",
|
|
85
|
-
"signAlg": "SHA256withECDSA"
|
|
86
|
-
}
|
|
87
|
-
}]
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## Publishing
|
|
92
|
-
|
|
93
|
-
| Step | Description |
|
|
94
|
-
|------|-------------|
|
|
95
|
-
| 1. Register developer | developer.huawei.com (free) |
|
|
96
|
-
| 2. Create application | AppGallery Connect → My Apps |
|
|
97
|
-
| 3. Configure app info | Name, description, category, privacy policy |
|
|
98
|
-
| 4. Sign APP | DevEco Studio generates signing |
|
|
99
|
-
| 5. Build HAP/APP | DevEco Studio or hvigorw |
|
|
100
|
-
| 6. Upload to AGC | AppGallery Connect console |
|
|
101
|
-
| 7. Submit review | Typically 1–3 days |
|
|
102
|
-
|
|
103
|
-
## HarmonyOS NEXT vs HarmonyOS 3.x/4.x
|
|
104
|
-
|
|
105
|
-
| Feature | HarmonyOS NEXT (5.0) | HarmonyOS 3.x/4.x |
|
|
106
|
-
|---------|---------------------|-------------------|
|
|
107
|
-
| Android compatibility | No (pure ArkTS) | Yes (APK support) |
|
|
108
|
-
| Language | ArkTS only | Java/ArkTS |
|
|
109
|
-
| UI Framework | ArkUI | Java UI + ArkUI |
|
|
110
|
-
| Min API | 12 | 7–9 |
|
|
111
|
-
| Distribution | HAP/APP | HAP/APP + APK |
|
|
112
|
-
|
|
113
|
-
## ArkTS Quick Start
|
|
114
|
-
|
|
115
|
-
```typescript
|
|
116
|
-
// pages/Index.ets
|
|
117
|
-
@Entry
|
|
118
|
-
@Component
|
|
119
|
-
struct Index {
|
|
120
|
-
@State message: string = 'Hello HarmonyOS'
|
|
121
|
-
|
|
122
|
-
build() {
|
|
123
|
-
Column() {
|
|
124
|
-
Text(this.message)
|
|
125
|
-
.fontSize(30)
|
|
126
|
-
.fontWeight(FontWeight.Bold)
|
|
127
|
-
Button('Click Me')
|
|
128
|
-
.onClick(() => {
|
|
129
|
-
this.message = 'Hello World!'
|
|
130
|
-
})
|
|
131
|
-
.margin({ top: 20 })
|
|
132
|
-
}
|
|
133
|
-
.width('100%')
|
|
134
|
-
.height('100%')
|
|
135
|
-
.justifyContent(FlexAlign.Center)
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
## Common Pitfalls
|
|
141
|
-
|
|
142
|
-
| Issue | Fix |
|
|
143
|
-
|-------|-----|
|
|
144
|
-
| APK not working on NEXT | HarmonyOS NEXT requires ArkTS rewrite; no Android compatibility |
|
|
145
|
-
| Signing failure | Configure signing in DevEco Studio; check certificate validity |
|
|
146
|
-
| API incompatibility | Check HarmonyOS API version in module.json5 |
|
|
147
|
-
| Emulator slow | Use Remote Device (real Huawei devices in cloud) |
|
|
148
|
-
| Build error: hvigorw not found | Set DevEco Studio SDK path; run from project root |
|
|
149
|
-
| App rejected by store | Ensure privacy policy URL; comply with Huawei review guidelines |
|
|
150
|
-
| Third-party library unavailable | Check OpenHarmony registry (ohpm.openharmony.cn) |
|
|
1
|
+
# HarmonyOS Build Sub-Skill
|
|
2
|
+
|
|
3
|
+
Build and publish Huawei HarmonyOS / OpenHarmony applications.
|
|
4
|
+
|
|
5
|
+
**Current version**: HarmonyOS NEXT 5.0 / DevEco Studio 5.x (2025-2026)
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
- Huawei ecosystem apps (phones, tablets, watches, smart screens, cars)
|
|
10
|
+
- HarmonyOS NEXT (no longer Android-compatible, uses ArkTS/ArkUI)
|
|
11
|
+
- OpenHarmony (open-source base for other OEMs)
|
|
12
|
+
- Smart home / IoT integration with HiLink
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
- DevEco Studio 5.x (Huawei official IDE, based on IntelliJ)
|
|
17
|
+
- Huawei developer account (free): developer.huawei.com
|
|
18
|
+
- HarmonyOS NEXT SDK (API 12+)
|
|
19
|
+
- Huawei device or emulator
|
|
20
|
+
|
|
21
|
+
## Key Architecture
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
HarmonyOS NEXT (API 12+)
|
|
25
|
+
├── ArkTS (TypeScript-like language) ← Primary language
|
|
26
|
+
├── ArkUI (declarative UI framework) ← UI framework
|
|
27
|
+
├── ArkCompiler ← AOT compilation
|
|
28
|
+
├── AbilityKit ← App lifecycle
|
|
29
|
+
├── ArkData ← Data management
|
|
30
|
+
└── HarmonyOS Design System ← UI components
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Important**: HarmonyOS NEXT is **NOT** Android-compatible. Existing Android APKs will NOT run. Apps must be rebuilt with ArkTS/ArkUI.
|
|
34
|
+
|
|
35
|
+
## Project Structure
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
entry/
|
|
39
|
+
├── src/main/
|
|
40
|
+
│ ├── ets/ ← ArkTS source code
|
|
41
|
+
│ │ ├── entryability/
|
|
42
|
+
│ │ │ └── EntryAbility.ets ← App entry point
|
|
43
|
+
│ │ ├── pages/
|
|
44
|
+
│ │ │ └── Index.ets ← Main page
|
|
45
|
+
│ │ └── common/
|
|
46
|
+
│ ├── resources/ ← Resources (images, strings)
|
|
47
|
+
│ └── module.json5 ← Module configuration
|
|
48
|
+
├── oh-package.json5 ← Package configuration
|
|
49
|
+
└── build-profile.json5 ← Build configuration
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Build
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# DevEco Studio: Build → Build Hap(s)/APP(s)
|
|
56
|
+
# Command line:
|
|
57
|
+
hvigorw assembleHap --mode module -p module=entry
|
|
58
|
+
|
|
59
|
+
# Build APP (multi-module bundle)
|
|
60
|
+
hvigorw assembleApp --mode project
|
|
61
|
+
|
|
62
|
+
# Output:
|
|
63
|
+
# entry/build/default/outputs/default/entry-default-signed.hap
|
|
64
|
+
# build/default/outputs/default/MyApp-default-signed.app
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Signing
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# 1. Generate signing key in DevEco Studio:
|
|
71
|
+
# File → Project Structure → Signing Configs → Add
|
|
72
|
+
# 2. Or generate manually:
|
|
73
|
+
keytool -genkeypair -alias myAppKey -keyalg RSA -keysize 2048 \
|
|
74
|
+
-keystore myApp.p12 -storetype PKCS12 -validity 36500
|
|
75
|
+
|
|
76
|
+
# 3. Configure in build-profile.json5
|
|
77
|
+
{
|
|
78
|
+
"signingConfigs": [{
|
|
79
|
+
"name": "default",
|
|
80
|
+
"material": {
|
|
81
|
+
"storeFile": "myApp.p12",
|
|
82
|
+
"storePassword": "***",
|
|
83
|
+
"keyAlias": "myAppKey",
|
|
84
|
+
"keyPassword": "***",
|
|
85
|
+
"signAlg": "SHA256withECDSA"
|
|
86
|
+
}
|
|
87
|
+
}]
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Publishing
|
|
92
|
+
|
|
93
|
+
| Step | Description |
|
|
94
|
+
|------|-------------|
|
|
95
|
+
| 1. Register developer | developer.huawei.com (free) |
|
|
96
|
+
| 2. Create application | AppGallery Connect → My Apps |
|
|
97
|
+
| 3. Configure app info | Name, description, category, privacy policy |
|
|
98
|
+
| 4. Sign APP | DevEco Studio generates signing |
|
|
99
|
+
| 5. Build HAP/APP | DevEco Studio or hvigorw |
|
|
100
|
+
| 6. Upload to AGC | AppGallery Connect console |
|
|
101
|
+
| 7. Submit review | Typically 1–3 days |
|
|
102
|
+
|
|
103
|
+
## HarmonyOS NEXT vs HarmonyOS 3.x/4.x
|
|
104
|
+
|
|
105
|
+
| Feature | HarmonyOS NEXT (5.0) | HarmonyOS 3.x/4.x |
|
|
106
|
+
|---------|---------------------|-------------------|
|
|
107
|
+
| Android compatibility | No (pure ArkTS) | Yes (APK support) |
|
|
108
|
+
| Language | ArkTS only | Java/ArkTS |
|
|
109
|
+
| UI Framework | ArkUI | Java UI + ArkUI |
|
|
110
|
+
| Min API | 12 | 7–9 |
|
|
111
|
+
| Distribution | HAP/APP | HAP/APP + APK |
|
|
112
|
+
|
|
113
|
+
## ArkTS Quick Start
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
// pages/Index.ets
|
|
117
|
+
@Entry
|
|
118
|
+
@Component
|
|
119
|
+
struct Index {
|
|
120
|
+
@State message: string = 'Hello HarmonyOS'
|
|
121
|
+
|
|
122
|
+
build() {
|
|
123
|
+
Column() {
|
|
124
|
+
Text(this.message)
|
|
125
|
+
.fontSize(30)
|
|
126
|
+
.fontWeight(FontWeight.Bold)
|
|
127
|
+
Button('Click Me')
|
|
128
|
+
.onClick(() => {
|
|
129
|
+
this.message = 'Hello World!'
|
|
130
|
+
})
|
|
131
|
+
.margin({ top: 20 })
|
|
132
|
+
}
|
|
133
|
+
.width('100%')
|
|
134
|
+
.height('100%')
|
|
135
|
+
.justifyContent(FlexAlign.Center)
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Common Pitfalls
|
|
141
|
+
|
|
142
|
+
| Issue | Fix |
|
|
143
|
+
|-------|-----|
|
|
144
|
+
| APK not working on NEXT | HarmonyOS NEXT requires ArkTS rewrite; no Android compatibility |
|
|
145
|
+
| Signing failure | Configure signing in DevEco Studio; check certificate validity |
|
|
146
|
+
| API incompatibility | Check HarmonyOS API version in module.json5 |
|
|
147
|
+
| Emulator slow | Use Remote Device (real Huawei devices in cloud) |
|
|
148
|
+
| Build error: hvigorw not found | Set DevEco Studio SDK path; run from project root |
|
|
149
|
+
| App rejected by store | Ensure privacy policy URL; comply with Huawei review guidelines |
|
|
150
|
+
| Third-party library unavailable | Check OpenHarmony registry (ohpm.openharmony.cn) |
|