From 8d6615697b6d40538402121a4e97d0afe743257e Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 3 Apr 2020 15:07:13 +0100 Subject: [PATCH] Push settings file to android devices * This allows settings to be used to control debug logging on android as well. --- renderdoc/android/android.cpp | 7 +++++++ renderdoc/core/settings.cpp | 2 ++ 2 files changed, 9 insertions(+) diff --git a/renderdoc/android/android.cpp b/renderdoc/android/android.cpp index 9b5937ad4..f4689754b 100644 --- a/renderdoc/android/android.cpp +++ b/renderdoc/android/android.cpp @@ -1071,6 +1071,7 @@ ExecuteResult AndroidRemoteServer::ExecuteAndInject(const char *a, const char *w // if in VR mode, enable frame delimiter markers Android::adbExecCommand(m_deviceID, "shell setprop debug.vr.profiler 1"); + // create the data directory we will use for storing, in case the application doesn't // NOTE: if processName != packageName, process may not be able to write to this directory // unless @@ -1079,12 +1080,18 @@ ExecuteResult AndroidRemoteServer::ExecuteAndInject(const char *a, const char *w // has the permissions set correctly, and we don't have a convenient way to get the package name // from native code. Android::adbExecCommand(m_deviceID, "shell mkdir -p /sdcard/Android/data/" + processName); + Android::adbExecCommand(m_deviceID, + "shell mkdir -p /sdcard/Android/data/" + processName + "/files"); // set our property with the capture options encoded, to be picked up by the library on the // device Android::adbExecCommand(m_deviceID, StringFormat::Fmt("shell setprop debug.rdoc.RENDERDOC_CAPOPTS %s", opts.EncodeAsString().c_str())); + // try to push our settings file into the appdata folder + Android::adbExecCommand(m_deviceID, "push \"" + FileIO::GetAppFolderFilename("renderdoc.conf") + + "\" /sdcard/Android/data/" + processName + "/files"); + rdcstr installedPath = Android::GetPathForPackage(m_deviceID, packageName); rdcstr RDCLib = Android::adbExecCommand(m_deviceID, "shell ls " + installedPath + diff --git a/renderdoc/core/settings.cpp b/renderdoc/core/settings.cpp index c093a37c5..0030b80ed 100644 --- a/renderdoc/core/settings.cpp +++ b/renderdoc/core/settings.cpp @@ -454,6 +454,8 @@ void RenderDoc::ProcessConfig() { rdcstr confFile = FileIO::GetAppFolderFilename("renderdoc.conf"); + RDCLOG("Loading config from %s", confFile.c_str()); + SDObject *loadedConfig = NULL; { StreamReader reader(FileIO::fopen(confFile.c_str(), "rb"));