hdc(HarmonyOS Device
Connector)是HarmonyOS为开发人员提供的用于调试的命令行工具,通过该工具可以在window/linux/mac系统上与真实设备或者模拟器进行交互。
(1)
hdc list targets
(2)
hdc file send local remote
(3)
hdc install package File
这里列举的几个命令是不是很熟悉?一看名字就知道和安卓中的adb是对应关系。不需要去记忆,在需要使用到的时候去官网查一下就行: hdc使用指导
2、Mac系统配置hdc 环境变量
3、项目中的配置文件
安卓中最主要的配置文件是AndroidManifest.xml。 其中定义了版本号,申明了页面路径,注册了广播和服务。并且申明了App使用的权限。
而鸿蒙中也对应有配置文件,但与安卓稍有不同的是鸿蒙分为多个文件。
(1) build-profile.json5
Sdk Version配置在这里, 代码的模块区分也在这里:
{ "app": { "signingConfigs": [], "compileSdkVersion": 9, "compatibleSdkVersion": 9, "products": [ { "name": "default", "signingConfig": "default", } ], "buildModeSet": [ { "name": "debug", }, { "name": "release" } ] }, "modules": [ { "name": "entry", "srcPath": "./entry", "targets": [ { "name": "default", "applyToProducts": [ "default" ] } ] } ] }
(2)app.json5
包名,VersionCode,VersionName等信息
{ "app": { "bundleName": "com.example.firstDemo", "vendor": "example", "versionCode": 1000000, "versionName": "1.0.0", "icon": "$media:app_icon", "label": "$string:app_name" } }
(3)module.json5
模块的详细配置,页面名称和模块使用到的权限在这里申明
{ "module": { "name": "entry", "type": "entry", "description": "$string:module_desc", "mainElement": "EntryAbility", "deviceTypes": [ "phone", "tablet" ], "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", "abilities": [ { "name": "EntryAbility", "srcEntry": "./ets/entryability/EntryAbility.ts", "description": "$string:EntryAbility_desc", "icon": "$media:icon", "label": "$string:EntryAbility_label", "startWindowIcon": "$media:startIcon", "startWindowBackground": "$color:start_window_background", "exported": true, "skills": [ { "entities": [ "entity.system.home" ], "actions": [ "action.system.home" ] } ] } ], "requestPermissions":[ { "name" : "ohos.permission.APPROXIMATELY_LOCATION", "reason": "$string:reason", "usedScene": { "abilities": [ "FormAbility" ], "when":"inuse" } } ] } }
4、对应安卓的权限管理
鸿蒙有ATM,ATM(AccessTokenManager)是HarmonyOS上基于AccesssToken构建的统一的应用权限管理能力
5、对应安卓的SharedPreferences能力,鸿蒙有首选项能力
审核编辑 黄宇
-
hdc
+关注
关注
1文章
44浏览量
3676 -
鸿蒙
+关注
关注
57文章
2410浏览量
43291 -
HarmonyOS
+关注
关注
79文章
1987浏览量
31068
发布评论请先 登录
相关推荐
华邦电子安全闪存关键知识点
Docker-镜像的分层-busybox镜像制作

Aigtek功率放大器应用:电感线圈的知识点分享

后悔没有早点看到:天线设计中的知识点!

鸿蒙开发就业前景到底怎么样?
36岁了还有必要转行鸿蒙开发吗?
鸿蒙实战开发-本地部署、SmartPerf 编译部署指导文档
学鸿蒙的1万个理由,北京中关村现大幅鸿蒙海报
HarmonyOS实战开发-如何通过BlendMode属性来实现挂件和图片的混合
实锤!腾讯终于拥抱鸿蒙生态,微信鸿蒙原生版本即将上线
腾讯突然宣布,微信鸿蒙版要来了!
鸿蒙OS崛起,鸿蒙应用开发工程师成市场新宠
一篇搞定DCS系统相关知识点

评论