From afa239e5157cbca195afff34e74c78f566ba3a07 Mon Sep 17 00:00:00 2001 From: Alex Sink Date: Sat, 30 Oct 2021 18:37:58 -0700 Subject: [PATCH 01/12] add permisions for sd card --- Assets/Plugins/Android/AndroidManifest.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Assets/Plugins/Android/AndroidManifest.xml b/Assets/Plugins/Android/AndroidManifest.xml index abfea16..41cca2d 100644 --- a/Assets/Plugins/Android/AndroidManifest.xml +++ b/Assets/Plugins/Android/AndroidManifest.xml @@ -20,7 +20,15 @@ + + + + From 5cefc7ddc8a06ea5bed87fba31c161bd2308270c Mon Sep 17 00:00:00 2001 From: Alex Sink Date: Sat, 30 Oct 2021 18:38:21 -0700 Subject: [PATCH 02/12] modify the sample init to request permissions for sd card and write/read --- Assets/SampleInit.cs | 76 +++++++++++++++++++++++++++++++++----------- 1 file changed, 58 insertions(+), 18 deletions(-) diff --git a/Assets/SampleInit.cs b/Assets/SampleInit.cs index 8b2c119..a1d22bd 100644 --- a/Assets/SampleInit.cs +++ b/Assets/SampleInit.cs @@ -1,32 +1,72 @@ -using System.Collections; +using System; +using System.Collections; using System.Collections.Generic; +using System.IO; using UnityEngine; +using UnityEngine.Experimental.XR.Interaction; using UnityEngine.XR.Management; +using Wave.Essence; public class SampleInit : MonoBehaviour { - IEnumerator Start() + IEnumerator WaitOnPermissions(PermissionManager pmInstance,string[] permissions) { - while (XRGeneralSettings.Instance == null ) - { - Debug.Log($"Waiting on XRGeneralSettings.Instance frame {Time.frameCount}"); - yield return null; - } - while ( XRGeneralSettings.Instance.Manager == null) + bool gotPermissions = false; + for(int i=0;i<1000;i++) { - Debug.Log($"Waiting on XRGeneralSettings.Instance.Manager frame {Time.frameCount}"); - yield return null; + (bool finished, bool success) = (false,true); + + pmInstance.requestPermissions(permissions,results => { + foreach (var result in results) + { + Debug.Log($"Request for {result.PermissionName} granted result:{result.Granted}"); + if (result.Granted == false) + { + success = false; + } + } + finished = true; + }); + Debug.Log("waiting for permissions"); + while (finished == false) + { + yield return null; + } + Debug.Log($"finished waiting for permissions was it successful {success}"); + if (success) + { + gotPermissions = true; + break; + } + Debug.Log($"Retrying {i}"); + yield return new WaitForSeconds(.3f); } - yield return XRGeneralSettings.Instance.Manager.InitializeLoader(); - - while (!XRGeneralSettings.Instance.Manager.isInitializationComplete) + Debug.Log($"Permissions got ret"); + if (!gotPermissions) { - Debug.Log($"Waiting on XRGeneralSettings.Instance.Manager.isInitializationComplete frame {Time.frameCount}"); - yield return null; + Debug.LogError("Didn't get permissions. womp womp"); } - Debug.Log($"about to call XRGeneralSettings.Instance.Manager.StartSubsystems frame {Time.frameCount}"); - XRGeneralSettings.Instance.Manager.StartSubsystems(); - Debug.Log($"done calling XRGeneralSettings.Instance.Manager.StartSubsystems frame {Time.frameCount}"); } + IEnumerator Start() + { + Debug.Log($"Start asink"); + var pmInstance = Wave.Essence.PermissionManager.instance; + Debug.Log("waiting for permission manager"); + while (!pmInstance.isInitialized()) + yield return null; + Debug.Log("finished waiting for permission manager"); + //,"vive.wave.vr.oem.data.OEMDataWrite" <- no popup and never gets granted + var permissions = new[] {"android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE","vive.wave.vr.oem.data.OEMDataRead"}; + + + yield return WaitOnPermissions(pmInstance, permissions); + Debug.Log("About to write"); + var msg = $"contents wooo {DateTime.Now.ToString()} and temp cache path {Application.temporaryCachePath} and persistent {Application.persistentDataPath}"; + var filePath = $"/mnt/sdcard/Android/data/{Application.identifier}/files/testingfoo"; + File.WriteAllText(filePath,msg); + Debug.Log($"Wrote message"); + Debug.Log($"Value of message is {File.ReadAllText(filePath)}"); + Debug.Log($"About to print external files dirs"); + } } From ffc27334fea77c49e6a073a1eadc2ed384a92aff Mon Sep 17 00:00:00 2001 From: Alex Sink Date: Sat, 30 Oct 2021 18:38:32 -0700 Subject: [PATCH 03/12] init on start again --- Assets/XR/XRGeneralSettings.asset | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/XR/XRGeneralSettings.asset b/Assets/XR/XRGeneralSettings.asset index 8737014..b61d58b 100644 --- a/Assets/XR/XRGeneralSettings.asset +++ b/Assets/XR/XRGeneralSettings.asset @@ -13,7 +13,7 @@ MonoBehaviour: m_Name: Android Settings m_EditorClassIdentifier: m_LoaderManagerInstance: {fileID: 2818534104002779466} - m_InitManagerOnStart: 0 + m_InitManagerOnStart: 1 --- !u!114 &-724371777062100322 MonoBehaviour: m_ObjectHideFlags: 0 From c575aa45d5920baf9eb91628b801e10530bc263b Mon Sep 17 00:00:00 2001 From: Alex Sink Date: Tue, 9 Nov 2021 14:10:25 -0800 Subject: [PATCH 04/12] try some additional permissions --- Assets/Plugins/Android/AndroidManifest.xml | 11 ++--- Assets/SampleInit.cs | 52 +++++++++++++++++++--- 2 files changed, 53 insertions(+), 10 deletions(-) diff --git a/Assets/Plugins/Android/AndroidManifest.xml b/Assets/Plugins/Android/AndroidManifest.xml index 41cca2d..62eeeea 100644 --- a/Assets/Plugins/Android/AndroidManifest.xml +++ b/Assets/Plugins/Android/AndroidManifest.xml @@ -24,11 +24,12 @@ android:name="android.permission.READ_EXTERNAL_STORAGE" /> - - - + + + + + + diff --git a/Assets/SampleInit.cs b/Assets/SampleInit.cs index a1d22bd..9ad56b6 100644 --- a/Assets/SampleInit.cs +++ b/Assets/SampleInit.cs @@ -9,10 +9,10 @@ public class SampleInit : MonoBehaviour { - IEnumerator WaitOnPermissions(PermissionManager pmInstance,string[] permissions) + IEnumerator WaitOnPermissions(PermissionManager pmInstance,string[] permissions,int maxRequestCount=1000) { bool gotPermissions = false; - for(int i=0;i<1000;i++) + for(int i=0;i + + + */ IEnumerator Start() { Debug.Log($"Start asink"); @@ -59,13 +65,49 @@ IEnumerator Start() //,"vive.wave.vr.oem.data.OEMDataWrite" <- no popup and never gets granted var permissions = new[] {"android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE","vive.wave.vr.oem.data.OEMDataRead"}; - yield return WaitOnPermissions(pmInstance, permissions); + Debug.Log("Got known good permissions"); + + yield return WaitOnPermissions(pmInstance, new[] + { + "com.htc.vr.core.server.VRDataRead" + /*, + "com.htc.vr.core.server.VRDataWrite", //doesn't return true ever + "com.htc.vr.core.server.VRDataProvider" //doesn't return true ever + */ + },100); + Debug.Log("About to write"); + + //var filePath = $"/mnt/sdcard/Android/data/{Application.identifier}/files/testingfoo"; + try + { + var filePath = $"/storage/ext_sd/Android/data/{Application.identifier}/files/testingfoo"; //should work + testWriteReadAtPath(filePath); + } + catch (Exception e) + { + Debug.LogException(e); + } + try + { + + var filePath = $"/storage/ext_sd/testingbar"; //should work + testWriteReadAtPath(filePath); + } + catch (Exception e) + { + Debug.LogException(e); + } + } + + void testWriteReadAtPath(string filePath) + { var msg = $"contents wooo {DateTime.Now.ToString()} and temp cache path {Application.temporaryCachePath} and persistent {Application.persistentDataPath}"; - var filePath = $"/mnt/sdcard/Android/data/{Application.identifier}/files/testingfoo"; + Debug.Log($"About to write to {filePath}"); + File.WriteAllText(filePath,msg); - Debug.Log($"Wrote message"); + Debug.Log($"Wrote message to {filePath}"); Debug.Log($"Value of message is {File.ReadAllText(filePath)}"); Debug.Log($"About to print external files dirs"); } From ed49650282a498cc654d0859027b7d97c2b43456 Mon Sep 17 00:00:00 2001 From: Alex Sink Date: Tue, 9 Nov 2021 14:35:25 -0800 Subject: [PATCH 05/12] try reading a file that i manually placed on my sd card --- Assets/SampleInit.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Assets/SampleInit.cs b/Assets/SampleInit.cs index 9ad56b6..27c8cb4 100644 --- a/Assets/SampleInit.cs +++ b/Assets/SampleInit.cs @@ -99,6 +99,17 @@ IEnumerator Start() { Debug.LogException(e); } + try + { + + var filePath = $"/storage/ext_sd/HelloWorldReading.txt"; //should work + Debug.Log("Test read"); + Debug.Log($"File: {File.ReadAllText(filePath)}"); + } + catch (Exception e) + { + Debug.LogException(e); + } } void testWriteReadAtPath(string filePath) From b06dbff036cb15d18b82143d2623039c67005361 Mon Sep 17 00:00:00 2001 From: Alex Sink Date: Tue, 9 Nov 2021 14:39:57 -0800 Subject: [PATCH 06/12] remove inaccurate comment from copied code --- Assets/SampleInit.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/SampleInit.cs b/Assets/SampleInit.cs index 27c8cb4..8658536 100644 --- a/Assets/SampleInit.cs +++ b/Assets/SampleInit.cs @@ -102,7 +102,7 @@ IEnumerator Start() try { - var filePath = $"/storage/ext_sd/HelloWorldReading.txt"; //should work + var filePath = $"/storage/ext_sd/HelloWorldReading.txt"; Debug.Log("Test read"); Debug.Log($"File: {File.ReadAllText(filePath)}"); } From cc91bd16ec381dd7524be30f50a48fd64ef50a75 Mon Sep 17 00:00:00 2001 From: Alex Sink Date: Tue, 9 Nov 2021 19:24:26 -0800 Subject: [PATCH 07/12] try not using the symlink --- Assets/Plugins/Android/AndroidManifest.xml | 1 + Assets/SampleInit.cs | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Assets/Plugins/Android/AndroidManifest.xml b/Assets/Plugins/Android/AndroidManifest.xml index 62eeeea..3a32eb2 100644 --- a/Assets/Plugins/Android/AndroidManifest.xml +++ b/Assets/Plugins/Android/AndroidManifest.xml @@ -6,6 +6,7 @@ android:label="@string/app_name" android:theme="@style/Theme.WaveVR.Black" android:resizeableActivity="false" + android:requestLegacyExternalStorage="true" tools:replace="android:theme"> Date: Fri, 19 Nov 2021 15:39:48 -0800 Subject: [PATCH 08/12] misc settings --- Packages/manifest.json | 1 + Packages/packages-lock.json | 7 +++++++ ProjectSettings/ProjectSettings.asset | 4 ++-- ProjectSettings/QualitySettings.asset | 4 +++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Packages/manifest.json b/Packages/manifest.json index 169bd90..b109b3a 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -7,6 +7,7 @@ "com.unity.ide.rider": "1.2.1", "com.unity.ide.visualstudio": "2.0.11", "com.unity.ide.vscode": "1.2.3", + "com.unity.mobile.android-logcat": "1.2.3", "com.unity.render-pipelines.universal": "7.6.0", "com.unity.test-framework": "1.1.27", "com.unity.textmeshpro": "2.1.6", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 4efbd3d..450ce95 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -67,6 +67,13 @@ "dependencies": {}, "url": "https://packages.unity.com" }, + "com.unity.mobile.android-logcat": { + "version": "1.2.3", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, "com.unity.render-pipelines.core": { "version": "7.6.0", "depth": 1, diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 1c9c0d8..5200f6c 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -13,7 +13,7 @@ PlayerSettings: useOnDemandResources: 0 accelerometerFrequency: 60 companyName: DefaultCompany - productName: URP_Example24 + productName: AccessStorage defaultCursor: {fileID: 0} cursorHotspot: {x: 0, y: 0} m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} @@ -168,7 +168,7 @@ PlayerSettings: androidSupportedAspectRatio: 1 androidMaxAspectRatio: 2.1 applicationIdentifier: - Android: com.DefaultCompany.URP_Example24 + Android: com.DefaultCompany.AccessStorage buildNumber: {} AndroidBundleVersionCode: 1 AndroidMinSdkVersion: 25 diff --git a/ProjectSettings/QualitySettings.asset b/ProjectSettings/QualitySettings.asset index b498437..42b308a 100644 --- a/ProjectSettings/QualitySettings.asset +++ b/ProjectSettings/QualitySettings.asset @@ -222,4 +222,6 @@ QualitySettings: resolutionScalingFixedDPIFactor: 1 customRenderPipeline: {fileID: 0} excludedTargetPlatforms: [] - m_PerPlatformDefaultQuality: {} + m_PerPlatformDefaultQuality: + Android: 0 + Standalone: 0 From 2df00d35ca676916a5778c1663c4a8228d136cc1 Mon Sep 17 00:00:00 2001 From: Alex Sink Date: Mon, 14 Mar 2022 13:49:57 -0700 Subject: [PATCH 09/12] ignore esscene --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index bd5740d..1a1d93c 100644 --- a/.gitignore +++ b/.gitignore @@ -79,3 +79,7 @@ crashlytics-build.properties #ide /.vs/ /.idea/ + +#wave essence +Assets/Wave/Essence +Assets/Wave/Essence.meta From acc84f2ba738a0c812f8eb821b874edc9c6ce41b Mon Sep 17 00:00:00 2001 From: Alex Sink Date: Mon, 14 Mar 2022 13:50:32 -0700 Subject: [PATCH 10/12] read a fake file created during installation using a powershell script --- Assets/Plugins/Android/AndroidManifest.xml | 1 + Assets/SampleInit.cs | 97 ++-------------------- Assets/Samples.meta | 8 -- Assets/Wave.meta | 2 +- ProjectSettings/ProjectSettings.asset | 4 +- ProjectSettings/QualitySettings.asset | 4 +- installScript.ps1 | 18 ++++ 7 files changed, 30 insertions(+), 104 deletions(-) delete mode 100644 Assets/Samples.meta create mode 100644 installScript.ps1 diff --git a/Assets/Plugins/Android/AndroidManifest.xml b/Assets/Plugins/Android/AndroidManifest.xml index 3a32eb2..82325de 100644 --- a/Assets/Plugins/Android/AndroidManifest.xml +++ b/Assets/Plugins/Android/AndroidManifest.xml @@ -34,5 +34,6 @@ + diff --git a/Assets/SampleInit.cs b/Assets/SampleInit.cs index 1844825..b526151 100644 --- a/Assets/SampleInit.cs +++ b/Assets/SampleInit.cs @@ -9,117 +9,32 @@ public class SampleInit : MonoBehaviour { - IEnumerator WaitOnPermissions(PermissionManager pmInstance,string[] permissions,int maxRequestCount=1000) - { - bool gotPermissions = false; - for(int i=0;i { - foreach (var result in results) - { - Debug.Log($"Request for {result.PermissionName} granted result:{result.Granted}"); - if (result.Granted == false) - { - success = false; - } - } - finished = true; - }); - Debug.Log("waiting for permissions"); - while (finished == false) - { - yield return null; - } - Debug.Log($"finished waiting for permissions was it successful {success}"); - if (success) - { - gotPermissions = true; - break; - } - Debug.Log($"Retrying {i}"); - yield return new WaitForSeconds(.3f); - } - Debug.Log($"Permissions got ret"); - if (!gotPermissions) - { - Debug.LogError("Didn't get permissions. womp womp"); - } - } - - /* - - - - */ - IEnumerator Start() + void Start() { Debug.Log($"Start asink"); - var pmInstance = Wave.Essence.PermissionManager.instance; - Debug.Log("waiting for permission manager"); - while (!pmInstance.isInitialized()) - yield return null; - Debug.Log("finished waiting for permission manager"); - - //,"vive.wave.vr.oem.data.OEMDataWrite" <- no popup and never gets granted - var permissions = new[] {"android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE","vive.wave.vr.oem.data.OEMDataRead"}; - yield return WaitOnPermissions(pmInstance, permissions); - Debug.Log("Got known good permissions"); - - yield return WaitOnPermissions(pmInstance, new[] - { - "com.htc.vr.core.server.VRDataRead" - /*, - "com.htc.vr.core.server.VRDataWrite", //doesn't return true ever - "com.htc.vr.core.server.VRDataProvider" //doesn't return true ever - */ - },100); - Debug.Log("About to write"); - //var filePath = $"/mnt/sdcard/Android/data/{Application.identifier}/files/testingfoo"; try { - var filePath = $"/storage/ext_sd/Android/data/{Application.identifier}/files/testingfoo"; //should work + var filePath = $"/mnt/sdcard/Android/data/{Application.identifier}/files/testingfoo"; //try creating a new file as well, for kicks testWriteReadAtPath(filePath); } catch (Exception e) { Debug.LogException(e); } + Debug.Log("About to read"); try { - var filePath = $"/storage/ext_sd/testingbar"; //should work - testWriteReadAtPath(filePath); - } - catch (Exception e) - { - Debug.LogException(e); - } - try - { - - var filePath = $"/storage/ext_sd/HelloWorldReading.txt"; - Debug.Log("Test read"); - Debug.Log($"File: {File.ReadAllText(filePath)}"); - } - catch (Exception e) - { - Debug.LogException(e); - } - try - { - - var filePath = $"/storage/3365-3432/HelloWorldReading.txt"; - Debug.Log("Test read2"); - Debug.Log($"File: {File.ReadAllText(filePath)}"); + var filePath = $"/mnt/sdcard/Android/data/{Application.identifier}/files/testfile"; + Debug.Log($"file output is {File.ReadAllText(filePath)}"); } catch (Exception e) { Debug.LogException(e); } + Debug.Log("end asink"); } void testWriteReadAtPath(string filePath) diff --git a/Assets/Samples.meta b/Assets/Samples.meta deleted file mode 100644 index f208674..0000000 --- a/Assets/Samples.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 78b0b1cff817b4d40867ad594b375087 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Wave.meta b/Assets/Wave.meta index c5e2022..f707854 100644 --- a/Assets/Wave.meta +++ b/Assets/Wave.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d2f580f02e6990241966118502b0034c +guid: eb6cab9ee8f801f4ca516d319ac2414d folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 5200f6c..21a7671 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -125,7 +125,9 @@ PlayerSettings: 16:9: 1 Others: 1 bundleVersion: 0.1 - preloadedAssets: [] + preloadedAssets: + - {fileID: 11400000, guid: df27b5734f961904e9d14de3d6e0e071, type: 2} + - {fileID: -2246702517388260793, guid: 574466f07abaf0c42bf023bb1b83f441, type: 2} metroInputSource: 0 wsaTransparentSwapchain: 0 m_HolographicPauseOnTrackingLoss: 1 diff --git a/ProjectSettings/QualitySettings.asset b/ProjectSettings/QualitySettings.asset index 42b308a..b498437 100644 --- a/ProjectSettings/QualitySettings.asset +++ b/ProjectSettings/QualitySettings.asset @@ -222,6 +222,4 @@ QualitySettings: resolutionScalingFixedDPIFactor: 1 customRenderPipeline: {fileID: 0} excludedTargetPlatforms: [] - m_PerPlatformDefaultQuality: - Android: 0 - Standalone: 0 + m_PerPlatformDefaultQuality: {} diff --git a/installScript.ps1 b/installScript.ps1 new file mode 100644 index 0000000..410590d --- /dev/null +++ b/installScript.ps1 @@ -0,0 +1,18 @@ +Write-Host "installing apk" +adb install -r -g -d "Builds/test.apk" +Write-Host "installed apk" + +Write-Host "double checking that root directories exist" +adb shell mkdir -m777 /mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files + +"fakefilecontents" | Out-file testfile + +echo "pushing sample folder of files" +adb push testfile /mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files/testfile + +echo "double checking permissions of files" +adb shell chmod 777 /mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files + +echo "folder of content files should now be located and accessible at /mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files" + +#/mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files \ No newline at end of file From b33e1dfa0b07f630956afd79bd3183b720cc92d9 Mon Sep 17 00:00:00 2001 From: Alex Sink Date: Mon, 14 Mar 2022 13:57:56 -0700 Subject: [PATCH 11/12] recursive chmod for saftey --- installScript.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installScript.ps1 b/installScript.ps1 index 410590d..c538296 100644 --- a/installScript.ps1 +++ b/installScript.ps1 @@ -11,7 +11,7 @@ echo "pushing sample folder of files" adb push testfile /mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files/testfile echo "double checking permissions of files" -adb shell chmod 777 /mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files +adb shell chmod -R 777 /mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files echo "folder of content files should now be located and accessible at /mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files" From 491eb764a740f8a993dc34cb430640dcfc020179 Mon Sep 17 00:00:00 2001 From: Alex Sink Date: Mon, 14 Mar 2022 14:01:14 -0700 Subject: [PATCH 12/12] chmod wasn't needed --- installScript.ps1 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/installScript.ps1 b/installScript.ps1 index c538296..ad79b8f 100644 --- a/installScript.ps1 +++ b/installScript.ps1 @@ -3,16 +3,13 @@ adb install -r -g -d "Builds/test.apk" Write-Host "installed apk" Write-Host "double checking that root directories exist" -adb shell mkdir -m777 /mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files +adb shell mkdir /mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files "fakefilecontents" | Out-file testfile echo "pushing sample folder of files" adb push testfile /mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files/testfile -echo "double checking permissions of files" -adb shell chmod -R 777 /mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files - echo "folder of content files should now be located and accessible at /mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files" #/mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files \ No newline at end of file