Is it just me, or is your iOS Sim device setting no longer saving?

In 2015 r3, my iOS Simulator Device reverts to “iPhone 4s (iOS 9.1)” every time I load my project. I usually like to run the iOS Simulator as an iPhone 6 or 6s and this setting is usually loaded alongside the project but now it isn’t.

Is this setting actually saved with the project or is it saved someplace else?

Moved this conversation to Targets->iOS because 2015r3 is not in beta.

I’ve noticed that if you work on a project on multiple machines and save it on one, it will reset to iPhone 4s (or the lowest possible device) on the other machine the next time it is loaded.

For some reason though, this only seemed to happen from machine A > B, and not from B > A.

Is your project open on both machines at the same time?

Nope it’s always closed on one before opening on the other. I haven’t taken the time to file a bug report because it only seems to happen in one direction. Can look more into it and try it on smaller projects to see what’s happening, but I do know the list of available simulators is slightly different on both machines, so that might have something to do with it.

Moving from machine to machine I’m not surprised its not preserved.

The IDE shows you the “name” of the simulator
In iOS Simulator you can change to anything you want - see Hardware > Device > Manage Devices

So you could name several “foobar” and confuse the heck out of yourself but they are all distinct simulators
But each simulator also has an Identifier which you can see in the dialog accessible from Hardware > Device > Manage Devices
Thats what we use to restore “the right simulator”
From one machine to another it’s unlikely the id is the same, so the list resets to the first sim in the list
The list is however filtered so even if you have things like tvOS or watchOS in there they do not show up since they aren’t something we target.

Unless the ID’s change the same item should be selected
You CAN make it appear like ID"s change by creating a new simulator with all the same settings .
It will get a unique ID.

Saved as part of the project’s ui state
For binary & xml projects this is IN the project
For text this is a separate hidden file

But if you switch the simulator device and don’t save after that the old device will be restored

Binary projects ? XML ? Text ?
And I’d be fairly certain the ID’s are distinct (see my comment above)

[quote=227530:@Norman Palardy]Saved as part of the project’s ui state
:
For text this is a separate hidden file
[/quote]

I work on two machines (office and home) and use Github, but I can reproduce the issue between saves on one machine:

  1. Open Xojo.
  2. Choose my project from the Recent Projects list.
  3. In Build Settings\iOS the Simulator Device is set to iPhone 4s (iOS 9.1) even though it was set to iPhone 6s (iOS 9.1) during my previous session. I change it back to iPhone 6s (iOS 9.1).
  4. Checking the File menu shows me that the Save option is disabled, perhaps indicating that no project change has been registered that would trigger a save? I’m using Xojo Project (Text) as the project type as I use Github.
  5. Quit Xojo.

If I repeat this, I get the same result.

Norman I wonder there might be an issue on my system to do with the separate, hidden file that you mention?

Edit: Just to clarify, I only mention the Save option in case it helps to pinpoint an issue. If I make changes so that Save is enabled, I still get the issue.

[quote=227549:@Jason Tait]I work on two machines (office and home) and use Github, but I can reproduce the issue between saves on one machine:

  1. Open Xojo.
  2. Choose my project from the Recent Projects list.
  3. In Build Settings\iOS the Simulator Device is set to iPhone 4s (iOS 9.1) even though it was set to iPhone 6s (iOS 9.1) during my previous session. I change it back to iPhone 6s (iOS 9.1).
  4. Checking the File menu shows me that the Save option is disabled, perhaps indicating that no project change has been registered that would trigger a save? I’m using Xojo Project (Text) as the project type as I use Github.
  5. Quit Xojo.

If I repeat this, I get the same result.

Norman I wonder there might be an issue on my system to do with the separate, hidden file that you mention?

Edit: Just to clarify, I only mention the Save option in case it helps to pinpoint an issue. If I make changes so that Save is enabled, I still get the issue.[/quote]
I see the same thing. It seems that changing the simulator device no longer dirties the project?

That does seem to be the case

Only if you nuked your local copy and refetched from Github thereby wiping out the UIState file
Otherwise an update from github should not touch it leaving in whatever state it was last in

The steps you outlined though (quitting without saving) make it so whatever was in the UIState before will still be there & so your setting is not saved
It’s not surprising that doesn’t preserve the change

and that explains part of something else I’m working on today
<https://xojo.com/issue/41519>

[quote=227572:@Norman Palardy]Only if you nuked your local copy and refetched from Github thereby wiping out the UIState file
Otherwise an update from github should not touch it leaving in whatever state it was last in [/quote]

I can make this happen without touching Github.

[quote=227572:@Norman Palardy]The steps you outlined though (quitting without saving) make it so whatever was in the UIState before will still be there & so your setting is not saved
It’s not surprising that doesn’t preserve the change[/quote]

Yes except that, as I said, if I make a change to the project so that Save is available, and then save the project before quitting, I still have the issue.

Are you able to share the name of the separate, hidden file? Maybe there’s something wrong with it and it might help if I deleted it?

On OS X just use terminal and cd to the same location as your project
Then ls -al

It wont help much since the UIstate file is binary

The only one its marginally readable in is XML

What am I looking for?

My project.xojo_uistate is: -rw-r–r--@

So that means writable only by the owner, yeah?

In XML with contents in between
The contents are the ID of the simulator device
You’ll have to look in iOS Simulator like I mentioned before to match them up
Or it can be empty - which basically means default to the first item in the list

It’s possible it fails writing them
Take a copy, modify your project, save
diff the copy & the uistate

After changing the iOS Simulator device and saving the project the project uistate file is time-stamped two minutes after the copy I made before any changes but diffing the files produces no output which I think indicates they are identical.

yeah with a binary diff should say nothing (they are identical) or something like binaryfiles differ
but your permissions are the same as mine so that doesn’t seem like its the issue
Mine are
-rw-r–r--@ 1 npalardy 501 5344 8 Nov 14:32 .IDE.xojo_uistate
so I’m the owner and can read & write
Are you listed as the owner ?