.debug file not getting deleted

  1. 2 years ago

    William K

    4 Jul 2017 Pre-Release Testers, Xojo Pro Chico, CA

    I just fired up Xojo for the first time after updating to the developer version of High Sierra a couple of weeks ago and noticed that when I quit an application in the IDE (either correctly by using the Quit menu, or forcefully) the [appname].debug file doesn't get automatically deleted, and requires me manually removing it before I can run in the IDE again. I'm not sure if this is High Sierra related or not - I'm not in the office and don't have access to my other computers.

    Is anyone else seeing this?

    Cheers.

    -bill k

  2. Beatrix W

    4 Jul 2017 Pre-Release Testers Europe (Germany)

    Feedback Case #48296

    The icons aren properly deleted if you peek into the remaining app. And the updated IDE script to kill the dang thing:

    'kill app if running
    dim theCommand as String
    theCommand = "ps -axwwopid,command | grep '" + PropertyValue("App.MacOSXAppName") +"' | grep -v grep | awk '{print $1}'"
    dim theResult as String
    theResult = DoShellCommand(theCommand)
    if theResult <> "" then
      theCommand = "kill " + theResult
      theResult = DoShellCommand(theCommand)
    end if
    
    'get path and app name
    dim appNameForShell as string = PropertyValue("App.MacOSXAppName") + ".debug.app"
    appNameForShell = getShellString(appNameForShell)
    dim CountSlashes as Integer = CountFields(ProjectShellPath, "/")
    dim ProjectName as string = NthField(ProjectShellPath, "/", CountSlashes)
    dim ProjectPath as String = Left(ProjectShellPath, Len(ProjectShellPath) - Len(ProjectName))
    
    'delete app
    theCommand = "rm -rf " + ProjectPath + appNameForShell
    theResult = DoShellCommand(theCommand)
    if theResult <> "" then print theResult
      
    function getShellString(theString as String) as string
      Return ReplaceAll(theString, " ", "\ ")
    end Function
  3. William K

    4 Jul 2017 Pre-Release Testers, Xojo Pro Chico, CA

    Weird. I read through the feedback case, that's exactly what I'm seeing. Hopefully they'll get this resolved soon.

  4. Norman P

    4 Jul 2017 Xojo Inc, Pre-Release Testers, Xojo Pro Seeking work. npalardy@great-w...

    run lsof on any file in the bundle and see what that says

  5. @Beatrix W Feedback Case #48296

    The icons aren properly deleted if you peek into the remaining app. And the updated IDE script to kill the dang thing:

    'kill app if running dim theCommand as String theCommand = "ps -axwwopid,command | grep '" + PropertyValue("App.MacOSXAppName") +"' | grep -v grep | awk '{print $1}'" dim theResult as String theResult = DoShellCommand(theCommand) if theResult <> "" then theCommand = "kill " + theResult theResult = DoShellCommand(theCommand) end if 'get path and app name dim appNameForShell as string = PropertyValue("App.MacOSXAppName") + ".debug.app" appNameForShell = getShellString(appNameForShell) dim CountSlashes as Integer = CountFields(ProjectShellPath, "/") dim ProjectName as string = NthField(ProjectShellPath, "/", CountSlashes) dim ProjectPath as String = Left(ProjectShellPath, Len(ProjectShellPath) - Len(ProjectName)) 'delete app theCommand = "rm -rf " + ProjectPath + appNameForShell theResult = DoShellCommand(theCommand) if theResult <> "" then print theResult function getShellString(theString as String) as string Return ReplaceAll(theString, " ", "\ ") end Function

    Thank you, I added this to my compile script and it works quite well, hopefully they can get this fixed so that we don't need the work around.

  6. Jeffery L

    is not verified 2 Aug 2017 Pre-Release Testers, Xojo Pro

    Same thing here. Whether running Real Studio or Xojo, it's not deleting the debug file. Every time before I can run, I have to delete the debug file or I will get a compilation error.

  7. Aurelian N

    2 Aug 2017 Pre-Release Testers, Xojo Pro

    Same issue here on all the web apps and example apps from the drive.

    Where exactly do you have to put this script ?

    Thanks.

  8. Beatrix W

    2 Aug 2017 Pre-Release Testers Europe (Germany)

    The script needs to be in the build settings for your platform. It needs to be placed BEFORE the build step.

    However, the issue with High Sierra is a different one than with the web apps.

  9. Beatrix W

    2 Aug 2017 Pre-Release Testers Europe (Germany)

    I had forgotten to do the lsof thing:
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    iconservi 35313 beatrixwillius txt REG 1,5 255172 8610053725 /Users/beatrixwillius/Documents/Development/Mail Archiver/code current/Mail Archiver X.debug.app/Contents/Resources/App.icns

  10. Norman P

    3 Aug 2017 Xojo Inc, Pre-Release Testers, Xojo Pro Seeking work. npalardy@great-w...

    great
    iconservices is holding the icns file busy - hence why the removal fails

  11. Beatrix W

    3 Aug 2017 Pre-Release Testers Europe (Germany)

    How can I whack iconservices into behaving? Or is this a MacOS bug?

    For building the main projects this isn't much of a problem because I delete the whole goulash anyway. But for testing or building only one app this problem really is a nuisance.

  12. Norman P

    3 Aug 2017 Xojo Inc, Pre-Release Testers, Xojo Pro Seeking work. npalardy@great-w...

    Not sure since when I debug the IDE it doesn't do this
    So I'm not sure what the root cause of iconservices holding onto this fie is
    But, this isn't the first time iconservices has caused issues for people
    Google for "iconservicesagent" and you'll find lots of questions about memory usage, cpu usage, etc over the years

  13. I am having this problem too after upgrading to High Sierra. Never had it in Sierra. I have no idea how to setup a build script.

  14. Jens K

    30 Sep 2017 near Cologne, Germany

    @Charles F I am having this problem too after upgrading to High Sierra. Never had it in Sierra. I have no idea how to setup a build script.

    Same here. After reading the user guide, I did the following steps:

    1. Add a new script via Insert > Build Step > Script.
    2. Copy the mentioned code to the script.
    3. Drag the script in the navigator to macOS in the Build Settings section of the navigator.
    4. Your script has to be above the Build entry in order to be executed before building; drag it there, if it is unter the Build entry.

    This works perfectly for running a debug application, but I have the additional problem, that my application is not built as long as there is already an application build in the Builds folder. So I would like to add some lines of code to my build script to remove the Builds folder of my application before building it again.
    By now I have no working result. Is there a way to extend Beatrix' script for that?

  15. Beatrix W

    30 Sep 2017 Pre-Release Testers Europe (Germany)

    AppleScript to the rescue:

    #!/usr/bin/env osascript
    
    on run
    	set DocumentsFolder to path to documents folder as string
    	set CodeFolder to DocumentsFolder & "xxxxx path to main projects folder"
    	set theFolder to (alias CodeFolder)
    	doSomethingWith(theFolder)
    end run
    
    on doSomethingWith(aFolder)
    	tell application "Finder"
    		set subFolders to every folder of aFolder
    		repeat with eachFolder in subFolders
    			my doSomethingWith(eachFolder)
    		end repeat
    	end tell
    	
    	try
    		tell application "Finder"
    			delete (every item of aFolder whose name ends with "app" and name starts with "your app name")
    			delete (every item of aFolder whose name ends with "dmg")
    		end tell
    	on error error_message number error_number
    		display alert ("YIKES! Something's wrong!") message error_message & (" Error number ") & error_number & "."
    	end try
    end doSomethingWith

    This is called in an IDE communicator script:

    dim basePath as string
    basePath = "/Users/xxx/Documents/xxx"
    
    'delete old apps and dmg
    dim theCommand as string = "osascript " + basePath + "xxxxxxxxx"
    dim theResult as String = DoShellCommand(theCommand)

    Change the paths and in the AppleScript the name of the app. Or take the condition out if you think that you don't need it.

  16. Jens K

    30 Sep 2017 near Cologne, Germany
    Edited 2 years ago

    Thanks for your code!
    In the meantime I found a simpler solution. I just added the following lines to your pre-build script:

    theCommand = "rm -rf [PATH TO MY XOJO FILES]/Builds\ -\ " + PropertyValue("App.MacOSXAppName") + _
        ".xojo_binary_project/OS\ X\ 64\ bit/" + PropertyValue("App.MacOSXAppName") + ".app"
    theResult = DoShellCommand(theCommand)
    If theResult <> "" Then Print theResult

    That's all I need for now. My code didn't work at first because I forgot to escape the whitespaces, but now I can work with Xojo as usual again…

  17. Derk J

    30 Sep 2017 Pre-Release Testers, Xojo Pro

    I’m using macos high sierra and never had this issue. Suspecting a simple setting or cache problem in macos here.

  18. Beatrix W

    30 Sep 2017 Pre-Release Testers Europe (Germany)

    @Derk J: not a setting. Seems to be a problem with the macOS hanging on to the icon file. I suspect that this is also the reason why quitting the debug app takes so very very long on High Sierra.

  19. Derk J

    1 Oct 2017 Pre-Release Testers, Xojo Pro

    @Beatrix W @Derk J: not a setting. Seems to be a problem with the macOS hanging on to the icon file. I suspect that this is also the reason why quitting the debug app takes so very very long on High Sierra.

    Mine is not slow in High Sierra, not sure why an icon file should be a problem as it’s suppose to be in memory as a copy

  20. Beatrix W

    1 Oct 2017 Pre-Release Testers Europe (Germany)

    Oh, Normal (ah, the fingers can't type Norman) has fixed the bug. Very nice!!!!

    Shouldn't I have gotten a notification from Feedback?

    @Derk Jochems: from the Feedback case:

    When running lsof on the left over file I get the following result:

    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    iconservi 35313 beatrixwillius txt REG 1,5 255172 8610053725 /Users/beatrixwillius/Documents/Development/Mail Archiver/code current/Mail Archiver X.debug.app/Contents/Resources/App.icns

  21. Newer ›

or Sign Up to reply!