I am looking for a way to extract my iPhone (OS v3.0) UUID without using iTunes. I tried "UUID Revealer" from Cydia Store but that is not working on my system. I could SSH with WinSCP and I have a Terminal Program Installed. Any chances using one of those tools (or another one) to bring to light my UUID? Thanks
Connect your iPhone to the Mac(mine is OS10.8).
Launch System Information under Utilies
the UUID of your iPhone is list under USB/iPhone/Serial Number
On an apt-compatible Linux use:
sudo apt-get install libimobiledevice-utils
Now you can do
idevice_id -l
to get the device UUID while it's connected by USB.
This is super easy on Windows.
You can also go to Control Panel > Devices and printers in win 7.
Plug in the phone
Device Manager > Iphone
Right - click
Properties > Hardware Tab
Properties > Details Tab
Property > Device Instance Path
UUID is the last device path listed.
USB\VID_05AC&PID_1297\UUID String
Enjoy skipping itunes installation.
There are probably 20 "UUID Display" apps in the app store. I think the best thing to do is to try a few and see what works for you. Like almost everything else in the App Store, the apps to show UUID is saturated.
HI just tried a free app (I have no affiliation with this app) and it worked on my 3G.
ShareAbout - Share Device ID on iTunes
Just go to Finder, find your device. Trust it, click xx.xxGB and it will switch among uuid、ime and xxx.GB. Right click the content and copy it. Done :)
You can get this by opening up XCode. The device will have a label called "Identifier". This is your UUID.
You could try iStat (99¢) from Bjango or you could plug your iPhone into your computer, and open the Organizer (Window » Organizer) and it will show it there). Or you could take #wkw's idea to do it programatically.
open cydia and at the bottom on the homescreen you'll find the UUID. no need for windows either
On VMWare:
open the VMWare-Logs (On Linux: in your VMWare Directory, vmware.log).
Plugin your Iphone and connect it in VMware as USB-Device
Search in the logs for: "USB: Device [name:Apple". In this Line, you find serialnum:. This is the UUID you"re searching for.
First of all, connect your iOS device to Linux/Unix machine, and then run this simple Linux command to get UDID:
lsusb -s `lsusb | grep "Apple" | cut -d ' ' -f 2`:`lsusb | grep "Apple" | cut -d ' ' -f 4 | sed 's/://'` -v | grep iSerial | awk '{print $3}'
or for some Linux distros, use this:
lsusb -s :`lsusb | grep iPhone | cut -d ' ' -f 4 | sed 's/://'` -v | grep iSerial | awk '{print $3}'
Related
How is it possible to get the versions of .war portlets of liferay 7.
For example in liferay 6.2 I had a .war, then it was exploded inside the tomcat webapps folder and I could get the versions with another script by just looking at some proeprties like the following:
TMP="$(cat $LIFERAY_FOLDER/tomcat-7.0.62/webapps/MyPortlet/WEB-INF/liferay-plugin-package.xml | awk -v FS="(MyPortlet-portlet/|/war)" '{print $2}' | grep "^.")"
echo -e "MyPortlet:\t\t\t$TMP" >> $OUTPUT_FILE
Or get the versions of some static files inside the porlet:
TMP="$(cat $LIFERAY_FOLDER/tomcat-7.0.62/webapps/MyPortlet/WEB-INF/src/content/Language_de.properties | awk -v FS="(TEXT_VERSION = )" '{print $2}' | grep "^.")"
echo -e "Text version of MyPortlet:\t\t$TMP">> $OUTPUT_FILE
How is it possible to have this versioning functionality in a production server with liferay 7.1+?
I need to be able to check automatically for the versions currently deployed. The gogo tool is not enabled in production mode by default, and I´ve found that the telnet access sometimes crashes the whole tomcat so is a no go option. And even so I´ve only seen that it allows to access toa bundle version but in anyway to some static files.
Thanks.
One way is to expose a custom remote service via /api/jsonws (with guest access) only to have the version.
You can retrieve the current bundle version using this code:
public String getVersion() {
Bundle bundle = FrameworkUtil.getBundle(XXXXImpl.class);
return bundle.getVersion().toString();
}
you can get a portlet version from gogo shell.
commands:
lb - list of bundles
b bundle_id - details of the bundle.
I get bunch of serial numbers when I explorer following.
cd ~/Library/Developer/CoreSimulator/Devices/
I exactly know which simulator (for example iPhone 5 with iOS8.1) I've used to run my application. But sometimes, I find it difficult to explore simulators to check documents directory & other stuff. Everything is with serial number.
Is there a trick to explore simulators with ease like follows?
iPhone 5 with iOS 8.1
iPhone 6 Plus with iOS 8.1 etc.
You can just run xcrun simctl list to see what each simulator device's UDID is or you can just pull it out of device.plist directly.
Here is an easy way to get to the simulator's tmp, documents or other folders of the app running in Simulator using Swift. Put this in the AppDelegate.swift didFinishLaunchWithOptions, and it will provide an output of the file path in the console window. Then you can copy that and paste into the Finder > Go > Go To Folder...
if UIDevice.currentDevice().model == "iPhone Simulator" || UIDevice.currentDevice().model == "iPad Simulator" {
var locale:String = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask).description
locale = (locale as NSString).substringFromIndex(8)
locale = (locale as NSString).substringWithRange(NSRange(location: 0, length:(locale as NSString).length - 1))
println("\n\n\(locale)\n\n")
}
Here's a sample output from the console window of Xcode:
/Users/brope001/Library/Developer/CoreSimulator/Devices/59E93965-6DEA-4A06-95EC-01FA155226D7/data/Containers/Data/Application/59115DEA-25C7-4400-8548-8A6ADD02E339/Documents/
Here is the shell script for above request.
cd ~/Desktop
mkdir Simulators_Shortcuts
destination="`pwd`/Simulators_Shortcuts"
cd $destination
cd ~/Library/Developer/CoreSimulator/Devices/
for d in *; do
if [ -d $d ] ; then
cd $d;
deviceName=`/usr/libexec/PlistBuddy -c "print :deviceType" device.plist | sed -e 's/com.apple.CoreSimulator.SimDeviceType.//g'`
osName=`/usr/libexec/PlistBuddy -c "print :runtime" device.plist | sed -e 's/com.apple.CoreSimulator.SimRuntime.//g'`
linkName="$deviceName-$osName"
currentPath=`pwd`
ln -s $currentPath "$destination/$linkName"
cd ..
fi
done
cd $destination
Here is the snap-shot of what is the output as folders.
XCode now keeps the logs from the previous runs handy which is great.
Is there a way to search though all of the logs.
My use case is I have seen a particular error but cant remember which run it was in. I need to find the error URL from the logs.
Xcode stores debug logs at
~/Library/Developer/Xcode/DerivedData/<YOURAPP>/Logs/Debug/
The .xcactivitylog files are actually just gz archives. Decompress them:
cd ~/Library/Developer/Xcode/DerivedData/<YOURAPP>/Logs/Debug/
EXT=".xcactivitylog"
for LOG in *.xcactivitylog; do
NAME=`basename $LOG $EXT`
gunzip -c -S $EXT "${NAME}${EXT}" > "${NAME}.log"
done
Now you can easily search them using grep or Spotlight or what your prefer.
To add onto #DrummerB answer. Once the files are unziped you can do a search with custom scope from within XCode. I prefer this to grep or spotlight.
The folder where these logs are is
~/Library/Developer/Xcode/DerivedData/[YOURAPPID]/Logs/Debug/
You can open/read/search them for example in TextWrangler.
I know of two ways of deleting an app under development from the emulator:
Using the emulator GUI: Settings >
Applications > Manage Applications >
Uninstall
Using ADB: adb uninstall
I may have discovered a third way, using 'adb shell':
rm /data/app/<package>.apk
It seems, however, that this isn't really a good way to delete apps because there may be additional information associated with it (registration?).
What is that information and where can it be found?
It's interesting you mention this. I ran a quick home made test to shed some light onto your question.
Generally, when you install a .apk file, Android creates an internal storage area for it located at /data/data/< package name of launching activity>. This is mainly used as an internal caching area that cant be accessed by other apps or the phone user. You can read up about that in a little bit more detail in the Internal storage chapter of Androids data storage section. It is an area exclusively used by your app and you can write private data there.
Once you uninstall an app theoretically, this internal storage area is also deleted. The first 2 ways which you outlined indeed does that: the .apk file in /data/app/ is deleted aswell as the internal storage area in /data/data/.
However if you used adb shell and run the rm command, all that is removed is the .apk file in /data/app/. The internal storage area in in /data/data/ is not deleted. So in essence you are correct that additional information with the app is not necessarily deleted. But on the flip side, if you reinstall the app after running the command, then the existing internal storage area gets overwritten as a fresh copy of it is being installed.
adb uninstall com.example.test
com.example.test may vary acording to your app.
I was having a problem with this too. I have Link2SD on my phone, but the ext4 partition on my SD card corrupted, so I reformatted, but all of the linked files were still in the /data/app folder. So I created a script to delete all broken links, and ran into the same problem as you, the app manager said they were still installed! so I made another script to fix that, using the pm program on your phone.
heres my code to remove broken links from the app folder:
fixln.sh
#!/system/bin/sh
#follow and fix symlinks
appfolder="/data/app/"
files=`ls ${appfolder}*`
fix=$1
badstring="No such file or directory"
for i in $files
do
if [ -h $i ]
then
if [ -a `readlink $i` ]
then
echo -e "\e[32m$i is good\033[0m";
else
if [ $fix == "fix" ]
then
`rm $i`
echo -e "\e[31m$i is bad, and was removed\033[0m";
else
echo -e "\e[31m$i is bad\033[0m";
if
fi
else
echo -e "\e[36m$i is not a symlink\033[0m";
fi
done
and heres my code to uninstall apps that have no apk:
fixmissing.sh
#!/system/bin/sh
#searches through a list of installed apps, and removes the ones that have no apk file
appfolder="/data/app/"
fix=$1
installed=`pm list packages -f -u`
for i in $installed
do
usefull=${i#*:}
filename=${usefull%=*}
package=${usefull#*=}
if [ -a $filename ]
then
echo -e "\e[32m$package ($filename) is good\033[0m"
else
if [ "$fix" == "fix" ]
then
uninstall=`pm uninstall $package`
if [ "$uninstall" == "Success" ]
then
echo -e "\e[31m$package ($filename) is bad, and was removed\033[0m"
else
echo -e "\e[31m$package ($filename) is bad, and COULD NOT BE REMOVED\033[0m"
fi
else
echo -e "\e[31m$package ($filename) is bad\033[0m"
fi
fi
done
copy these files to your phone, and run them with no arguments to see what they find, or add fix onto the end (fixmissing.sh fix) to make them fix what they find. Run at your own risk, and back up your files. I am not responsible if this code in any way wrecks anything.
If anyone wants to update/merge these scripts together, thats fine. these were just made to fix my problem, and they have done so, just thought I'd share them.
I believe any files the app has created on the sdcard would not be deleted.
There is another way - using the emulator like a real device -
locate the app in the emulator and drag it up to uninstall it.
This question already has answers here:
Adding images or videos to iPhone Simulator
(35 answers)
Closed 9 years ago.
I have photos on my Mac that I would like to add to the iPhone Simulator to test my application.
In other words: how do I add photos to the iPhone Simulator?
Edit : What about iphone Simulator 4.0 ? iphone Simulator 3.0 & 4.0 both working differently.
Thanks in advance for helping me...
Open the Window in mac where your images are stored.
Open your simulator another side.
Now drag your image from mac window to simulator,
simulator will open safari, and in a safari tab your image will be shown.
Tap & press down on image in simulator,
There will be message to "save image",
save image.
It will be added to your iPhone simulator.
Edit :
First just look at following image.
In iPhone simulator 4.0 ( iphone/iphone simulator ), itself it maintains a sqlite database for added images. So, if you want copy paste system - first make insert entries & then copy paste. That would be ridiculous way.
Ok. Let me explain simpler way of doing it.
open the finder in which you have bulk images that you want to add in simulator.
drag & drop first image into iphone simulator
on image - tap & hold for 1 second.
action sheet will appear - tap on save option
repeat same process for all images
this will do sqlite entries also.
now, open the /Users/YourUserName/Library/Application Support/iPhone Simulator/4.0
make a back up of Media directory. ( for example copy it & paste it on desktop )
when you reset your iphone simulator, all images will be gone
you need not to repeat all the process again, you have back up of it.
just copy & paste from back up to 4.0
A more easy to understand version of sagar's answer:
Open a Finder window to where your images are stored and the iPhone Simulator. Then drag the images from the Finder window into the simulator. The simulator will open Safari with your image. Click and hold to save the image to the iPhone camera roll. You can now use those images as you normally would.
I had the same question recently. The drop-the-photo-on-Safari approach works well enough if you're doing one at a time. For several images at once, I found a great blog post that explains where the simulator finds it's images.
The same poster links to a bash script to load a directory of images into the simulator. I now use this to reset my simulator's environment to a known good state as part of my build. That way, I can keep my images together with my code instead of depending on the state of the simulator's directory tree.
EDIT The original script was on a server that seems to be gone. I've pasted it here with the change needed for iPhone SDK 3.0. Credit for the script properly goes to the author of "Of Code and Men".
#!/bin/bash
simPath="$HOME/Library/Application Support/iPhone Simulator/User/Media/DCIM/100APPLE"
thmPath="$simPath/.MISC"
if [ -z "$1" ]; then
echo usage: $0 "<folder>"
exit 1
fi
if [ ! -d "$simPath" ]; then
mkdir -p "$simPath"
mkdir -p "$thmPath"
fi
# Find out which incremential number we're at currently.
index=1
for i in `ls $1/*.{jpg,png,gif,bmp} 2>/dev/null`; do
while [ -f "$simPath/`printf IMG_%04d.JPG $index`" ]; do
let index=$index+1
done
jpgName=`printf IMG_%04d.JPG $index`
thmName=`printf IMG_%04d.THM $index`
echo $i "->" $simPath/$jpgName
sips -s format jpeg $i --out "$simPath/$jpgName" > /dev/null 2> /dev/null || continue
sips -s format jpeg -z 96 96 $i --out "$thmPath/$thmName" > /dev/null 2> /dev/null || continue
let index=$index+1
done
For a few images:
Add image files to folder->
Add folder to xcode project->
(this will keep everything together for this project and folder can be removed from project at your discretion)
open xcode and simulator in same window->
open "photos app" in simulator->
drag and drop from xcode to simulator->
(image(s) will open in safari)
click and hold image in simulator->
chose save->
Image(s) will now be in the 'photos app' album in simulator. This was quickest and cleanest way for me.
3 Simple Steps
1) Drag & Drop image onto simulator
- this will open a browser with your image
2) Click & hold image
- this will open options
3) save image
- this will copy image onto simulator
Watch YouTube Video ( add images to iphone simulator)
I've edited the script to create a structure that works with the iPhone 4.0.1 simulator. On my system I have subfolders for iphone simulator 3.2, 4.0 and 4.0.1. So I've kept the original output of the script and modified the structure as it needs to create a PhotoData folder for the thumbnails. After running the script I create sym links for the 3.2 4.0 and 4.0.1 simulator directories as follows:
ln -s $HOME/Library/Application\ Support/iPhone\ Simulator/User/Media/DCIM/ $HOME/Library/Application\ Support/iPhone\ Simulator/4.0.1/Media/DCIM
ln -s $HOME/Library/Application\ Support/iPhone\ Simulator/User/Media/PhotoData/ $HOME/Library/Application\ Support/iPhone\ Simulator/4.0.1/Media/PhotoData
future runs of the script will update all simulators. Here's the modified script:
#!/bin/bash
rootPath="$HOME/Library/Application Support/iPhone Simulator/User/Media"
relPath="100APPLE"
simPath="$rootPath/DCIM/$relPath"
thmPath="$rootPath/PhotoData/$relPath"
if [ -z "$1" ]; then
echo usage: $0 "<folder>"
exit 1
fi
if [ ! -d "$simPath" ]; then
mkdir -p "$simPath"
mkdir -p "$thmPath"
fi
echo "Finding pictures..."
# Find out which incremential number we're at currently.
index=1
for i in `ls $1/*.{JPG,jpg,png,gif,bmp} 2>/dev/null`; do
echo "considering $i..."
while [ -f "$simPath/`printf IMG_%04d.JPG $index`" ]; do
let index=$index+1
done
jpgName=`printf IMG_%04d.JPG $index`
thmName=`printf IMG_%04d.THM $index`
echo $i "->" $simPath/$jpgName
echo $i "->" $thmPath/$thmName
sips -s format jpeg $i --out "$simPath/$jpgName" > /dev/null 2> /dev/null || continue
sips -s format jpeg -z 96 96 $i --out "$thmPath/$thmName" > /dev/null 2> /dev/null || continue
let index=$index+1
done
I've been updating the script to try and add enough data to the SqlLite databases. As soon as you save a photo from safari the following data is entered:
sqlite> select * from Photo;
primaryKey|type|title|captureTime|width|height|userRating|flagged|thumbnailIndex|orientation|directory|filename|duration|recordModDate
43|0|IMG_0037|320336214.0|640|427|0|0|0|1|DCIM/100APPLE|IMG_0037.JPG|0.0|320336214.933387
sqlite> select * from PhotoExtras;
primaryKey|foreignKey|identifier|sequence|value
142|43|1|-1|DCIM/100APPLE
143|43|2|-1|IMG_0037.JPG
144|43|3|-1|76616
145|43|6|-1|
streamtyped???#???NSMutableDictionary
146|43|7|-1|286
147|43|8|-1|
streamtyped???#???NSValue
148|43|9|-1|8252
149|43|10|-1|1
150|43|13|-1|0
The Photo table data seems quite simple although I'm currently assuming captureTime is not relevant. The PhotoExtras stuff is a bit more involved and seems necessary as my current script, which needs image magicks identify command, is not working.
identifier 1 is directory name
identifier 2 is jpg name
identifier 3 is file size in bytes
If anyone can help with the others..
The script as it stands is below:
#!/bin/bash
rootPath="$HOME/Library/Application Support/iPhone Simulator/4.2/Media"
relPath="100APPLE"
simPath="$rootPath/DCIM/$relPath"
sqlDB="$rootPath/PhotoData/Photos.sqlite"
if [ -z "$1" ]; then
echo usage: $0 "<folder>"
exit 1
fi
if [ ! -d "$simPath" ]; then
mkdir -p "$simPath"
fi
echo "Finding pictures..."
# Find out which incremential number we're at currently.
index=1
for i in `ls $1/*.{JPG,jpg,png,gif,bmp} 2>/dev/null`; do
echo "considering $i..."
while [ -f "$simPath/`printf IMG_%04d.JPG $index`" ]; do
let index=$index+1
done
imgName=`printf IMG_%04d $index`
jpgName=`printf IMG_%04d.JPG $index`
thmName=`printf IMG_%04d.THM $index`
jpgWidth=`identify -format %w $i`
jpgHeight=`identify -format %h $i`
echo $i "->" $simPath/$jpgName
jpgSize=`stat -f %z $i`
jpgDir="DCIM/100APPLE"
sips -s format jpeg $i --out "$simPath/$jpgName" > /dev/null 2> /dev/null || continue
sqlite3 "$sqlDB" "insert into Photo (title,width,height,directory,filename) values ('$imgName',$jpgWidth,$jpgHeight,'$jpgDir','$jpgName')"
foreignKey=`sqlite3 "$sqlDB" "select primaryKey from Photo where title='$imgName'"`
sqlite3 "$sqlDB" "insert into PhotoExtras (foreignKey,identifier,value) values ($foreignKey,1,'$jpgDir'); \
insert into PhotoExtras (foreignKey,identifier,value) values ($foreignKey,2,'$jpgName'); \
insert into PhotoExtras (foreignKey,identifier,value) values ($foreignKey,3,$jpgSize);"
let index=$index+1
done
I'll edit if I get further, the next stage is identifying what the various .ithmb files contain. Hopefully some sort of stack of jpg thumbnails.
I've been using an automated technique I originally found at iPhone Dev SDK. Include the images in your app's resources, then:
UIImage *image = [UIImage imageWithName:#"imageName.jpg"];
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
http://www.iphonedevsdk.com/forum/iphone-sdk-development/2225-no-photos-in-iphone-simulator-how-to-add-photos.html