Created
December 12, 2022 06:30
-
-
Save demirdev/7238d04b9e82a6dcd94a339b787d20b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
simId=$(flutter devices|grep simulator|cut -d"•" -f2|tr " " "\0") | |
appDir="$HOME/Library/Developer/CoreSimulator/Devices/$simId/data/Containers/Data/Application" | |
#echo $appDir | |
appId=$(ls -alrt $appDir|tail -2|head -1) | |
mobileAppDir=$(echo $appId|rev|cut -d" " -f1|rev) | |
documentsDir="$appDir/$mobileAppDir/Documents" | |
lastFileName=$(ls -alrt $documentsDir|tail -2|head -2|rev|cut -d" " -f1|cut -d" " -f1|rev) | |
#echo $documentsDir | |
fileName=$(echo $lastFileName|rev|cut -d" " -f1|rev) | |
cp $documentsDir/$fileName $HOME/Downloads/ | |
open $HOME/Downloads/ | |
# ~/Library/Developer/CoreSimulator/Devices/3ECD7A42-EA1C-4BAA-946F-94BE575F8DD2/data/Containers/Data/Application/1065EB89-00A9-41C7-B487-66707CA8AFBB/Documents |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment