Skip to content

Latest commit

 

History

History
242 lines (175 loc) · 7.41 KB

README_環境構築.md

File metadata and controls

242 lines (175 loc) · 7.41 KB

開発環境

実行環境要件

項目 内容
CPU Intel Virtualization Technology(VT、VT-x、vmx)
または
AMD Virtualization(AMD-V、SVM)
拡張機能搭載CPU
SSD/HDD空き容量 40GB以上
MEMORY 8GB以上
Androidスマホ Android8.0以上

ベース環境セットアップ

Microsoftアプリストア(アプリインストーラー)より、アプリインストーラーの導入(更新)を行います。

Windowsターミナルを管理者モードで起動する。
PowerShellがコンソールに表示されていることを確認します。
Windows 10 の方は、コマンドプロンプトを管理者モードで起動。

winget source update
winget install Microsoft.PowerShell --scope machine
winget install Microsoft.WindowsTerminal
winget install Google.Chrome --scope machine
winget install -q vscode --scope machine

Windows 10の方は、コマンドプロンプトを終了し、Windowsターミナルを管理者モードで起動します。

Set-ExecutionPolicy Bypass `
  -Scope Process `
  -Force; [System.Net.ServicePointManager]::SecurityProtocol = `
    [System.Net.ServicePointManager]::SecurityProtocol `
  -bor 3072; `
  iex ((New-Object System.Net.WebClient).DownloadString(`
    'https://chocolatey.org/install.ps1'`
  ))
choco install font-hackgen-nerd

ここでマシン再起動を行います。(下記コマンド)

shutdown /r /t 0

Windowsターミナル設定

Windowsターミナルを起動し、設定画面を開きます。

fig1

規定のプロファイルを黒背景アイコンのPowerShellに設定し、保存ボタンを押す。

Windows Terminal Font設定

設定メニューより、JSONファイルを開くを選択します。

fig1

{
    "profiles": 
    {
        "defaults": {
            "font": {
                "face": "HackGen Console NF"
            }
        },
    }
}

profiles - defaults - font オブジェクトを追記します。

winget install Git.Git --scope machine
winget install JanDeDobbeleer.OhMyPosh -s winget --scope machine
code $PROFILE

VisualStudio Codeが起動されます。 その際に、次のPlug-inを導入しても良い。

  • PowerShell
  • Japanese Language Pack for Visual Studio Code

下記ファイル(Microsoft.PowerShell_profile.ps1)を保存する。

oh-my-posh init pwsh `
  --config "$env:POSH_THEMES_PATH\quick-term.omp.json" `
  | Invoke-Expression

このようなPowerShellが起動できるようになりました。  

fig1

Android Studio

Set-ExecutionPolicy RemoteSigned -scope CurrentUser
iwr -useb get.scoop.sh | iex
scoop bucket add extras
scoop bucket add java 
scoop install temurin8-jdk
scoop install dart
scoop install android-sdk
scoop install flutter
flutter doctor --android-licenses
winget install Google.AndroidStudio --scope machine

Android Studioを起動する。

Plugins 追加

  • Dart
  • Flutter

Android SDK 追加

新規 Flutter projectを開きその状態から導入を行なってください。

  • Android Tiramisu (Tiramisu)

    fig1

  • NDK, Cmake

    fig1

Visual Studio 追加

https://visualstudio.microsoft.com/ja/downloads/ よりコミュニティバージョンのインストーラーをダウンロード
ダウンロードしたVisualStudioSetup.exeを実行する。
下記のワークロードを選択する。

  • C++によるデスクトップ開発

開発環境検証

powershellより flutter doctor -vを実行する。

$ flutter doctor -v
[✓] Flutter (Channel stable, 3.3.2, on Microsoft Windows [Version 10.0.22000.978], locale ja-JP)
    • Flutter version 3.3.2 on channel stable at C:\Users\takahashi\scoop\apps\flutter\current
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision e3c29ec00c (4 days ago), 2022-09-14 08:46:55 -0500
    • Engine revision a4ff2c53d8
    • Dart version 2.18.1
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at C:\Users\takahashi\scoop\apps\android-sdk\current
    • Platform android-33, build-tools 33.0.0
    • ANDROID_HOME = C:\Users\takahashi\scoop\apps\android-sdk\current
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.4)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.3.32901.215
    • Windows 10 SDK version 10.0.19041.0

[✓] Android Studio (version 2021.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] VS Code, 64-bit edition (version 1.71.2)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22000.978]
    • Chrome (web)      • chrome  • web-javascript • unknown
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 105.0.1343.42

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

このように、No issues found!が表示されれば問題なし。
Warning/Error が発生した場合、画面表示に従ってください。

サンプルアプリ作成

  • Android Studio起動

  • New Flutter Projet 選択

    fig1

    key val
    Flutter SDK path C:¥Users¥xxxx¥scoop¥apps¥flutter¥current
  • Flutter

    fig1

    key val
    Project name firstapp
    Platform Android

サンプルソースが作成されます。
fig1

Androidスマホの接続・デバッグ

  • 設定 - デバイス情報 を表示する。
  • ビルド番号 を7回連続でタップする。
  • 設定 - システム - 開発者向けオプション を表示する。
    key val
    開発者向けオプションの使用 オン
    USBデバッグ オン

上記設定ののち、USB-CケーブルをPCに接続する。

fig1

ケーブル接続後、ツールバーに接続したAndroid機種名がエントリーされる。
その状態で、デバッグボタンを押す。(バグアイコン)

fig1

アプリが自動的に起動されます。