有时您想在 AndroidX 存储库中运行示例,对吗? (没有?)

我想我会记下暂时不起作用的部分,然后在再次创建环境时使用它们。
基本程序是3个步骤

    安装
  1. 存储库
  2. 初始化和同步
  3. 启动 Android Studio

    基本上这个程序工作正常。

    1.安装回购

    repo 是一个以很好的方式管理多个 git 存储库的命令。 (认出)
    请按照此处编写的步骤进行操作。
    https://android.googlesource.com/platform//frameworks/support/+/refs/heads/androidx-main/docs/onboarding.md#setup-linux-mac
    (我认为可以只使用 git clone https://android.googlesource.com/platform//frameworks/support 而不进行 repo 同步,但我认为同步会更容易,因为引用各种路径会很麻烦。)

    我需要使 repo 与 python3 一起工作,
    如果您正在为鱼制作贝壳,则以下内容可以正常工作。

    ~/.config/fish/config.fish
    function repo
      command python3 ~/bin/repo $argv
    end
    

    2.初始化和同步

    以下程序在入职,但我认为可能只有 Googler 工作得很好,但是(如果有工作方法,请告诉我)

    mkdir androidx-main && cd androidx-main
    repo init -u sso://android/platform/manifest 
        -b androidx-main --partial-clone --clone-filter=blob:limit=10M
    repo sync -c -j8
    

    当我按如下方式指定 https URL 时,它工作正常。

    repo init -u https://android.googlesource.com/platform/manifest 
         -b androidx-main --partial-clone --clone-filter=blob:limit=10M
    repo sync -c -j8
    

    3. 启动 Android Studio

    正常启动 Android Studio 并导入。 .去做不是.
    框架/支持中的 studiow移动(如果你不这样做,他们会生气)
    然后会询问你要导入哪个并启动Android Studio,如下所示。

    ./studiow 
    Project subset is required
    Usage: studiow [--clear-caches] [--clean] [--reinstall] [--profile] <project subset>
    
    OPTIONS
    
     --clear-caches
       Clear generated caches (but not user settings) before launching
    
     --clean
       Clear (with backup) generated files (settings, caches, etc) before launching
       Also implies --clear-caches
    
     --reinstall
       Remove and re-download Studio itself. Also implies --clean
    
     --profile
       Enables profiling of Studio
    
    Project subsets:
     m, main
      Open the project subset main: non-Compose Jetpack libraries
    
     c, compose
      Open the project subset compose
    
     ca, camera
      Open the project subset camera
    
     f, flan
      Open the project subset flan: Fragment, Lifecycle, Activity, and Navigation
    
     media
      Open the project subset media: Media, Media2, and MediaRouter
    
     kmp
      Open the project subset KMP: Projects that have KMP builds
    
     w, wear
      Open the project subset for Wear OS libraries
    
     g, glance
      Open the project subset for glance projects
    
    
     native
      Open the project subset for native projects
    
     a, all
      Open the project subset all
    

    例如,如果您想查看 Compose,您可以使用 ./studiow c 启动它。

    您所要做的就是运行您想要在 Android Studio 中运行的演示或测试。

    AOSPのAndroidX開発環境メモ


原创声明:本文系作者授权爱码网发表,未经许可,不得转载;

原文地址:https://www.likecs.com/show-308629826.html

相关文章: