??????????????????????????Robotium
???????????? ???????[ 2015/8/5 13:56:11 ] ??????????????? ?????????
????????4????????????????????android????????????????????????????????????????????????????????????????wed?????????????????????????????????????????????????????????.
?????????????????????????????????????????apk?????????????????????????????????????????????????????Robotium????????.???????????eclipse??????????????????????????????.???????????д??????:
????Package????????;
Importandroid.test.ActivityInstrumentationTestCase2;
Importcom.liliandroid.helloworld.ActivityMain;
Importcom.jayway.android.robotium.solo.Solo;
PublicclassUITextTestextendsActivityInstrumentationTestCase2<ActivityMain>{
Private Solo solo;
Public UITextTest() {
super("?????е???????????"?? ActivityMain.class);
}
Public void setUp()throws Exception {
solo=newSolo(getInstrumentation()?? getActivity());
}
Publicvoid ????????testcase()throwsException {
}
?????????????????????????????????????????????????????????????????????????????????????apk?????????????????????????????????????????.????????????????????????????赽??????????????????????????:
????http://robotium.googlecode.com/files/RobotiumForBeginners.pdf
??????????????????????????в??趼??????????????????????????????????????????????????????????????????????????????????????????????????????Щ????????е?(?????????????????????????????????apk?й????????????????Щ????????????????):
????pre-install apk???????????
??????Eclipse???д?ò???apk??????????????“???????????????????????”??
???????Linux?????????????ú?Android??????????????SDK??JRE???????????????
?????????????????
????http://code.google.com/p/robotiu ... gn-debug-any-apk.sh
??????Android???е???pre-install??????????Mms.apk??
????adbpull /system/app/Mms.apk
???????Eclipse????????????debug.keystore?????
??????????????Mms.apk??debug.keystore????????Linux???У?
????????????????????????????????
???????????????????
????./sign-debug-any-apk.shMms.apk Mms_signed.apk
?????????????????apk??????????????????μ????“Mms_signed.apk”??
????adb pull /data/system/packages.xml
????Openpackages.xml and remove:
????<packagename="com.android.Mms">
????</package>
????Pushpackages.xml back to device: adb push packages.xml /data/system
????Renamed“Mms_signed.apk”to “Mms.apk”?? then push the apk back to the device: adb push Mms.apk/system/app
????????Eclipse???????????????????????????????????ò??????
????????
??????Un-zip the apk file
??????Delete the META--?INF folder
??????Re?zip the apkfile
??????In Dos prompt /Command prompt
????>jarsigner -keystore~/.android/debug.keystore -storepass android -keypass android ApplicationToTest.apkandroiddebugkey
????> zipalign 4 ApplicationToTest.apkTempApplicationToTest.apk
?????????
#!/bin/bash
set -e
ORIGINAL_APK="$(readlink --canonicalize $1)"
CLEAN_SIGNED_APK="$(mktemp -t robotium.clean.apk.XXXXXXXXXXXXXX)"
UNPACK_DIRECTORY="$(mktemp --directory -t robotium.unpack.XXXXXXXXXXXXXX)"
ZIPALIGNED_APK="$(readlink --canonicalize $2)"
PWD="$(pwd)"
if [ -e "$ORIGINAL_APK" ]; then
if [ "$2" == "" ]; then
echo "Second argument must be the output filename for the signed apk."
exit 2
fi
rm "$CLEAN_SIGNED_APK" 2>/dev/null || true
rm "$ZIPALIGNED_APK" 2>/dev/null || true
cd "$UNPACK_DIRECTORY"
jar xf "$ORIGINAL_APK"
rm META-INF/CERT.*
jar cf "$CLEAN_SIGNED_APK" .
jarsigner -keystore?????????debug.keystore???·??-storepass android -keypass android "$CLEAN_SIGNED_APK" androiddebugkey
zipalign 4 "$CLEAN_SIGNED_APK" "$ZIPALIGNED_APK"
else
echo "First argument must be an apk file."
exit 1
fi
?????????????????????????????sh????У???????д????????MKTEMP -T???????????????????μ?linux???????????????????????????????????(-T???)??linux??.???????????????????:
????1. ???????apk????apk???????????????????????????????????????????????????????????????
????2. ????????MKTEMP?????????????????linux???????????????б?????????
?????????????????????????????????????o??????鹲???????????????????????????????????????google???????????????????10???????????????????apk?????????.
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11