From c3700d8b00f33a5e5ab626b6e2117a3c12bfa3b6 Mon Sep 17 00:00:00 2001 From: DavidAsulin Date: Wed, 19 Mar 2025 17:04:52 +0200 Subject: [PATCH] Write the customInstrument* script to the same folder as the wrapper script This will resolve the limitation stated in the documentation: 'Important: The path of the shell must be the path of the script.' See: https://help.perfecto.io/perfecto-help/content/perfecto/manual-testing/android_offline_instrumentation.htm#Runtheactivatortool --- CustomizedInstrumentation/customInstrumentWrapper.py | 4 ++-- CustomizedInstrumentation/customInstrumentWrapperAndroid.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CustomizedInstrumentation/customInstrumentWrapper.py b/CustomizedInstrumentation/customInstrumentWrapper.py index 29d2e15..338a8c0 100644 --- a/CustomizedInstrumentation/customInstrumentWrapper.py +++ b/CustomizedInstrumentation/customInstrumentWrapper.py @@ -80,10 +80,10 @@ def main(): sys.exit(1) time.sleep(1) - with open('customInstrument.py', 'wb') as f: + with open(os.path.join(os.path.dirname(__file__), 'customInstrument.py'), 'wb') as f: f.write(response.content) - if os.path.getsize('customInstrument.py') == 0: + if os.path.getsize(os.path.join(os.path.dirname(__file__), 'customInstrument.py')) == 0: print("Failed to Download Instrumentation Script! (Download Error)") sys.exit(1) diff --git a/CustomizedInstrumentation/customInstrumentWrapperAndroid.py b/CustomizedInstrumentation/customInstrumentWrapperAndroid.py index f0503d2..443c433 100644 --- a/CustomizedInstrumentation/customInstrumentWrapperAndroid.py +++ b/CustomizedInstrumentation/customInstrumentWrapperAndroid.py @@ -101,10 +101,10 @@ def main(): sys.exit(1) time.sleep(1) - with open('customInstrumentAndroidD.py', 'wb') as f: + with open(os.path.join(os.path.dirname(__file__), 'customInstrumentAndroidD.py'), 'wb') as f: f.write(response.content) - if os.path.getsize('customInstrumentAndroidD.py') == 0: + if os.path.getsize(os.path.join(os.path.dirname(__file__), 'customInstrumentAndroidD.py')) == 0: print("Failed to Download Instrumentation Script! (Download Error)") sys.exit(1)