run_perf_tests.py
def enable_storage_permission(sdk_path, device_id, dest_dir, package_name):
    """Enable the WRITE_EXTERNAL_STORAGE permission on the specified and
    installed Android app.
    """

    print 'Starting storage permission grant'
    perm_command = [os.path.join(sdk_path, 'platform-tools',
                                 'adb'),
                    '-s', device_id,
                    'shell',
                    'pm', 'grant', package_name,
                    'android.permission.WRITE_EXTERNAL_STORAGE']
    log_file_path = os.path.join(dest_dir, 'logs', 'enable_storage_perm.log')
    with open(log_file_path, 'w') as log_file:
        try:
            subprocess.call(perm_command,
                            stdout=log_file,
                            stderr=subprocess.STDOUT,
                            shell=False)
        except OSError:
            print 'ERROR executing permission grant.'
Enable the WRITE_EXTERNAL_STORAGE permission on the specified and
    installed Android app.
    
Enable the WRITE_EXTERNAL_STORAGE permission on the specified and
installed Android app.
Enable the WRITE_EXTERNAL_STORAGE permission on the specified and installed Android app .
def enable_storage_permission(sdk_path, device_id, dest_dir, package_name):
    print 'Starting storage permission grant'
    perm_command = [os.path.join(sdk_path, 'platform-tools',
                                 'adb'),
                    '-s', device_id,
                    'shell',
                    'pm', 'grant', package_name,
                    'android.permission.WRITE_EXTERNAL_STORAGE']
    log_file_path = os.path.join(dest_dir, 'logs', 'enable_storage_perm.log')
    with open(log_file_path, 'w') as log_file:
        try:
            subprocess.call(perm_command,
                            stdout=log_file,
                            stderr=subprocess.STDOUT,
                            shell=False)
        except OSError:
            print 'ERROR executing permission grant.'
def enable_storage_permission ( sdk_path , device_id , dest_dir , package_name ) : print 'Starting storage permission grant' perm_command = [ os . path . join ( sdk_path , 'platform-tools' , 'adb' ) , '-s' , device_id , 'shell' , 'pm' , 'grant' , package_name , 'android.permission.WRITE_EXTERNAL_STORAGE' ] log_file_path = os . path . join ( dest_dir , 'logs' , 'enable_storage_perm.log' ) with open ( log_file_path , 'w' ) as log_file : try : subprocess . call ( perm_command , stdout = log_file , stderr = subprocess . STDOUT , shell = False ) except OSError : print 'ERROR executing permission grant.'
Enable the WRITE_EXTERNAL_STORAGE permission on the specified and
installed Android app.
Enable the WRITE_EXTERNAL_STORAGE permission on the specified and installed Android app .
"""Enable the WRITE_EXTERNAL_STORAGE permission on the specified and
    installed Android app.
    """
sdk_path
device_id
dest_dir
package_name