adb restart-server

ヘルプを見てみます。


❯ adb help

...

internal debugging:
 start-server             ensure that there is a server running
 kill-server              kill the server if it is running
 reconnect                kick connection from host side to force reconnect
 reconnect device         kick connection from device side to force reconnect
 reconnect offline        reset offline/unauthorized devices to force reconnect

...

restart-server が欲しいですよね。

.bash_profile とか .zshrc とかに書いておくと便利です。


alias adb='function _adb(){
  if [ $1 = "restart-server" ]; then
    adb kill-server && adb start-server;
  else adb "$@";
  fi;
};_adb'


❯ adb restart-server
* daemon not running; starting now at tcp:5037
* daemon started successfully

既存のコマンドにオプションを追加したい場合に、このような alias 記述は使えます。

👉 How to restart ADB manually from Android Studio - Stack Overflow hatena-bookmark

 

■ しかし実は、

今どきの AndroidStudio は、自動で adb start-server される。

以下がデフォルト。

なので、


adb kill-server

だけで、そのあと自動的に起動される。




【AndroidStudio】プラグイン Rainbow Brackets が括弧だけでなく 変数 まで色が付くようになる【IDEA】

ネストする括弧を分かりやすく色分けしてくれるプラグイン「Rainbow Brackets」。

👉 IntelliJ IDEA プラグイン「Rainbow Brackets」を使う hatena-bookmark

ついに、変数 (variables) まで色分けしてくれるようになっております。

これが、

こうなる。

少しうざい、括弧だけでいい、という方は、詳細設定できます。

👉 Incompatibility with Semantic highlighting · Issue #2563 · izhangzhihao/intellij-rainbow-brackets hatena-bookmark


【IDEA】Python Code Style インデントをスペース2 に設定する

Editor の反応を スペース2 仕様にする。


Setting

  ↓

Editor

  ↓

Code Style

  ↓

Python

Tabs and Indents のタブから 4 → 2, 8 → 4 に変更。

【IDEA】Python Code Style インデントをスペース2 に設定する

IDEA の 文法チェック周りを調整する。


Setting

  ↓

Editor

  ↓

Inspections

  ↓

PEP8 coding style Violations

Options Ignore errorE111, E114 を追加する。

【IDEA】Python Code Style インデントをスペース2 に設定する


E111 indentation is not a multiple of four

E114 indentation is not a multiple of four (comment)

👉 Introduction — pycodestyle 2.7.0 documentation hatena-bookmark
👉 【Pythonコーディング規約】PEP 8 vs Google Style - Qiita hatena-bookmark
👉 styleguide | Style guides for Google-originated open-source projects hatena-bookmark

まあ、しかし、スペース 4 のほうが今はまだ主流ですよな。

👉 path:**/setup.cfg flake8 ignore - Code search results · GitHub hatena-bookmark
👉 Flake8: Your Tool For Style Guide Enforcement — flake8 6.0.0 documentation hatena-bookmark