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)