Where Does Simulator 8.0 Store Files - ios-simulator

I cannot find the directory for the new simulator data in Xcode-6 Beta for IOS 8
It is not in
~/Library/Application Support/IPhone Simulator/
Where does the iPhone Simulator store its data?

Something like this:
/Users/{YOUR NAME}/Library/Developer/CoreSimulator/Devices/{DEVICE ID}/data/Containers/Data/Application/{APPLICATION ID}/
The Device ID can be a bit hard to find (basically, there's one folder with a random-looking name for each simulator you have). To get to the correct folder, I used this terminal command:
find ~ -name myFile.txt
Where myFile.txt was one of the files in my application. The terminal then printed out the full location—this might be more useful to you then checking each one-by-one, if you have a file (or, can make one) that you can search for.

In XCode 6 it's really hard to find out. But I do this in the simple way:
With XCode opened just write this in Debug Area:
po [NSBundle mainBundle]
Or logging:
NSLog(#"%#", [NSBundle mainBundle]);
The result is something like that:
After that you can open Terminal app and go to path with this command:
open yourAppPath...
[Update]
I found an amazing app to do this: http://simpholders.com/

To locate the Documents folder of an app in iOS 8 Simulator, you can first write a file in the Documents folder:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *fileName = [documentsDirectory stringByAppendingPathComponent:#"Words.txt"];
NSString *content = #"Apple";
[content writeToFile:fileName atomically:NO encoding:NSStringEncodingConversionAllowLossy error:nil];
say, in didFinishLaunchingWithOptions.
Then you can open a Terminal and find the folder:
$ find ~/Library -name Words.txt

Ok, I was frustrated trying to find things manually. Ill keep my notes above to show what does NOT seem to work.
What DOES work, and is a great relief to me, is SimPHolders. Google it. Download it. Run it. Enjoy.

Simulators directory in XCode6 is moved to:
Library ▸ Developer ▸ CoreSimulator
Full Path to Application folder:
~/ ▸ Library ▸ Developer ▸ CoreSimulator ▸ Devices ▸ 5D71993D-78C2-49F4-9B30-99D0307D3A2F ▸ data ▸ Containers ▸ Data ▸ Application ▸ AE50273B-993C-45DA-97E8-3F88E4B64BDE ▸ Documents ▸ xyz.sqlite

With the simulator open, go to Hardware->Devices->Manage Devices.
A Window shows, outlining each of the simulators available, and the Unique Identifier that goes with each one.
Therefore, after you have navigated in Finder to ~Library/Developer/CoreSimulator as others describe above, you can tell which of the directories therein contains the simulator you want, by looking for the Unique Identifier.
Once inside there, you still need to drill down further... in my case I found I had to navigate into data/Containers/Data/Application, then look for the folder inside that had todays date.
Finally! I arrived at my familiar Documents and Library folders.
Thanks Apple once again, for keeping us iOS developers gainfully employed!

You can add NSLogs in application delegate "didFinishLaunchingWithOptions" method, so they print your paths
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#if TARGET_IPHONE_SIMULATOR
NSLog(#"APP BUNDLE :: %#", [NSBundle mainBundle]);
NSLog(#"APP DOCUMENTS :: %#", [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]);
#endif
...

Related

QT: No rule to make target 'res/resources.qrc'

I've switched versions of QT (from 5.10.1 to 5.12.2) to get a more recent version of Mingw32 (from GCC/G++ 5.3 -> 7.3). The reasoning behind this is that have multiple products using the same library and using an old version of gcc is less than ideal. We've never had any issues with build before, but now I get the following error:
":-1: error: No rule to make target 'res/resources.qrc', needed by 'release/qrc_resources.cpp'. Stop."
Oddly enough, it does not stop the build from generating a completely functioning executable.
So far I've tried:
Cleaning the directory and building again
Deleting the build directory and building again
Not selecting shadow build option
Forcing Qmake (Build -> Run Qmake)
Creating a new .pro.user file
Deleting the whole repo, cloning it again, rebuilding the dependencies (we have a library which it relies on) and rebuilding QT
Adding the .qrc file to the includes (I know this was silly, but I was at my wits end)
Checking for deleted files (None that I can see)
Checking file names for inconsistencies(They seem ok)
Here is my qrc file
<RCC>
<qresource prefix="/">
<file>images/cnctbtn_connected.png</file>
<file>images/cnctbtn_connecting.png</file>
<file>images/cnctbtn_disconnected.png</file>
<file>images/configbtn.png</file>
<file>images/flash.png</file>
<file>images/logbtn.png</file>
<file>images/streambtn_start.png</file>
<file>images/streambtn_stop.png</file>
<file>images/d_logo_outlined.ico</file>
<file>images/d_logo_small.png</file>
<file>images/d_logo_small_outlined.png</file>
</qresource>
</RCC>
The list of resources which are located in the images folder
cnctbtn_connected.png
cnctbtn_connecting.png
cnctbtn_disconnected.png
configbtn.png
d_logo_small.png
d_logo_small_outlined.png
flash.png
logbtn.png
streambtn_start.png
streambtn_stop.png
d_logo_outlined.ico
The qrc_resource_File.cpp also looks ok. I see the bytes of the images in it, their names and assorted namespace declarations and functions in that name space.
The one thing I'm unsure of is why the images folder has it's on name in the resource name list.
Note: I've removed the bytes in this array, for my eyes and yours.
static const unsigned char qt_resource_name[] = {
// images
// cnctbtn_disconnected.png
// cnctbtn_connected.png
// cnctbtn_connecting.png
// streambtn_start.png
// d_logo_outlined.ico
// d_logo_small.png
// streambtn_stop.png
// d_logo_small_outlined.png
};
Ideally there would be no build error, which I don't really understand since I can see and use the executable produced. If you need any other information, don't hesitate to ask!

Upload dSYMS to Firebase via Fastlane

I am struggling to upload dSYM files to Firebase via Fastlane. I have a lane that looks like the following:
desc "Fetch and upload dSYM files to Firebase Crashlytics"
lane :refresh_dsyms_firebase do |options|
download_dsyms(version: options[:version])
upload_symbols_to_crashlytics(gsp_path: "./App/GoogleService-Info.plist")
clean_build_artifacts
end
I confirmed that that is the correct path to the plist file, but when I try to run the lane at first I see the following:
[17:22:47]: invalid byte sequence in UTF-8
[17:22:47]: invalid byte sequence in UTF-8
[17:22:47]: invalid byte sequence in UTF-8
and then one of these for every dSYM file found:
[17:22:48]: Uploading '70DBE65E-227E-3754-89F2-EEFA6B8EEC2F.dSYM'...
[17:22:48]: Shell command exited with exit status instead of 0.
I am trying to determine exactly what I am missing from this process. Does anyone have ideas? I am fairly new to Fastlane, so definitely assume I could be missing something basic. (Although, that empty exit status is a bit weird).
fastlane 2.107.0
EDIT(June 7th: 2021):
I updated the answer from my own to one that was helpful to me at the time this was written.
There are many other great answers on this page on using Fastlane as well - please check them out
This may not be an option for most, but I just ended up fixing this by starting over. It may not be entirely obvious if you came over from Fabric, but I figured I would just rip off the band aid. My original setup was using the Fabric(Answers)/Firebase Crashlytics which is the Fabric->Firebase migration path, although subtle, the configuration between the two are slightly different and cause issues with upload_symbols_to_crashlytics
Remove support for Fabric answers, or replace with https://firebase.google.com/docs/analytics/ios/start
Remove the Fabric declaration in Info.plist
Modify your existing run script in BuildPhases: replace your existing runscript with "${PODS_ROOT}/Fabric/run" and add $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH) to input files
In you AppDelegate remove Fabric.with([Crashlytics.self]) and you can also kill the import Fabric as this is now covered by Firebase
Unlink fabric, re-onboard Firebase crashlytics, and select new integration.
desc "Upload any dsyms in the current directory to crashlytics"
lane :upload_dsyms do |options|
download_dsyms(version: version_number, build_number: build_number)
upload_symbols_to_crashlytics(gsp_path: "./App/Resources/GoogleService-Info.plist")
clean_build_artifacts
end
anyone interested in this can follow the thread here: https://github.com/fastlane/fastlane/issues/13096
TL;DR: When you call
upload_symbols_to_crashlytics(gsp_path: "./App/GoogleService-Info.plist")
It will call a binary from the installed Fabric pod called upload_symbols and will look something like this:
./Pods/Fabric/upload-symbols -a db4d085462b3cd8e3ac3b50f118e273f077497b0 -gsp ./App/GoogleService-Info.plist -p ios /private/var/folders/x1/x6nqt4997t38zr9x7zwz72kh0000gn/T/d30181115-8238-1fr38bo/D4CE43B9-9350-3FEE-9E71-9E31T39080CD.dSYM
You'll notice that it calls it using both the Fabric API key and the GoogleService-Info.plist path. I do not know why but this will cause it not to upload. You'll have to temporarily remove the fabric configuration information from your Info.plist file before running the fastlane lane. (remember to re-add the fabric configuration).
First, you need to use upload_symbols_to_crashlytics but before to use it you will need to download your dsyms from App Store Connect and to do that you should use download_dsyms with some parameters version and build_number and the Fastlane will ask you about your app_identifier so I advise you to use it to not interrupt the build until getting your answer.
desc "Upload any dsyms in the current directory to Crashlytics of firebase"
lane :upload_dsyms do |options|
version_number = get_version_number(target: "your_app_target")
build_number = get_build_number
download_dsyms(
app_identifier: "your_app_identifier",
version: version_number,
build_number: build_number
)
upload_symbols_to_crashlytics(gsp_path: "./your_app_name or your_app_target/another_directroy/GoogleService-Info.plist")
clean_build_artifacts
end
my app was
desc "Upload any dsyms in the current directory to Crashlytics of firebase"
lane :upload_dsyms do |options|
version_number = get_version_number(target: "Movies")
build_number = get_build_number
download_dsyms(
app_identifier: "com.vngrs.Movies.demo",
version: version_number,
build_number: build_number
)
upload_symbols_to_crashlytics(gsp_path: "./Movies/Resources/GoogleService-Info.plist")
clean_build_artifacts
end
Details
Xcode Version 11.3.1 (11C504)
Firebase tools 7.14.0
Fastlane 2.143.0
Solution
./fastlane/Pluginfile
gem 'fastlane-plugin-firebase_app_distribution'
Lane
before_all do
# Update fastlane
update_fastlane
# Update fastlane plugins
sh("fastlane update_plugins")
# Update firebase tools
sh("curl -sL firebase.tools | upgrade=true bash")
end
Usage 1.
Download dsyms from AppStore and upload to firebase
download_dsyms(version: '1.0', build_number: '1')
upload_symbols_to_crashlytics(gsp_path: "./App/Environment/production/GoogleService-Info-production.plist")
Usage 2.
Get dsyms from archive (after build) and upload to firebase
gym(
configuration: 'Release',
scheme: 'MyApp',
include_bitcode: true
)
upload_symbols_to_crashlytics(gsp_path: "./App/Environment/production/GoogleService-Info-production.plist")
Info
get_version_number
download_dsyms
sh
update_fastlane
upload_symbols_to_crashlytics
This worked for me
desc "Downlaod and Uplaod dSYMS to Firebase"
lane :uplaod_dsyms do
download_dsyms # This will download all version
upload_symbols_to_crashlytics(
gsp_path: "Path to your google plist",
binary_path: "./Pods/FirebaseCrashlytics/upload-symbols") # this goes to cocoapods of FirebaseCrashlytics
clean_build_artifacts # Delete the local dSYM files
end
This works for me.
1. Create a new lane on Fastfile
# Fastfile
default_platform(:ios)
# Constants
XCODE_PROJECT = "PROJECT.xcodeproj"
XCODE_WORKSPACE = "PROJECT.xcworkspace"
PRODUCTION_GSP_PATH = "./APP_ROOT/GoogleService-Info.plist"
platform :ios do
desc "Push a production build to TestFlight"
lane :upload_crashlytics_prod do
download_dsyms(
version: get_version_number(xcodeproj: XCODE_PROJECT),
build_number: get_build_number(xcodeproj: XCODE_PROJECT)
)
upload_symbols_to_crashlytics(gsp_path: PRODUCTION_GSP_PATH)
end
end
2. Now call from your shell script or terminal
fastlane upload_crashlytics_prod

How to package Qt5 application with snapcraft

I'm trying to create snap package of a Qt/QML application, the application is packaged well, when I try to run it I get /snap/swipe-app/x2/bin/qt5-launch: 74: exec: application: not found error.
here's my snapcraft.yaml file
name: swipe-app # you probably want to 'snapcraft register <name>'
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: description
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots
apps:
swipe-app:
command: qt5-launch application
plugs:
- unity7
- home
parts:
application:
# See 'snapcraft plugins'
plugin: qmake
project-files: ["snap.pro"]
source: .
build-packages:
- qtbase5-dev
stage-packages:
# Here for the plugins-- they're not linked in automatically.
- libqt5gui5
after: [qt5conf] # A wiki part
As you have told the launch script that your program is called application then it will try to execute application from the current working directory when you run your snap. There are two things to note here:
The working directory is preserved from the terminal outside the snap context. For example if you are in your home directory /home/your-user then the working directory for swipe-app will also be /home/your-user.
As the working directory above is your home directory then commands without any anchor, such as application, will try to execute in your home directory. So in your example the launch script will attempt to run the command equivalent of /home/your-user/application.
You can fix this by either ensuring that the launch script executes a cd to change the working directory, e.g. cd $SNAP; or anchor your command by adding an achor, e.g. command: qt5-launch $SNAP/application.
Another thing you might need to check is that your qmake build actually outputs a binary called application. If you have not set TARGET= in your snap.pro project file then the binary will default to being called snap, not application. The line should read TARGET=application to make a binary called application: (ref: https://doc.qt.io/qt-5/qmake-variable-reference.html#target).

libpng containing a security vulnerability Warning

I have question about a warning that I received yesterday in google play developer console, below I attached a image.
It's about libpng library security vulnerability.
I think that I don't use this library in my project or if I use it I cannot find it.
In my project I use the following libraries:
AdvancedLayers-1.0-20150422.082825-48;
greendao-1.3.7; jts-1.13; jump-core-1.2;
nutiteq-3d-sdk-2.4.2-22042015;
shapefilereader-1.0;
Can somebody tell me how to fix this problem?
Thank you!
A simple fix is to extract the following zip file into your “cocos2dx\platform\third_party\android\prebuilt” folder:
Download the fix from here:
libpng_fix.zip for Cocos2d-x 2.x
And change “Android.mk” file under “cocos2dx” folder:
Change:
LOCAL_WHOLE_STATIC_LIBRARIES := cocos_libpng_static
to
LOCAL_WHOLE_STATIC_LIBRARIES := cocos_libzlib_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_libpng_static
Change:
$(call import-module,libpng)
to:
$(call import-module,libzlib)
$(call import-module,libpng)
courtesy: Bengigi Apps and Games

Can Ansible unarchive be made to write static folder modification times?

I am writing a build process for a WordPress installation using Ansible. It doesn't have a application-level build system at the moment, and I've chosen Ansible so that it can cleanly integrate with server build scripts, so I can bring up a working server at the touch of a button.
Most of my WordPress plugins are being installed with the unarchive feature, pointing to versioned plugin builds on the official wordpress.org installation server. I've encountered a problem with just one of these, which is that it is always being marked as "changed" even though the files are exactly the same.
Having examined the state of ls -Rl before and after, I noticed that this plugin (WordPress HTTPS) is the only one to use internal sub-directories, and upon each decompression, the modification time of folders is getting bumped.
It may be useful to know that this is a project build script, with a connection of local. I guess therefore that means that SSH is not being used.
Here is a snippet of my playbook:
- name: Install the W3 Total Cache plugin
unarchive: >
src=https://downloads.wordpress.org/plugin/w3-total-cache.0.9.4.1.zip
dest=wp-content/plugins
copy=no
- name: Install the WP DB Manager plugin
unarchive: >
src=https://downloads.wordpress.org/plugin/wp-dbmanager.2.78.1.zip
dest=wp-content/plugins
copy=no
# #todo Since this has internal sub-folders, need to work out
# how to preserve timestamps of the original folders rather than
# re-writing them, which forces Ansible to record a change of
# server state.
- name: Install the WordPress HTTPS plugin
unarchive: >
src=https://downloads.wordpress.org/plugin/wordpress-https.3.3.6.zip
dest=wp-content/plugins
copy=no
One hacky way of fixing this is to use ls -R before and after, using options to include file sizes but not timestamps, and then md5sum that output. I could then mark it as changed if there is a change in checksum. It'd work but it's not very elegant (and I'd want to do that for all plugins, for consistency).
Another approach is to abandon the task if a plugin file already exists, but that would cause problems when I bump the plugin version number to the latest copy.
Thus, ideally, I am looking for a switch to present to unarchive to say that I want the folder modification times from the zip file, not from playbook runtime. Is it possible?
Update: a commenter asked if the file contents could have changed in any way. To determine whether they have, I wrote this script, which creates a checksum for (1) all file contents and (2) all file/directory timestamps:
#!/bin/bash
# Save pwd and then change dir to root location
STARTDIR=`pwd`
cd `dirname $0`/../..
# Clear collation file
echo > /tmp/wp-checksum
# List all files recursively
find wp-content/plugins/wordpress-https/ -type f | while read file
do
#echo $file
cat $file >> /tmp/wp-checksum
done
# Get checksum of file contents
sha1sum /tmp/wp-checksum
# Get checksum of file sizes
ls -Rl wp-content/plugins/wordpress-https/ | sha1sum
# Go back to original dir
cd $STARTDIR
I ran this as part of my playbook (running it in isolation using tags) and received this:
PLAY [Set this playbook to run locally] ****************************************
TASK [setup] *******************************************************************
ok: [localhost]
TASK [jonblog : Run checksum command] ******************************************
changed: [localhost]
TASK [jonblog : debug] *********************************************************
ok: [localhost] => {
"checksum_before.stdout_lines": [
"374fadc4df1578f78fd60b1be6758477c2c533fa /tmp/wp-checksum",
"10d66f7bdbbdd3af531d1b11a3db3059a5868838 -"
]
}
TASK [jonblog : Install the WordPress HTTPS plugin] ***************
changed: [localhost]
TASK [jonblog : Run checksum command] ******************************************
changed: [localhost]
TASK [jonblog : debug] *********************************************************
ok: [localhost] => {
"checksum_after.stdout_lines": [
"374fadc4df1578f78fd60b1be6758477c2c533fa /tmp/wp-checksum",
"719c9da94b525e723b1abe188ee9f5bbaf121f3f -"
]
}
PLAY RECAP *********************************************************************
localhost : ok=6 changed=3 unreachable=0 failed=0
The debug lines reflect the checksum hash of the contents of the files (this is identical) and then the checksum hash of ls -Rl of the file structure (this has changed). This is in keeping with my prior manual finding that directory checksums are changing.
So, what can I do next to track down why folder modification times are incorrectly flagging this operation as changed?
Rather than overwriting all files each time and find a way to keep the same modification datetime, you may want to use the creates option of the unarchive module.
As you maybe already know, this tells Ansible that a specific file/folder will be created as a result of the task. Thus, next time the task will not be run again if that file/folder already exists.
See http://docs.ansible.com/ansible/unarchive_module.html#options
My solution is to modify the checksum script and to make that a permanent feature of the Ansible process. It feels a bit hacky to do my own checksumming, when Ansible should do it for me, but it works.
New answers that explain that I am doing something wrong, or that a new version of Ansible fixes the problem, would be most welcome.
If I get a moment, I will raise this as a possible bug with the Ansible team. However I do sometimes wonder about the effort/reward ratio when raising bugs on a busy tracker - I already have one item outstanding, it has been waiting a while, and I've chosen to work around that too.
Update (18 months later)
This Ansible build system never made it into live. It felt like I was always working around something. Recently, when I decided I needed to move my blog to another server, I finally Dockerised it. This took several weeks (since there is a surprising amount of things to think about in a real WordPress installation) but in general I found the process much nicer than using orchestration tools.

Resources