Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Android Permissions #1

Open
isnifer opened this issue Dec 29, 2016 · 0 comments
Open

Android Permissions #1

isnifer opened this issue Dec 29, 2016 · 0 comments

Comments

@isnifer
Copy link
Contributor

isnifer commented Dec 29, 2016

Is there any place to pass a list of necessary android permissions?

import adb from 'adbkit'

const client = adb.createClient()
export default async function addAndroidPermissions(deviceId, appId, permissions = []) {
  try {
    await Promise.all(
      permissions.map(permission => client.shell(
        deviceId,
        `pm grant ${appId} android.permission.${permission}`
      ))
    )
  } catch (error) {
    throw new Error(`Can not set android permissions: ${error}`)
  }
}
if (config.platformName === 'android') {
  setTimeout(async () => {
    await addAndroidPermissions(config.deviceName, 'com.example', ['CAMERA'])
  }, 3000)
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant