Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Leonardo.Rojas · Apr 04, 2014 at 11:12 PM · iospersistentdatapath

Persistent data path changes every time a new version of the IOS app is generated

Hi,

We are working on Unity 4.2.2 and Unity 4.3.4 and we are getting an issue with Application.persistentDataPath, when we update/generate/build a new app version the Application.persistentDataPath changes using a new GUID on the path.

In the Application.persistentDataPath documentation (https://docs.unity3d.com/Documentation/ScriptReference/Application-persistentDataPath.html) says "If you keep the same Bundle Identifier in future versions then the app will continue accessing the same location on every update.". But it isn't happening.

This is our test code:

 using UnityEngine;
 using System.Collections;
 
 public class PersistenDataPathTest : MonoBehaviour 
 {
     void OnGUI()
     {
         GUI.Button(new Rect(30f,30f,550f,50),Application.persistentDataPath);
     }
 }
 


Steps to reproduce this issue:

  1. Create an empty project with an empty scene, create an empty game object and assign a script with the test code.

  2. Set the bundle identifier and the app version (1.0.0)

  3. Generate the Xcode project for IOS.

  4. Run the test app on a device with iOS 7.

  5. Take a screenshot to backup the current Application.persistentDataPath.

  6. Generate a new Xcode project for IOS but this time with the app version in 1.0.1 (just change the version, don't change the anything else).

  7. Update the app in the device (without remove it).

  8. Notice, the Application.persistentDataPath displayed in the GUI button is different to the old one ( the persistent data path that is in the screenshot ).

Is this supposed to happen?

Is there any way to force the "Application.persistentDataPath" to be the same path on each version of the application?

Should we use a different path to save our data (not using Application.persistentDataPath)?

Thank you in advance for your help.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jargonaut · Nov 24, 2014 at 08:34 PM 0
Share

We're seeing the same issue using Xcode 6.1 with Unity 4.5.5. We didn't see the issue using Xcode 5.

Is there any resolution to this?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by walter_dev · Dec 10, 2014 at 03:27 PM

I don't know about iOS 7 but on iOS 8 the Persistent data path changes every time you run the app, you don't have to worry about this, if you store a file in a previous run it will be present in the changed data path. Forcing to be the same every time isn't possible because this is handled by iOS private code.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

23 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Download then open image on IOS 0 Answers

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

file saved to iOS persistent directory exists during session but is gone next session 0 Answers

How do you create a subfolder inside persistentDataPath in iOS? 0 Answers

How to download asset bundles and storing it locally in ios 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges