android studio platform使用体验分享(as无法跳转c/c++等native源码的福音,强烈推荐)

hi,粉丝朋友们:
大家好!这些天粉丝朋友们分享了一下Android Studio for Platform 这个最新的google开发的阅读aosp源码的工具,特别适合做原生系统开发。具体官方介绍如下地址:
参考链接:https://developer.android.google.cn/studio/platform

1、android studio for platform工具介绍

在这里插入图片描述
可以直接点击下载(提示目前只有ubuntu可以哈,其他没有,所以说跟着马哥使用ubuntu开发还是有很大优势,尝鲜方便)

看看相关的官方介绍:

Android Studio for Platform (ASfP) is the version of the Android Studio IDE for Android Open Source Project (AOSP) platform developers who build with the Soong build system. ASfP includes the following features:

language
Multi-language Support
Edit C++, Kotlin, and Java programming languages in the same IDE.
settings
Project Setup Wizard
Configure your lunch target and platform modules.

官方的介绍就以上一小段文字,总结如下:
ASfP是专门用于开发aosp的ide工具,有着 Soong build system.,主要有以下几个特点
语言支持部分:
同时支持:C++, Kotlin, and Java 同时使用在ide中编程
设置部分:
可以配置你的编译target和具体的模块

2、android studio for platform痛点解决

这里最吸引我们的还是他居然支持多语言,c++,java,kotlin同时都支持。
以前我们开发aosp时候,其实java部分使用android studio的体验还是相当好,但是android studio没办法支持c++等native代码的跳转和代码提示,所以不得不使用vscode工具,这个vscode工具相关看c++等代码也是比较方便,基本上的代码也是可以跳转的,但是毕竟有时候需要两个工具相互切快捷键等还是有一点点不方便,虽然不太影响。

所以开发aosp之前的选择就是:
java相关代码使用android studio
c++相关代码使用vscode

目前ASfP工具出现真的是我们framework开发者的一个巨大福音,解决了android studio无法跳转c++代码的这个巨大痛点。

3、android studio for platform使用体验

官方使用介绍:



Get started with ASfP

    If you haven't already installed repo, follow the instructions at Installing Repo.
    If you haven't already initialized and synced your Repo checkout, follow the instructions at Initializing a Repo client.
    Download ASfP.
    Install ASfP: sudo dpkg -i /path/to/asfp-2023.1.1.19-linux.deb.
    Open ASfP from the command line: /opt/android-studio-for-platform/bin/studio.sh.
    Import your project by pointing to your repo checkout directory, specifying a lunch target, and selecting which modules you want to build.
    Click Finish and your project will begin syncing.
    Request to join our external group for user support.


这里我们就直接自己转化把
1、下载好工具,安装好即可以(限制在ubuntu)
在这里插入图片描述
在这里插入图片描述
可以直接点击安装的

2、启动工具
在terminator下面输入如下命令:
/opt/android-studio-for-platform/bin/studio.sh
就会启动工具

3、导入需要模块
在这里插入图片描述
这里导入了Launcher和framework
在这里插入图片描述
在这里插入图片描述

同步完成就一切都好了即可以查看相关代码和跳转。

ps使用的注意点:

1、跳转framework的类时候会跳到对应jar包的class文件,不是java文件,解决如下
在这里插入图片描述

2、KeyMap如果习惯eclipse的可以切换

3、如果导入c++相关开发建议以下3个文件夹:
frameworks
system
packages

导入越多整体就慢

总结体验:

整体体验和以前android studio没有大的差别
1、不过说实话单独java部分的代码开发的话,体验还不如以前的android studio轻量,反而依赖的东西太多,对于跳转等,查找代码还没有以前方便,针对java部分的话,这个建议可以先观望等更多版本更新稳定

2、c++部分的native代码,来说简直就利器,非常好用,跳转准确,非常值的推荐

google官方教学视频教程地址:
https://www.bilibili.com/video/BV1UV411P7nf/?vd_source=a8c604ee3ce4999324264828f8fd99d8

猜你喜欢

转载自blog.csdn.net/learnframework/article/details/132845748