Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 以编程方式使用ADB时的矛盾错误_Android_Swift_Xcode_Adb_Oculusquest - Fatal编程技术网

Android 以编程方式使用ADB时的矛盾错误

Android 以编程方式使用ADB时的矛盾错误,android,swift,xcode,adb,oculusquest,Android,Swift,Xcode,Adb,Oculusquest,当我卸载已安装的软件包,然后安装APK,然后尝试设置读写权限时,会出现这些错误。如果未安装APK,但APK安装成功,也会发生权限错误 当我硬编码包ID时,Swift中的这段代码不会出错,因此可能与XCode搞糟有关: _ = shell("-d", "uninstall", "\(self.gameID)") self.i

当我卸载已安装的软件包,然后安装APK,然后尝试设置读写权限时,会出现这些错误。如果未安装APK,但APK安装成功,也会发生权限错误

当我硬编码包ID时,Swift中的这段代码不会出错,因此可能与XCode搞糟有关:

_ = shell("-d", "uninstall", "\(self.gameID)")
                            
                            
self.installationLabel.stringValue = "Previous version uninstalled! Installing APK..."

_ = shell("-d", "install", "\(self.usernameFilePath)/Downloads/Bluebird Stuff/\(self.gameFolderName)/\(self.apkName)")
                            
self.installationLabel.stringValue = "APK installed! Setting permissions..."
_ = shell("-d", "shell", "pm", "grant", "\(self.gameID)", "android.permission.RECORD_AUDIO") 
_ = shell("-d", "shell", "pm", "grant", "\(self.gameID)", "android.permission.READ_EXTERNAL_STORAGE")