From that code line:
process = frida.get_usb_device(1).attach('com.android.settings')
I got the following error:
raise _frida.ProcessNotFoundError("unable to find process with name '%s'" % process_name) frida.ProcessNotFoundError: unable to find process with name 'com.android.settings'*
Although com.android.settings is listed with frida-ps -aU command, it says unable to find process.