Editing
Guides/Monitoring network traffic from an Android app/editcopy
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===== Get APK files from the device ===== [[File:Android Allow USB debugging popup screenshot.jpg|x500px|thumb|right|alt=Screenshot of a pop-up asking the user to allow or deny USB debugging on Android.|A pop-up that appears after connecting the mobile device to your computer, with <code>adb</code> installed. If the pop-up doesn't appear, try typing <code>adb</code> in the terminal, or try using a different USB cable.]] To modify the application files, we first need to get them onto our computer. <ol> <li>Enable USB Debugging on your mobile device.</li> * To do that, go to ''Settings > Additional settings > Developer options > USB debugging'' (found in the ''Debugging'' section). * If you cannot find the "Developer options" button, you might need to enable Developer Mode by going into ''Settings > About device > Version'' and tapping on the ''Build number'' option seven times. You should get a message saying "You are now a developer!" * If you have any trouble with this, try following [https://developer.android.com/studio/debug/dev-options the official instructions from developer.android.com]. <li>Connect your Android device to your computer using a USB cable. Choose "Android Auto" on your device if prompted.</li> <li> On your mobile device, a pop-up should appear, asking for permission to allow USB debugging. Tap on allow; and if you plan on doing this often, you might want to tap the checkbox to always allow USB debugging from this computer. If the pop-up doesn't appear immediately, don't worry; it might appear after typing the command in the next step.</li> <li>On your computer, open up a terminal and type: <pre> adb shell </pre> You should now have access to your mobile device on your computer via the terminal. [[File:Adb shell Screenshot.png|x40px|thumb|center|alt=A screenshot showing the command "adb shell" typed in a terminal.|''*hacking noises*'' we're in.]] </li> <li> Now we need to find the package ID of the app that we are interested in. One way of doing that is finding the ID in the list of installed packages. In <code>adb</code>, type the following command to show the list of packages installed on the device: <pre> pm list packages </pre> [[File:Pm list packages Screenshot.png.png|400px|thumb|center|alt=A screenshot showing a few of the 443 package IDs.|On my device, this command shows 443 packages. Here is a few of them.]] This command will only show the package IDs, so you cannot search by name. If you have a lot of applications installed, you might want to try piping the command to <code>grep</code>. <code>grep</code> is a command line utility that will filter down results by showing only the lines that have a specified string of text inside of them. For example the following command will show applications that contain the word "Pigeon" in their ID: <pre> pm list packages | grep Pigeon </pre> [[File:Pm list packages with grep example Screenshot.png|x80px|thumb|center|alt=A screenshot showing the filtered results with only two package IDs.|This time, only applications made by Pigeon Games will be shown.]] <br><br> Another way of getting the ID of an application, is just searching the app on the Google Play Store website. When you go to an application page on Google Play, the ID of the package will be embedded in the URL. For ''Rizline'', the link is https://play.google.com/store/apps/details?id=com.PigeonGames.Rizline, and so the package ID is <code>com.PigeonGames.Rizline</code>. <br><br> </li> <li> The next step is to find the path of the APK files on the mobile device. Note that it is common for one application to have multiple APK files. Usually, there is one <code>base.apk</code> file, that is common for all devices, and several <code>split</code> APK files, that are device specific. For example, if your mobile device has a larger screen, it may download a <code>split</code> apk with extra high-quality assets. To find the paths to the APK files, you can use the <code>pm path <package_id></code> command. In our case, the command will be: <pre> pm path com.PigeonGames.Rizline </pre> [[File:Pm path example Screenshot.png|x80px|thumb|center|alt=A screenshot showing two paths to APK files.|''Rizline'' has two APK files - a <code>base.apk</code> file and a <code>split_config.arm64_v8a.apk</code> file.]] Now we know that the paths to our two APK files are: * <code>/data/app/~~tMHzIziIkD3B_oH7sbOphw==/com.PigeonGames.Rizline-P6NKIGPvbzqSbdVySK53MQ==/base.apk</code>, and * <code>/data/app/~~tMHzIziIkD3B_oH7sbOphw==/com.PigeonGames.Rizline-P6NKIGPvbzqSbdVySK53MQ==/split_config.arm64_v8a.apk</code>. We can use that information to download the files from the device to our computer. <br><br> </li> <li> Exit the <code>adb shell</code>: <pre> exit </pre> </li> <li> Create a new directory for our APK files. To do that, you can either create it using a GUI file explorer, or by typing the <code>mkdir</code> command. In my case, the directory name is <code>rizline_mod</code> <pre> mkdir rizline_mod </pre> </li> <li> Navigate to the new directory using the <code>cd</code> command. <pre> cd rizline_mod </pre> </li> <li> Now we can use the <code>adb pull</code> command to copy the files to the computer. <pre> adb pull "/data/app/~~tMHzIziIkD3B_oH7sbOphw==/com.PigeonGames.Rizline-P6NKIGPvbzqSbdVySK53MQ==/base.apk" "base.apk" adb pull "/data/app/~~tMHzIziIkD3B_oH7sbOphw==/com.PigeonGames.Rizline-P6NKIGPvbzqSbdVySK53MQ==/split_config.arm64_v8a.apk" "split_config.arm64_v8a.apk" </pre> The <code>adb pull</code> command takes two arguments: the first one is the path on the mobile device, and the second one is the destination path, on your computer. In this case, we just name the resulting files <code>base.apk</code> and <code>split_config.arm64_v8a.apk</code> respectively. <!--[[File:Adb pull example Screenshot.png|500px|thumb|center|Copying APK files from an Android device to a computer.]]--> </li> </ol> [[File:Adb get apk files full example screenshot.png|1200px|thumb|center|alt=Screenshot of a terminal with all commands used to get APK files from a mobile device.|In summary, here are all of the commands used to copy APK files from a mobile device to a computer]]
Summary:
Please note that all contributions to Rhythm Game Wiki are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Rhythm Game Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Style guide
Archival efforts
Special pages
Games
Rizline
Gadvia
Arcaea
pages
Rizline discs
Rizline files
Gadvia islands
Gadvia buildings
Tools
What links here
Related changes
Page information