-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code changes for Collecting Device Logs - Killing the Emulator Process - Setting Permissions in iOS #4
Conversation
|
||
//Check if the simFolder has TCC.db file in it | ||
if(self.doesFileExist(destinationTCCFile)) { | ||
var sqlite3Command_firstPart = 'sqlite3 ' + destinationTCCFile; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why split this variable into three parts like this?
Can paramedicPermissions be renamed to make it clear that it's only for iOS? The other naming convention seems like it applies to the generic files. |
logMins: !!argv.logMins? argv.logMins: undefined, | ||
appName: !!argv.appName? argv.appName: undefined, | ||
simulatorsFolder: !!argv.simulatorsFolder? argv.simulatorsFolder: undefined, | ||
tccDbPath: !!argv.tccDbPath? argv.tccDbPath: undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add defaults for these properties, or set them to null
instead of undefined
.
@riknoll - Response for your comments
@dblotsky - Response for your comments
@nikhilkh - Response for your comments
@rakatyal - Response for your comments
@omefire - Response for your comments
@sgrebnov - Response for your comments
|
var logger = require('./utils').logger; | ||
var util = require('./utils').utilities; | ||
|
||
var TCC_FOLDER_PERMISSION = 0777; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why doesn't 0644
work? If execution permissions are required on the folder, then please use 0755
. Using 0777
is a security hazard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
👍 |
}); | ||
|
||
return simId; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, running this code, I face an issue where the simId returned is null.
Maybe, there's something going on with the regex ?
Here's the output of various bash commands executed here:
1- instruments -s devices | grep ^iPhone
iPhone 4s (9.3) [93EC91E3-2679-49DC-XXXX-CAB279E462AF] (Simulator)
iPhone 5 (9.3) [830AC555-1986-4B48-82C7-898849A50541] (Simulator)
iPhone 5s (9.3) [17726EFF-F3B9-XXXX-8882-CC6ED589C213] (Simulator)
iPhone 6 (9.3) [3BDE39CD-7998-4959-B2D8-7C08C33B20B1] (Simulator)
iPhone 6 Plus (9.3) [7235ADB5-8730-4D0A-XXXX-5469D1ED47D7] (Simulator)
iPhone 6s (9.3) [32745196-XXXX-4927-ADA0-16BACE15FC99] (Simulator)
iPhone 6s (9.3) + Apple Watch - 38mm (2.2) [6A868DF2-XXXX-4AEE-9EC1-B956375934B9] (Simulator)
iPhone 6s Plus (9.3) [A949CB17-350F-4B28-AD64-XXXXXXXXXXXX] (Simulator)
iPhone 6s Plus (9.3) + Apple Watch - 42mm (2.2) [E0C9BC62-83AA-45C5-B411-XXXXXXXXXXXX] (Simulator)
2- cordova run --list --emulator | grep ^iPhone | tail -n1
iPhone-6s-Plus, 9.3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, turns out this regex breaks in Xcode 7.3, which leads to no simId being returned, which leads to a crash.
It's because of the (Simulator)
added at the end, I still think this code is too fragile as it depends on specific Xcode output, which might change in the future. Maybe, we should go back to searching through all folders like before ?
In the meantime, reajusting the regex to var simIdRegex = /^([a-zA-Z\d ]+) \(([\d.]+)\) \[([a-zA-Z\d\-]*)\].*$/;
fixes this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
…s - Setting Permissions in iOS
Merge complete. Closing the PR |
The following functionalities have been added to Paramedic code.
@omefire @dblotsky @riknoll @nikhilkh @sgrebnov @vladimir-kotikov Can you please review and merge this PR?