0
0

android端末でテスト(アサーション)する

Posted at

今回使うassertステートメントはデフォルトでは無効になっているので、それを有効にする方法を記事にしていきます。

まずは、android端末が接続されていることを確認してください。

次にandroidStudio内のコマンドで以下を実行します。

adb shell setprop debug.assert 1 

これでアサーションを有効にできます。

また、無効にするには以下を実行します。

adb shell setprop debug.assert 0

この方法でテストを行った時、端末が接続されていないか、2つ以上の端末が接続されている場合
コマンドが失敗します。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0