M
M
maxutovali2021-04-27 10:01:07
Python
maxutovali, 2021-04-27 10:01:07

How can I push a phone directory in the second space using ADB?

Good day everyone! I use Xiaomi Redmi Note 7/8 phone, in the first space (main) the script works well. Files are transferred without problems. But for some reason ADB does not see the second space.
How can transfer between PC and smartphone in second space using adb?

def transfer_file(self, file_path,delete=True):
        self.clear_folder(self.android_path)
        print(f'...Передаю Файл {file_path}...')
        self.transfer_file_name = file_path.split('/')[-1]
        # пушим файл через адб
        self.adb.cmd(f'push {file_path} {self.android_path}')
        print(f'...Обновляю Папку {self.android_path}...')
        # обновляем хранилище через активити менеджер, чтобы прилка увидела файл
        self.adb.cmd(f'shell am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN_FILE -d file:{self.android_path}')
        if delete == True:
            print(f'...Удаляю Файл {file_path} c PC...')
            Path(file_path).unlink()

I will be very grateful if you help)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question