現在のAndroidパッケージの名前を取得します。

使用法

                    .appium.getCurrentPackage([callback])
                

module.exports = {
  'get current package name': function (app) {
    app
      .appium.getCurrentPackage(function (result) {
        console.log('current android package is:', result.value);
      });
  },

  'get current package name with ES6 async/await': async function (app) {
    const packageName = await app.appium.getCurrentPackage();
    console.log('current android package is:', packageName);
  }
};

パラメータ

名前 説明
callback
オプション
function

結果の値で呼び出されるコールバック関数。

戻り値

説明
string

現在のパッケージの名前。

関連項目