devtool是Yocto项目中的一个通用命令行工具,旨在简化软件开发、测试和打包的流程。它为开发者提供了多个功能,包括操作菜谱、修改源代码、构建软件包,以及将生成的软件集成到镜像中。虽然它可以在Yocto项目的构建环境中与BitBake结合使用,但devtool更侧重于简化本地开发和快速迭代,尤其在可扩展SDK环境中,其优势更加突出。
在可扩展SDK中,devtool是核心组件,开发者可以通过它轻松管理本地的开发任务,包括构建、测试、打包和部署软件。与Yocto项目的构建环境不同,开发者在可扩展SDK中不需要直接操作BitBake,而是通过devtool来执行大多数的构建任务。devtool提供了一个简化的高层接口,专注于本地开发和测试,而BitBake则处理底层的依赖管理和构建执行。这种方式极大地简化了开发者的工作流程,使得开发过程更加高效和直观。
devtool子命令
在开发主机上运行devtool命令之前,必须通过source命令执行环境设置脚本设置必要的环境变量:
***@ubuntu:~/poky_sdk$ source environment-setup-cortexa72-poky-linux
SDK environment now set up; additionally you may now run devtool to perform development tasks.
Run devtool --help for further details.
devtool的命令行结构与Git类似,它包含了多个子命令,每个子命令对应不同的功能。可以运行devtool --help查看所有可用命令:
jerry@ubuntu:~/poky_sdk$ devtool --help
NOTE: Starting bitbake server...
usage: devtool [--basepath BASEPATH] [--bbpath BBPATH] [-d] [-q] [--color COLOR] [-h] <subcommand> ...
OpenEmbedded development tool
options:
--basepath BASEPATH Base directory of SDK / build directory
--bbpath BBPATH Explicitly specify the BBPATH, rather than getting it from the metadata
-d, --debug Enable debug output
-q, --quiet Print only errors
--color COLOR Colorize output (where COLOR is auto, always, never)
-h, --help show this help message and exit
subcommands:
Beginning work on a recipe:
add Add a new recipe
modify Modify the source for an existing recipe
upgrade Upgrade an existing recipe
Getting information:
status Show workspace status
search Search available recipes
latest-version Report the latest version of an existing recipe
check-upgrade-status Report upgradability for multiple (or all) recipes
Working on a recipe in the workspace:
build Build a recipe
ide-sdk Setup the SDK and configure the