Skip to content

Instantly share code, notes, and snippets.

@demirdev
Created December 12, 2022 06:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save demirdev/7238d04b9e82a6dcd94a339b787d20b2 to your computer and use it in GitHub Desktop.
Save demirdev/7238d04b9e82a6dcd94a339b787d20b2 to your computer and use it in GitHub Desktop.
#!/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