Skip to content

Commit 9ddcc8b

Browse files
committed
error fixing
1 parent c46a896 commit 9ddcc8b

5 files changed

Lines changed: 113 additions & 2 deletions

File tree

resources/clean/adb.txt

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
### Android Debug Bridge :more information from:
2+
http://developer.android.com/guide/developing/tools/adb.html
3+
4+
[Press ENTER to continue reading, or Control+C to Quit]
5+
6+
Android Debug Bridge (adb) is a versatile command line tool that
7+
lets you communicate with an emulator instance or connected
8+
Android-powered device. It is a client-server program that includes
9+
three components:
10+
- A client, which runs on your development machine. You can
11+
invoke a client from a shell by issuing an adb command. Other
12+
Android tools such as the ADT plugin and DDMS also create
13+
adb clients.
14+
- A server, which runs as a background process on your
15+
development machine. The server manages communication
16+
between the client and the adb daemon running on an emulator
17+
or device.
18+
- A daemon, which runs as a background process on each
19+
emulator or device instance.
20+
21+
### Issuing adb Commands
22+
23+
You can issue adb commands from a command line on your development machine or from a script. The usage is:
24+
25+
adb [-d|-e|-s <serialNumber>] <command>
26+
27+
### Commands
28+
29+
adb devices
30+
- Prints a list of all attached emulator/device instances.
31+
32+
adb help
33+
- Prints a list of supported adb commands.
34+
35+
adb version
36+
- Prints the adb version number.
37+
38+
adb logcat
39+
- Prints log data to the screen.
40+
41+
adb bugreport
42+
- Prints dumpsys, dumpstate, and logcat data to the screen, for
43+
the purposes of bug reporting.
44+
45+
adb jdwp
46+
- Prints a list of available JDWP processes on a given device.
47+
48+
adb install <path-to-apk>
49+
- Pushes an Android application (specified as a full path to
50+
an .apk file) to the data file of an emulator/device.
51+
52+
adb pull <remote> <local>
53+
- Copies a specified file from an emulator/device instance to your
54+
development computer.
55+
56+
adb push <local> <remote>
57+
- Copies a specified file from your development computer to an
58+
emulator/device instance.
59+
60+
adb start-server
61+
- Checks whether the adb server process is running and starts it,
62+
if not.
63+
64+
adb kill-server
65+
- Terminates the adb server process.
66+
67+
adb shell
68+
- Starts a remote shell in the target emulator/device instance.
69+
70+
adb shell stop
71+
- Stops execution of an emulator/device instance.
72+
73+
adb shell start
74+
- Starts (restarts) an emulator/device instance.
75+

resources/clean/zipalign.pdf

-101 KB
Binary file not shown.

resources/clean/zipalign.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Zipalign: an Easy Optimization :more info here:
2+
http://developer.android.com/resources/articles/zipalign.html
3+
4+
[Press ENTER to continue reading, or Control+C to quit]
5+
6+
The Android SDK includes a tool called zipalign that optimizes the way an application is packaged. Running zipalign against your application enables Android to interact it more efficiently at run time and thus has the potential to make it and the overall system run faster. We strongly encourage you to use zipalign on both new and already published applications and to make the optimized version available - even if your application targets a previous version of Android. This article describes how zipalign helps performance and how to use it to optimize your app.
7+
8+
In Android, data files stored in each application's apk are accessed by multiple processes: the installer reads the manifest to handle the permissions associated with that application; the Home application reads resources to get the application's name and icon; the system server reads resources for a variety of reasons (e.g. to display that application's notifications); and last but not least, the resource files are obviously used by the application itself.
9+
10+
The resource-handling code in Android can efficiently access resources when they're aligned on 4-byte boundaries by memory-mapping them. But for resources that are not aligned (that is, when zipalign hasn't been run on an apk), it has to fall back to explicitly reading them - which is slower and consumes additional memory.
11+
12+
For an application developer, this fallback mechanism is very convenient. It provides a lot of flexibility by allowing for several different development methods, including those that don't include aligning resources as part of their normal flow.
13+
14+
Unfortunately, for users the situation is reversed - reading resources from unaligned apks is slow and takes a lot of memory. In the best case, the only visible result is that both the Home application and the unaligned application launch slower than they otherwise should. In the worst case, installing several applications with unaligned resources increases memory pressure, thus causing the system to thrash around by having to constantly start and kill processes. The user ends up with a slow device with a poor battery life.
15+
16+
Luckily, it's very easy for you to align the resources in your application:
17+
18+
>Using ADT:
19+
*The ADT plugin for Eclipse (starting from version 0.9.3) will automatically align release application packages if the export wizard is used to create them. To use the wizard, right click the project and choose "Android Tools"
20+
>> "Export Signed Application Package..." It can also be accessed from the first page of the AndroidManifest.xml editor.
21+
22+
>Using Ant:
23+
*The Ant build script (starting from Android 1.6) can align application packages. Targets for older versions of the Android platform are not aligned by the Ant build script and need to be manually aligned.
24+
*Starting from the Android 1.6 SDK, Ant aligns and signs packages automatically, when building in debug mode.
25+
*In release mode, Ant aligns packages only if it has enough information to sign the packages, since aligning has to happen after signing. In order to be able to sign packages, and therefore to align them, Ant needs to know the location of the keystore and the name of the key in build.properties. The name of the properties are key.store and key.alias respectively. If those properties are present, the signing tool will prompt to enter the store/key passwords during the build, and the script will sign and then align the apk file. If the properties are missing, the release package will not be signed, and therefore will not get aligned either.
26+
27+
>Manually:
28+
*In order to manually align a package, zipalign is in the tools/ folder of Android 1.6 and later SDKs. You can use it to align application packages targeting any version of Android. You should run it only after signing the apk file, using the following command:
29+
30+
zipalign -v 4 source.apk destination.apk
31+
32+
>Verifying alignment:
33+
*The following command verifies that a package is aligned:
34+
zipalign -c -v 4 application.apk
35+
36+
We encourage you manually run zipalign on your currently published applications and to make the newly aligned versions available to users. Also, don't forget to align any new applications going forward!

utility/apk_compress

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ COMP=5
6767
d=$HOME/android-utility/working-folder/mod-here-multi
6868
e=$d/original_apps
6969
cd $d
70-
ECHO "Welcome to Apk Compression Manager"
70+
echo "Welcome to Apk Compression Manager"
7171
echo
7272
echo "Compression Level set to $COMP"
7373
echo "[0 = no compression | 9 = high compression]"

utility/zipped_up

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ read num
114114
case $num in
115115
1) clear; zip_it; zipped_up;;
116116
2) clear; check_it; zipped_up;;
117-
3) open $HOME/android-utility/resources/clean/zipalign.pdf; enter; zipped_up;;
117+
3) cat $HOME/android-utility/resources/clean/zipalign.txt | more; enter; zipped_up;;
118118
q) clear; exit;;
119119
*) echo; echo "Not a Valid Option" ; echo; enter; zipped_up;;
120120
esac

0 commit comments

Comments
 (0)