Remove local app M1 Mac that was created in Xcode - xcode

I'm working on an iOS Xcode project on an M1 Mac. I set the run destination as (This Mac) and ran the app on the Mac. Now I need to delete the app to clear its data because I need to make sure a file copy operation happens on first run. A search in Finder shows me the app in /Users/my Name/Library/Developer/Xcode/DerivedData/myXcodeProject-cpkgxnpaxvacnldboddpfgojwukv/Build/Products/Debug-iphoneos
I can delete the app from there but when I run it again all of its data is still there.
I don't see any other supporting files in that directory.
The data I want to delete are the files that are automatically copied to the Apps Documents Directory. Any suggestions how to scrub that app off the Mac?

First, open the terminal and do the following:
cd ~/Library/Containers
find . -iname "*bloons*"
This will return an output which is showing a match in an obscured directory name. You need to delete the app and its directory with:
rm -Rf 2EC6B4BC-DD8D-4D49-89A1-4376990BF693
The original answer could be found here:
https://forums.macrumors.com/threads/how-to-uninstall-ios-ipados-apps-on-m1-macs-and-where-do-they-store-their-files.2275923/?post=29453766#post-29453766

Related

How to symbolicate for Xamarin.iOS on Windows

I submitted an iOS app which failed review due to a crash. I was given the crash report which unfortunately for me, was useless because I didn't keep the dSYM files and .app file that I apparently needed to decipher the crash report.
First question -
I've built a new release and I've stored the dSYMs folder away for safe keeping, but I can't find the .app file that I apparently need. this link here suggested that I could change the .ipa file to a zip and then get the .app from unzipping it but there was nothing in the zipped folder once I changed its extension to .zip How to symbolicate crash/error logs from a Xamarin Forms iOS project?
Second question - How do I symbolicate on windows? I've seen guides like this one, but it only shows you how to do it on a MAC. The problem I have is that the project is entirely built on my windows machine which is networked to a MAC. https://jmillerdev.com/symbolicating-ios-crash-files-xamarin-ios/
I was able to symbolicate the crash reports given by apple from the review by using this guide:
https://jmillerdev.com/symbolicating-ios-crash-files-xamarin-ios/
or
How to symbolicate crash/error logs from a Xamarin Forms iOS project?
Basically what you need to do:
Get the .dSYM and .app file from the archived release folder and put it on your MAC in a folder some where. Additionally, put the crash report in the same folder. (The crash report on App Store Connect will be a .txt file. Change it to .crash) Open up the terminal and change the current working directory to that folder I just mentioned. e.g. cd /Applications/crashFolder
Run the following terminal commands
alias symbolicate="/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash -v"
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
Symbolicate your .crash file with this terminal command:
symbolicate -o "symbolicatedCrash1.txt" "crash1.crash" "MyApp.app"

XCode - How to reset/"delete" a mac os app run from Xcode (analog to deleting the app in the ios simulator)?

When using the iOS Simulator, I can simply delete the app and re-run the app to start fresh. How is this done for mac os apps? I can't find it out. There is a folder for the project inside "DerivedData", but deleting this also messes with the entire project and I have to re-fetch all dependencies and stuff.
Thanks!
Had the same question, found the answer in another question on Stack Overflow: Nicolas Miari and superfell's answer did the trick for me and my Mac Catalyst app:
You can use the defaults command line tool to remove all the settings,
you just need the bundle id of your app (which you can find in your
Info.plist file), e.g. if your bundle id is "com.foo.barApp" then you
can run this from a terminal shell:
defaults delete com.foo.barApp
For anyone who comes here later for solution:
install fd from homebrew: brew install fd
search for your data folder: fd com.thisIsYour.bundleId
You should see something likes this:
Library/Containers/B155E847-3026-484D-8CC1-165E3CA1E9CD/Data/Library/...
Library/Containers/B155E847-3026-484D-8CC1-165E3CA1E9CD/Data/Library/...
Library/Containers/B155E847-3026-484D-8CC1-165E3CA1E9CD/Data/Library/...
remove the folder: rm -rf Library/Containers/B155E847-3026-484D-8CC1-165E3CA1E9CD
If the app is storing something at say ~/Library/Caches/yourapp or ~/Library/Application Support/yourapp, it's trivial to set up an Automator Service, or bash alias to clean them up.
~/Library/Developer/Xcode/DerivedData is meant for the Xcode project and the things Xcode creates, not the things that your app creates such as user preferences.
Alternatively, you can create a listener for a flag in the app itself like --run-fresh that can be set in scheme settings as launch argument. This flag will (if you code it) stop the app from looking into user data folder.

How to completely uninstall VS Code on mac?

I need to do a clean installation of VS Code on my mac.
I opened the terminal and removed the .vscode/ from ~. I also deleted the Visual Studio Code.app/ from /. However, after deleting all that and downloading a fresh copy, I installed and open the editor and the editor remembered the last project I had. For me, that means that it is something else I need to delete but I can't find it. I went to the documentation but can't find anything about uninstalling the editor.
Does anyone know how to completely uninstall VSCode from mac?
What I have tried
Following these instructions and doing a new installation of VS Code, but it still keeps remembering the last project I opened.
https://developer.xamarin.com/guides/cross-platform/getting_started/installation/uninstalling_xamarin/#Using_the_Uninstall_Script
Here are all the places where VSCode stores stuff on Mac OS X, besides the Visual Studio Code.app itself, which is in your Applications folder:
rm -fr ~/Library/Preferences/com.microsoft.VSCode.helper.plist
rm -fr ~/Library/Preferences/com.microsoft.VSCode.plist
rm -fr ~/Library/Caches/com.microsoft.VSCode
rm -fr ~/Library/Caches/com.microsoft.VSCode.ShipIt/
rm -fr ~/Library/Application\ Support/Code/
rm -fr ~/Library/Saved\ Application\ State/com.microsoft.VSCode.savedState/
rm -fr ~/.vscode/
Update (Feb 2020): There are potentially also hidden extension directories in your home directories. To get rid of everything make sure you look for those too. They start with .vscode-.
Please run this command with care. Maybe you want to keep extension directories.
rm -rf ~/.vscode*
The solution to my problem was to cd to the following path... /Users/<user>/Library/Application\ Support and delete the folder called Code. That folder contains all the setting and is not overwrite with a new installation. Looking through the entire file structure, VSCode name folder different. Sometimes folders are called .vscode/, or code/, or Visual Studio Code.app.
This worked for me ( VS Code 1.30 with MacOS - High Sierra 10.13.6 )
Step 1:
Close VS Code
Step 2:
rm -rf $HOME/Library/Application\ Support/Code
Step 3:
rm -rf $HOME/.vscode
Step 4:
Remove VSCode from application
Step5:
Reinstall VS Code if needed
If using a 3rd-party application is OK, check out App Cleaner.
It basically does the same thing as the other answer, but via a GUI and you don't have to manually remove all files/dirs one-by-one. Just drag VS Code from the Applications folder into App Cleaner, then it will find all the related files for you, and then you just have to click on the Remove button.
UPDATE (VS Code 1.46)
Based on a recent comment, even after using AppCleaner, re-installing VS Code seems to still "remember" your previous extensions. This is caused by a ~/.vscode/extensions folder, which for some reason, AppCleaner can't "see" and is not listed in its UI. You will have to remove this folder manually.
~$ find ~/. -maxdepth 1 -name .vscode -type d
/Users/gino/./.vscode
~$ ll /Users/gino/./.vscode/extensions
total 0
drwxr-xr-x 15 gino staff 480B Jun 30 14:14 dbaeumer.vscode-eslint-2.1.5/
... (all other extensions) ...
~$ rm -Rf /Users/gino/./.vscode
The homebrew cask code for VSCode provides a nice list of all the folders that you have to delete manually after moving the app itself into the trash:
- ~/.vscode
- ~/Library/Application Support/Code
- ~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.microsoft.vscode.sfl*
- ~/Library/Caches/com.microsoft.VSCode.ShipIt
- ~/Library/Caches/com.microsoft.VSCode
- ~/Library/Preferences/ByHost/com.microsoft.VSCode.ShipIt.*.plist
- ~/Library/Preferences/com.microsoft.VSCode.helper.plist
- ~/Library/Preferences/com.microsoft.VSCode.plist
- ~/Library/Saved Application State/com.microsoft.VSCode.savedState
Here is my approach:
Open finder
Click on Home icon(which has your username as label)
Click on Library Folder. Note Library folder may be hidden, so you will need to click on Shift+CMD+. to open hidden files and folders.
Click Application Support folder
Find Code folder beneath Application Support and delete it(You delete Code Folder of course)
I lost my old mac and had to reinstall vscode on my new mac. I thought I had lost all of my extensions but when I logged on the vscode they all seem to be stored on my vscode account. I don't know if that will make a difference.
If these steps are not enough, like for me, please consider removing these file and directory:
/usr/local/Caskroom/visual-studio-code
/usr/local/Library/Taps/caskroom/homebrew-cask/Casks/visual-studio-code.rb
Run in a shell the following commands to check for others file or directories:
locate visual-studio-code
locate vscode
locate code
Bye.

Is there any way to disable write-access to source code from within Xcode?

Is there any easy solution to prevent Xcode from writing to source files in a project? I want to edit source files externally and only use Xcode for debugging and so I want to prevent any accidental modifications getting saved via xcode. (Obviously I want Xcode to pickup external changes to files when I build/debug)
One possible solution that I thought of was to enable app sandbox entitlements on xcode and manually maintain a list of directories that it should not write to. Is this feasible? Any other ideas?
On the sandboxing thing, I'm not sure if Xcode is disqualified as per Apple's Sandboxing Requirements.
I don't think there's any way to prevent XCode from getting all into your source, writing temp files and whatnot.
One option would be to create a simple shell script that pushes your source to a directory for XCode to use. Since you're not using XCode for development (debugging only), just copy your entire project tree into a temporary directory and then open that in XCode.
Something like (push_to_xcode.sh):
#!/bin/bash
#first, wipe existing project from your temp directory
rm -rf /tmp/xcode_temp_code
#then, copy your existing project into the temp folder
cp -R /path/to/your/project/myProject /tmp/xcode_temp_code
#lastly, launch the project
open /tmp/xcode_temp_code/myProject.xcodeproj
Once you've created the script, change it to executable by typing chmod +x push_to_xcode.sh
Then open a terminal, cd to the directory where you saved the script, and type ./push_to_xcode.sh or double click on it in finder.
That will launch Xcode with this project. No changes you make in XCode, either purposefully or accidentally, will affect your original code.

How can I configure the iOS Simulator application directory?

Is there a way to configure the iOS Simulator application directory?
I'm using Xcode 4.3 and it's currently under
/Users/<Username>/Library/Application Support/iPhone Simulator/5.1/Applications/
When I run an app in Xcode it gets copied to a sub-directory:
/Users/<Username>/Library/Application Support/iPhone Simulator/5.1/Applications/<APP-UUID>/<AppName>.app
"Documents", "Library" and "tmp" dirs are next to the the app itself. Any file access that I'm doing within my app is using this directory as root.
The reason for asking this is that I want to keep the files on an SSD that is not my startup volume. So any hard links won't work either.
I haven't looked at Xcode 4.4 or 4.5 yet, but I could use those as well.
UPDATE:
Actually soft links work:
First delete
rm -R /Users/<Username>/Library/Application Support/iPhone Simulator/5.1/Applications/
Then create the soft link
ln -s /Volumes/<YourSSDVolume>/Applications/ /Users/<Username>/Library/Application Support/iPhone Simulator/5.1/Applications/
Thanks to John.K.Doe for forcing me to try it again;)
you can use soft-links to link onto other volumes, so long as those volumes always end up in the same place, and you could also use a soft-link to link to someplace that you then configure whenever your SSD is attached.
I think you can use a parameter to launch Simulator. See this SO answer: https://stackoverflow.com/a/4894178/801466.

Resources