简体   繁体   中英

“tmp” couldn't be removed because you don't have permission to access it

While trying to invoke simulator on macincloud server, I am getting the following error.

mac_tmp_could_not_be_removed

Steps tried by me:
1) Searched for "tmp" directories on my mac machine, but do not see any.
2) Tried to reset simulator, but after the confirmation screen (which asks whether or not to reset simulator), it throws the same error as mentioned above.

The permissions on the Xcode directory is as follows:

在此处输入图片说明

From the Activity Monitor I searched for the processes related to simulator and using the logs I could figure out the location of "tmp" folder, trying to delete which simulator is throwing the error. When I am trying to remove the folder manually, I get below error:

在此处输入图片说明

So which means root user is required to delete the "tmp" directory. Since I am using a non-root user to invoke the simulator, what can I do to overcome this issue?

EDIT: I have elevated the permissions for my account recursively on my home and I have the following permissions:

my_permissions

After changing the permissions when I try to delete contents of tmp directory I get this error: 在此处输入图片说明

So I think there is something wrong with the permissions that I have provided on the folders/files under my home directory.

I am describing a solution here - basically you have to remove the defunct simulator in ~/Library/Developer/CoreSimulator/Devices and recreate it.

The fine snapshot by Felix Krause - which I also explain how to use in this article - helps you to completely reset your simulators to a pristine state.

I have this issue in iPhone 6 Simulator (iOS 9.0). Please check whether all the simulators having this issue or particular simulator.

I have re created the iPhone 6 simulator in the Xcode -> Window -> Organiser. The newly created simulator works fine.

Just incase it helps others, I think I managed to get in to this state by stopping the build when stopped at a breakpoint (whilst it was paused on the breakpoint I changed my CoreData data model which may have played a part). It's the first time it's happened to me, I just closed the simulator fully and re-run the code (obviously crashed due to the model change as I'm not merging), after it crashed it allowed me to reset the simulator so maybe it locks up during model changes? Just a guess though but thought I would add the steps it took me to create it as it literally just happened.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM