Android Studio for Platform (ASfP) 使用教程

2023-10-12 15:21

本文主要是介绍Android Studio for Platform (ASfP) 使用教程,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

文章目录

      • 编写脚本
      • 下载源代码
      • lunch 查看版本

在这里插入图片描述
归纳的很清楚,下载Repo并下载源码->可以参考我的 Framework入门のPiex 6P源码(下载/编译/刷机)

启动图标(重启生效)

[Desktop Entry]
Encoding=UTF-8
Name=AndroidStudio                                     
Comment=AndroidStudio                                  
Exec=/opt/android-studio-for-platform/bin/studio.sh
Icon=/opt/android-studio-for-platform/bin/studio.png
Terminal=false
StartupNotify=true
Type=Application
Categories=Application;Development;

OR
/opt/android-studio-for-platform/bin/studio.sh

编写脚本

#!/usr/bin/env bashexport LOG_ACCOUNT=tmp
export LOG_FILENAME=repo-sync
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'aosp_branch=android-11.0.0_r9if [ ! -d ".repo" ]; thenrepo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b $aosp_branchrepo_stat=$?if [ $repo_stat -ne 0 ]; thenecho "init repo faild, please try again"exit 0fi
elselog -o -- "local .repo dir exists"
fitry_count=0
echo "from remote sync aosp"repo sync
repo_stat=$?
while [ $repo_stat -ne 0 ]; dolog -o -- "sync faild, status: $repo_stat, try again in 5s ..."sleep 5repo syncrepo_stat=$?((try_count++))
doneecho "sync repo over, try_count: $try_count"
echo "sync over, success"

下载源代码

在这里插入图片描述

lunch 查看版本

Lunch menu... pick a combo:1. aosp_arm-eng2. aosp_arm64-eng3. aosp_blueline-userdebug4. aosp_blueline_car-userdebug5. aosp_bonito-userdebug6. aosp_bonito_car-userdebug7. aosp_bramble-userdebug8. aosp_car_arm-userdebug9. aosp_car_arm64-userdebug10. aosp_car_x86-userdebug11. aosp_car_x86_64-userdebug12. aosp_cf_arm64_auto-userdebug13. aosp_cf_arm64_phone-userdebug14. aosp_cf_x86_64_phone-userdebug15. aosp_cf_x86_auto-userdebug16. aosp_cf_x86_phone-userdebug17. aosp_cf_x86_tv-userdebug18. aosp_coral-userdebug19. aosp_coral_car-userdebug20. aosp_crosshatch-userdebug21. aosp_crosshatch_car-userdebug22. aosp_flame-userdebug23. aosp_flame_car-userdebug24. aosp_redfin-userdebug25. aosp_sargo-userdebug26. aosp_sunfish-userdebug27. aosp_taimen-userdebug28. aosp_trout_arm64-userdebug29. aosp_trout_x86-userdebug30. aosp_walleye-userdebug31. aosp_walleye_test-userdebug32. aosp_x86-eng33. aosp_x86_64-eng34. arm_krait-eng35. arm_v7_v8-eng36. armv8-eng37. armv8_kryo385-eng38. beagle_x15-userdebug39. beagle_x15_auto-userdebug40. car_x86_64-userdebug41. db845c-userdebug42. fuchsia_arm64-eng43. fuchsia_x86_64-eng44. hikey-userdebug45. hikey64_only-userdebug46. hikey960-userdebug47. hikey960_tv-userdebug48. hikey_tv-userdebug49. pixel3_mainline-userdebug50. poplar-eng51. poplar-user52. poplar-userdebug53. qemu_trusty_arm64-userdebug54. silvermont-eng55. uml-userdebug56. yukawa-userdebug57. yukawa_sei510-userdebug

lunch product_name-build_variant
product_name作为需要构建的产品
build_variant 作为需要构建的变体

PS:安卓官网这步给出的 lunch aosp_arm-eng在实际编译完成后是无法正常运行的,这个是很大的,很多人都是在这一步卡住了很久
真正能在模拟器上运行的是 lunch sdk_phone_x86_64
在这里插入图片描述
在这里插入图片描述
开始编译

Syncing targets: [frameworks, packages/apps/Settings]Preparing for sync...
Updating MAX_ARG_STRLEN to 131072Generating Soong artifacts...
/bin/bash -c "source build/envsetup.sh && lunch sdk_phone_x86_64 && echo ANDROID_PRODUCT_OUT=$ANDROID_PRODUCT_OUT && refreshmod"Refreshing modules (building module-info.json). Log at /data/android-11.0.0_r9/out/target/product/generic_x86_64/module-info.json.build.log.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=11
TARGET_PRODUCT=sdk_phone_x86_64
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=x86_64
TARGET_ARCH_VARIANT=x86_64
TARGET_2ND_ARCH=x86
TARGET_2ND_ARCH_VARIANT=x86_64
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.15.0-86-generic-x86_64-Ubuntu-20.04.4-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=RD1A.200810.020.A1
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/generic/goldfish device/generic/goldfish-opengl hardware/google/camera hardware/google/camera/devices/EmulatedCamera device/generic/goldfish device/generic/goldfish-opengl
============================================
ANDROID_PRODUCT_OUT=/data/android-11.0.0_r9/out/target/product/generic_x86_64

编译成功
在这里插入图片描述
IDE占用内存高达8G
在这里插入图片描述

虚拟机设置
在这里插入图片描述
在这里插入图片描述

https://developer.android.com/studio/platform?hl=zh-cn
https://adtxl.com/index.php/archives/85.html
https://blog.csdn.net/u011897062/article/details/133065217

这篇关于Android Studio for Platform (ASfP) 使用教程的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/196729

相关文章

如何使用C#串口通讯实现数据的发送和接收

《如何使用C#串口通讯实现数据的发送和接收》本文详细介绍了如何使用C#实现基于串口通讯的数据发送和接收,通过SerialPort类,我们可以轻松实现串口通讯,并结合事件机制实现数据的传递和处理,感兴趣... 目录1. 概述2. 关键技术点2.1 SerialPort类2.2 异步接收数据2.3 数据解析2.

详解如何使用Python提取视频文件中的音频

《详解如何使用Python提取视频文件中的音频》在多媒体处理中,有时我们需要从视频文件中提取音频,本文为大家整理了几种使用Python编程语言提取视频文件中的音频的方法,大家可以根据需要进行选择... 目录引言代码部分方法扩展引言在多媒体处理中,有时我们需要从视频文件中提取音频,以便进一步处理或分析。本文

使用Dify访问mysql数据库详细代码示例

《使用Dify访问mysql数据库详细代码示例》:本文主要介绍使用Dify访问mysql数据库的相关资料,并详细讲解了如何在本地搭建数据库访问服务,使用ngrok暴露到公网,并创建知识库、数据库访... 1、在本地搭建数据库访问的服务,并使用ngrok暴露到公网。#sql_tools.pyfrom

使用mvn deploy命令上传jar包的实现

《使用mvndeploy命令上传jar包的实现》本文介绍了使用mvndeploy:deploy-file命令将本地仓库中的JAR包重新发布到Maven私服,文中通过示例代码介绍的非常详细,对大家的学... 目录一、背景二、环境三、配置nexus上传账号四、执行deploy命令上传包1. 首先需要把本地仓中要

Spring Cloud之注册中心Nacos的使用详解

《SpringCloud之注册中心Nacos的使用详解》本文介绍SpringCloudAlibaba中的Nacos组件,对比了Nacos与Eureka的区别,展示了如何在项目中引入SpringClo... 目录Naacos服务注册/服务发现引⼊Spring Cloud Alibaba依赖引入Naco编程s依

Java springBoot初步使用websocket的代码示例

《JavaspringBoot初步使用websocket的代码示例》:本文主要介绍JavaspringBoot初步使用websocket的相关资料,WebSocket是一种实现实时双向通信的协... 目录一、什么是websocket二、依赖坐标地址1.springBoot父级依赖2.springBoot依赖

Java使用Mail构建邮件功能的完整指南

《Java使用Mail构建邮件功能的完整指南》JavaMailAPI是一个功能强大的工具,它可以帮助开发者轻松实现邮件的发送与接收功能,本文将介绍如何使用JavaMail发送和接收邮件,希望对大家有所... 目录1、简述2、主要特点3、发送样例3.1 发送纯文本邮件3.2 发送 html 邮件3.3 发送带

Android WebView无法加载H5页面的常见问题和解决方法

《AndroidWebView无法加载H5页面的常见问题和解决方法》AndroidWebView是一种视图组件,使得Android应用能够显示网页内容,它基于Chromium,具备现代浏览器的许多功... 目录1. WebView 简介2. 常见问题3. 网络权限设置4. 启用 JavaScript5. D

使用DeepSeek搭建个人知识库(在笔记本电脑上)

《使用DeepSeek搭建个人知识库(在笔记本电脑上)》本文介绍了如何在笔记本电脑上使用DeepSeek和开源工具搭建个人知识库,通过安装DeepSeek和RAGFlow,并使用CherryStudi... 目录部署环境软件清单安装DeepSeek安装Cherry Studio安装RAGFlow设置知识库总

Linux搭建Mysql主从同步的教程

《Linux搭建Mysql主从同步的教程》:本文主要介绍Linux搭建Mysql主从同步的教程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录linux搭建mysql主从同步1.启动mysql服务2.修改Mysql主库配置文件/etc/my.cnf3.重启主库my